GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(core): add Claude Agent as a web search provider by levtechs · Pull Request #65704 · anomalyco/opencode

Conversation

@levtechs

@levtechs levtechs commented Nov 23, 2026 •
edited by opencodejr Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Issue for this PR

Related: #64996, #10704, #63487, #63784

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds an opt-in websearch provider, claude-agent, served by the Claude Agent plugin while it's connected. It runs Claude Code's WebSearch, which Claude plans include, so any model can use opencode's websearch tool without a search API key or Console credit. It's never the default: you select it with "websearch": { "provider": "claude-agent" }.

#64996 asked for this and was closed because handing Claude its own WebSearch would break session continuity when you switch to a non-Claude model. This PR avoids that problem: Claude Code's built-in tools stay off for chats. The search runs behind opencode's own websearch tool, so results are stored as ordinary tool output that every model can read.

How it works:

  • Each search is a one-off Haiku run with only WebSearch allowed, no transcript and thinking off. It's closed as soon as the results arrive and times out after a minute. A model has to run the search because WebSearch returns page contents encrypted. Haiku is the cheapest.
  • Searches use the provider's connection settings (baseURL, headers and so on) and the account folder the chats used last (configDir).
  • Copies of one page (/de/... locale folders, hl/authuser variants, .md.txt mirrors) are listed once, under the shortest URL. Claude's summary rides on the first result.

This was reviewed and merged first in the beta repo, Tarquinen/opencode-claude-agent#9. This PR ports that code into core, with the tests adapted to core's plugin test harness. Docs are in websearch.mdx, claude-agent.mdx and the spec.

How did you verify your code works?

  • bun test test/plugin/provider/claude-agent test/plugin/websearch.test.ts test/websearch.test.ts test/tool-websearch.test.ts test/config/websearch.test.ts: 160 pass, 0 fail. The new tests cover de-duplication, offering the provider only while connected, searching with only WebSearch and no session persistence through the configured base URL, and following the last-used account folder.
  • bun run typecheck: clean.
  • Ran it day to day with the beta plugin. With websearch.provider: "claude-agent", the websearch tool returned correct results for openai/gpt-6.2-sol, claude-agent/sonnet and opencode/big-pickle.
  • Model swaps: I searched on GPT and continued the same session on Claude Agent Haiku, then did the reverse with Sonnet and GPT. In both directions, the second model quoted the earlier tool output's URLs and summary, and they matched what was stored.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Related: #64996, #10704

Public API: adds the claude-agent value for websearch.provider, offered while Claude Agent is connected (opt-in, backwards compatible)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@levtechs @Tarquinen
feat(core): serve opencode's web search with Claude Agent's WebSearch
eb73553
While Claude Agent is connected, it adds a websearch provider, claude-agent,
that runs Claude Code's WebSearch. Searches count toward the user's Claude plan,
so every model can search the web without a search API key. It is never the
default; users pick it with "websearch": { "provider": "claude-agent" }.

Each search is a one-off Haiku run with only WebSearch, no transcript and
thinking off, closed as soon as the results arrive and timed out after a
minute. It uses the provider's connection settings and the account folder
chats used last. Copies of one page are listed once, and Claude's summary
rides on the first result.

Because results come back through opencode's own websearch tool, they are
stored as ordinary tool output and survive switching between Claude Agent
and other models.

Ported from Tarquinen/opencode-claude-agent#9.

Co-authored-by: Dan Smolsky <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 04:19
Copilot AI reviewed Nov 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
opencodejr[bot]
opencodejr Bot reviewed Nov 23, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't verify a real search here: it needs a logged-in Claude Code and network access. In packages/core the claude-agent and websearch tests pass (159 pass, 0 fail) and tsc --noEmit on the source is clean. The new tests use the recorded fake-Claude setup and check the right things (offered only while connected, a WebSearch-only claude run, the forwarded base URL and the last-used account folder).

Public API: one addition, the new provider ID claude-agent for websearch.provider (opt-in, backwards compatible). No other config, event, SDK or server changes.

Concerns:

  • Needs maintainer sign-off. In #64996 the maintainer gave two reasons for declining. This PR answers the first: results are saved as ordinary websearch tool output, so they still work after switching to a non-Claude model. It doesn't answer the second: opencode only matches Claude features it offers itself. A maintainer should confirm they want this before it goes further.
  • Duplicate-link check can drop real results (inline).
  • Haiku is hard-coded (inline). Users whose baseURL points at a gateway that doesn't serve Haiku may see every search fail.

