Skip to content

feat(core): merge Console config as a config layer - #57703

Merged
vimtor merged 8 commits into
devfrom
console-config-source
Oct 25, 2026
Merged

vimtor merged 8 commits into
devfrom
console-config-source

Conversation

@vimtor

@vimtor vimtor commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

A Console that serves a regular OpenCode config, marked by $schema, is now merged like any config file. This lets the Console manage providers, remote MCP servers, policies, and the web search selection through config itself, with no special cases in the client.

  • The response becomes one integration config document. Only providers, remote mcp servers, policies, and websearch are kept. Plugins, shell, local MCP servers, agents, commands, permissions, and every other key are dropped. Provider credentials and env are stripped, and Console providers are bound to the Console connection.
  • The document loads right after MDM/system managed policies. User and project config override its settings, but its policies outrank theirs. MDM policies now outrank Console policies on this path. Denials still name the organization (Blocked by Acme's policy).
  • The Console search provider is registered whenever the Console is connected, but it is not forced as the default. The Console's websearch selection picks it, and a user's own selection wins.
  • The document is cleared on sign-out and on 404, and replaced on account switch.

Responses without $schema keep today's behaviour unchanged. That code now lives in opencode-legacy.ts, so it can be deleted once every Console serves the new format. Old Consoles and the current Console are unaffected, and the Console will send the new format only to clients that support it.

Testing

  • test/plugin/provider-opencode.test.ts: the existing legacy tests pass unchanged. New config-path tests cover format detection, the allowlist and credential stripping, provider layering, web search selection, and account switch/sign-out.
  • test/config/config.test.ts: integration document layering, plus policy precedence (MDM > Console > user/project) and the organization denial message.
  • Each new test was checked to fail under a minimal breaking change.

Added by the opencode bot (AI-generated).

Public API: adds optional Config.integration() and a $schema Console config format; legacy Console responses unchanged (backwards compatible)

@vimtor vimtor changed the title refactor(core): apply Console config as a config layer feat(core): merge Console config as a config layer Oct 21, 2026
@vimtor
vimtor marked this pull request as ready for review October 22, 2026 12:21

@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 sound overall. The legacy split keeps responses without $schema on their current behaviour, and the precedence order (MDM > Console > user/project) matches the code and the tests. I ran the two closest test files and the core type check, and both pass. I could not run it end to end, because that needs a Console serving the new format.

Public API: Config.Interface gets a new optional integration(integrationID, document) method, and ConfigIntegration.Document / Remote are new. The Console response contract grows a $schema config format with a top-level voice beside it. In that format, MDM policies now outrank Console policies. Legacy responses still work as before, so this is backwards compatible.

Concerns:

  • MCP auth (inline): on the new path, auth: "console" is no longer supported. It is silently dropped, so those MCP servers connect without the Console credential.
  • Web search ID: on the config path, the Console search provider is always registered as opencode, and that is the providerID sent to /api/websearch. Before, the Console chose the ID. Please confirm the Console endpoint accepts this.

}),
]),
),
// Local servers would run a command on this machine.

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.

In the legacy response, an MCP server with auth: "console" got the Console credential headers added (OpencodeLegacy). Config.Info.fields.mcp has no auth field, and the extra key is silently ignored here. So a new-format Console can't define a Console-authenticated MCP server. It would connect without credentials, and static headers in the document would not follow token rotation. Could this path keep auth: "console" and add the connection's headers (for example when the document is built in publish), or reject such servers explicitly?

# Conflicts:
#	packages/core/src/plugin/provider/opencode.ts
#	packages/core/test/plugin/provider-opencode.test.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.

This push merges dev and drops the Console voice host, which matches the base where hosted voice is no longer in the Console plugin. Inlining the connection check in web search keeps the same behaviour. The closest tests (config and provider-opencode) and the core type check (tsc -b) pass. I still couldn't run it end to end without a Console serving the new format.

The earlier point about auth: "console" MCP servers on the config path is not addressed yet. That thread stays open.

Public API: Config.Interface gets a new optional integration() method, and the Console response gets a new $schema config format. The top-level voice offer is no longer part of the new format. Legacy responses are unchanged, so this stays backwards compatible.

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

This push merges dev. In this pull request's files it only switches to dev's ConsoleAccess helpers for the Console server URL and credential headers, so behaviour is the same. The closest tests and the core type check (tsc -b) pass. I still couldn't run it end to end without a Console serving the new format.

The earlier point about auth: "console" MCP servers on the config path is still open.

Public API: this push changes nothing beyond what I reviewed before. That is the new optional Config.integration() method and the $schema Console config format; legacy responses are unchanged, so it stays backwards compatible.

@vimtor
vimtor merged commit a41d09b into dev Oct 25, 2026
12 checks passed
@vimtor
vimtor deleted the console-config-source branch October 25, 2026 10:04
@amrkmn amrkmn mentioned this pull request Oct 27, 2026
1 task
wthrbtn added a commit to air-gapped/skills that referenced this pull request Nov 10, 2026
…emote config layer (v2.2.0)

Classification: new-feature (in scope: the harness promises no MCP servers)
Source: anomalyco/opencode#57703 (merged 2026-10-25; v2.2.0 release notes 'Apply OpenCode Console workspace configuration as a configuration layer'): the Console's config is merged like a config file - providers, remote MCP servers, policies and the web search selection; its policies outrank user and project config.
Cross-check at v2.2.6: packages/core/src/config/integration.ts, ConfigIntegration.Remote allow-lists providers, mcp, policies, websearch for a document delivered by an integration connection.
Before: residual leaks listed only .well-known remote config
After:  one more row for a Console login used as --credential, with the mitigation

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant