Skip to content

fix(core): offer Console web search only when the workspace enables it - #59592

Merged
vimtor merged 1 commit into
devfrom
websearch-gate
Oct 27, 2026
Merged

vimtor merged 1 commit into
devfrom
websearch-gate

Conversation

@vimtor

@vimtor vimtor commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Since 2.2.0, members signed in to an OpenCode Console workspace that hasn't turned on hosted web search, or whose policy blocks it, still see OpenCode Web Search in the search picker and in random selection. Searching through it fails with "not found" or "forbidden", and the failure isn't retried with another provider. Production shows it: in three hours, 2.2.0 clients got 292 not-found and 45 forbidden responses from Console web search against 35 successful searches, while 2.1.4 clients got none.

The Console's config already selects its search provider only when the workspace enabled it and the member's policy allows it. The plugin now offers the provider only in that case, as it did before 2.2.0. A member's own websearch.provider still wins over the Console's selection.

  • packages/core/src/plugin/provider/opencode.ts: register the Console search provider only when the Console config's websearch.provider is opencode.
  • packages/core/test/plugin/provider-opencode.test.ts: the provider is absent until the Console selects it, then present and used; user config still wins. Fails if the gate is removed.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The change looks correct. The Console web search provider is now offered only when the Console's config selects opencode. That matches how the legacy Console path (opencode-legacy.ts) gates on its descriptor and how this worked before #57703. A missing or false websearch is handled. A member's own websearch.provider still wins, because the selection still merges as config.

I ran the updated test on the base and it fails there, which reproduces the problem. With this PR the whole provider-opencode.test.ts file passes (50/50), and tsc -b for packages/core passes. The test change is small and clear.

Public API: unchanged.

No concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant