Skip to content

refactor(core): drop the legacy Console config path - #59595

Merged
vimtor merged 3 commits into
devfrom
drop-legacy-config
Oct 27, 2026
Merged

vimtor merged 3 commits into
devfrom
drop-legacy-config

Conversation

@vimtor

@vimtor vimtor commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

The OpenCode Console now serves a regular OpenCode config to every OpenCode build that can read one, so the plugin no longer needs to understand the Console's original /api/v2/config response. This removes that second code path, which applied providers, policies, web search and MCP servers itself, so there is one way Console settings reach the client: a config layer.

Stacked on #59592 (Console web search gate); the first commit here is that PR.

  • packages/core/src/plugin/provider/opencode-legacy.ts: deleted.
  • packages/core/src/plugin/provider/opencode.ts: the snapshot holds the Console's config or nothing. Publishing, the web search gate, the inference explainer and the fetch read it directly; the $schema check is gone.
  • packages/core/src/config/plugin/policy.ts: comment no longer describes legacy Console statements.
  • packages/core/test/plugin/provider-opencode.test.ts:
    • Policy, SSO, polling and hosted-search tests now use the regular format, reading policies from the merged Console document and naming the Console search provider explicitly.
    • Removed tests that only covered the legacy response: credential headers on Console MCP servers, legacy unknown-action handling (covered for the regular format by "keeps a newer Console config loadable"), and binding legacy statements to an account (covered by "replaces the Console config on an account switch").

Follow-up, not in this PR: ManagedPolicy's statements are now only set by tests, which use it to inject organization policy into skill, MCP and plugin tests. Removing the service means moving those tests onto config documents.

@vimtor
vimtor marked this pull request as ready for review October 27, 2026 11:45

@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.

I found no problems with this change. I checked it by running provider-opencode.test.ts (47 pass) and the wider packages/core config and plugin suites (706 pass). tsc -b tsconfig.json tsconfig.tests.json is clean. The typecheck script itself failed here with "Script not found "check"", so I ran tsc directly. I can't run a real Console sign-in here, so the tests' mock Console server is the coverage.

Every 200 response from /api/v2/config is now read as a regular config. Policies reach the policy plugin through the Console's config document, and the hosted search provider is offered only when that config names opencode.

Public API: unchanged. No SDK, HTTP API, plugin API, config key or CLI change. Only the client's reading of the Console's private /api/v2/config response changes. A Console still sending the old response would silently lose the credential headers on its MCP servers and its web search default. That's fine as long as every Console serves the regular format, as the description says.

No blocking concerns.

# Conflicts:
#	packages/core/src/plugin/provider/opencode.ts

@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 new commit only merges dev. This PR's own changes are the same as in my last review, and my earlier review left no open threads. After the merge, provider-opencode.test.ts still passes (47 of 47) and tsc -b is clean. The public API is still unchanged. No new concerns.

@vimtor
vimtor merged commit 5e31344 into dev Oct 27, 2026
13 checks passed
@vimtor
vimtor deleted the drop-legacy-config branch October 27, 2026 13:05
alsuren pushed a commit to alsuren/opencode that referenced this pull request Oct 28, 2026
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