Related: #64996, #10704

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/core/src/plugin/provider/claude-agent/claude/websearch.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/core/src/plugin/provider/claude-agent/claude/websearch.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Tarquinen Tarquinen changed the title feat(core): serve opencode's web search with Claude Agent's WebSearch feat(core): add Claude Agent as a web search provider Nov 23, 2026
@Tarquinen
refactor(core): list Claude's search results as Claude Code returns them
cbf8a87
opencodejr[bot]
opencodejr Bot reviewed Nov 23, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commit fixes the duplicate-link problem from my last review: the de-duplication that could merge unrelated pages (such as /it/foo and /foo) is gone, and results are listed as Claude Code returns them. The spec is updated to match, and the site docs never described it. The claude-agent and websearch tests still pass (158 pass, 0 fail) and tsc --noEmit on packages/core is clean. I still couldn't run a real search here, since that needs a logged-in Claude Code and network access.

Public API: unchanged since the last review. The only addition is still the opt-in claude-agent value for websearch.provider, which is backwards compatible.

The earlier point still stands: given #64996, a maintainer needs to agree to this feature.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Tarquinen
Tarquinen merged commit 8bae58e into anomalyco:dev Nov 23, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Tarquinen

Tarquinen commented Nov 23, 2026

Copy link
Copy Markdown
Member

nice!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Tarquinen Tarquinen mentioned this pull request Nov 23, 2026
refactor: list Claude's search results as Claude Code returns them Tarquinen/opencode-claude-agent#10
Merged
@levtechs
levtechs deleted the feat/claude-agent-websearch branch November 23, 2026 13:04
@BrewTestBot BrewTestBot mentioned this pull request Nov 23, 2026
opencode 2.4.0 Homebrew/homebrew-core#327368
Merged
@amrkmn amrkmn mentioned this pull request Nov 23, 2026
opencode 2.4.0 amrkmn/homebrew-tap#1251
Closed
1 task
@deinspanjer deinspanjer mentioned this pull request Nov 23, 2026
feat(core): switch Claude Agent accounts by config folder #65226
Open
3 of 6 tasks
deinspanjer added a commit to deinspanjer/opencode that referenced this pull request Nov 23, 2026
@deinspanjer
feat(core): run Claude Agent in the active account's config folder
6c693a5
Makes account switching work for Claude Agent as it does for providers whose token opencode holds: `auth switch`, `/connect` and plugins that activate a credential now change the Claude login for every model, with no model aliases.

- Use the active account's folder for the login check, the model list and chats when no `settings.configDir` is set
- Read the folder on each request instead of projecting it into provider settings, so the retry that follows an account switch cannot run on the old account before a provider reload lands
- Claude Agent web search (anomalyco#65704) uses the same folder, so a search runs on the chats' account
- A configured `settings.configDir` still wins, so the per-model and rotation setups keep working
- Document the setup and the precedence
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
feat: opencode release v2.4.0 sprisa/opencode-server#95
Merged
deinspanjer added a commit to deinspanjer/opencode that referenced this pull request Nov 25, 2026
@deinspanjer
feat(core): run Claude Agent in the active account's config folder
0f7fae2
Makes account switching work for Claude Agent as it does for providers whose token opencode holds: `auth switch`, `/connect` and plugins that activate a credential now change the Claude login for every model, with no model aliases.

- Use the active account's folder for the login check, the model list and chats when no `settings.configDir` is set
- Read the folder on each request instead of projecting it into provider settings, so the retry that follows an account switch cannot run on the old account before a provider reload lands
- Claude Agent web search (anomalyco#65704) uses the same folder, so a search runs on the chats' account
- A configured `settings.configDir` still wins, so the per-model and rotation setups keep working
- Document the setup and the precedence
@scottames-github-bot scottames-github-bot Bot mentioned this pull request Nov 27, 2026
chore(deps): update ⬆️ mise-packages scottames/dots#1181
Merged
1 task
deinspanjer added a commit to deinspanjer/opencode that referenced this pull request Nov 27, 2026
@deinspanjer
feat(core): run Claude Agent in the active account's config folder
95edef5
Makes account switching work for Claude Agent as it does for providers whose token opencode holds: `auth switch`, `/connect` and plugins that activate a credential now change the Claude login for every model, with no model aliases.

- Use the active account's folder for the login check, the model list and chats when no `settings.configDir` is set
- Read the folder on each request instead of projecting it into provider settings, so the retry that follows an account switch cannot run on the old account before a provider reload lands
- Claude Agent web search (anomalyco#65704) uses the same folder, so a search runs on the chats' account
- A configured `settings.configDir` still wins, so the per-model and rotation setups keep working
- Document the setup and the precedence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Tarquinen Tarquinen Tarquinen left review comments
Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@levtechs @Tarquinen
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.