镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

feat(server): add toggles for Codex developer instructions and the t3-code MCP server - #4

Closed
hwanseoc wants to merge 1 commit into
mainfrom
feat/provider-injection-settings
Closed

hwanseoc wants to merge 1 commit into
mainfrom
feat/provider-injection-settings

Conversation

@hwanseoc

Copy link
Copy Markdown
Owner

Problem

T3 Code injects its own context into every agent session with no way to opt out: Codex turns always get developer_instructions (collaboration mode rules, the Plan mode contract, and preview browser guidance), and every provider session is offered the t3-code MCP server that exposes the preview_* browser tools. Users who want providers to run closer to their native behavior have to fork the server.

Fix

Two new settings, both defaulting to on (no behavior change unless toggled):

  • Developer instructions — a per-instance switch on Codex providers (Settings → Providers). Gates the developer_instructions payload in buildCodexCollaborationMode, threaded through the existing makeCodexAdapter(codexConfig) closure into CodexSessionRuntimeOptions. The switch renders automatically from the schema-driven provider settings form.
  • Agent browser tools — a Settings → General switch backed by a new enableMcpServer server setting. Gates credential issuance in ProviderService.prepareMcpSession, so no adapter (Codex, Claude, Cursor, Grok) is offered the t3-code MCP server. It is read at session start, so toggling applies to the next session without a server restart, and turning it off revokes the thread's previously issued credential.

Both patches flow through the existing generic deepMerge settings patch path; no merge code was added. The relationship between the two is called out in each setting's description: the developer instructions reference the preview browser tools, so disabling the MCP server while leaving instructions on tells agents about tools that are not there.

Surface walkthrough:

  • Clients: web and desktop get both toggles. Mobile has no provider/server settings forms, so there is nothing new to render there; behavior is server-authoritative and applies to any connected client.
  • Providers: the developer-instructions gate is Codex-only (other adapters don't receive that payload); the MCP gate is global and applies uniformly at issuance time.
  • Contracts: CodexSettings.injectDeveloperInstructions and ServerSettings.enableMcpServer, both with decoding defaults so older settings files and older clients decode unchanged.
  • Reverse states: booleans are two-way by construction; turning MCP off also revokes outstanding credentials.
  • Docs: short section added to docs/user/providers-codex.md for the Developer instructions toggle. The MCP toggle's in-app description is its documentation.

Verification

  • New focused tests: CodexSessionRuntime.test.ts (developer instructions omitted when injection disabled) and ProviderService.test.ts (credential issued when enabled, withheld when disabled).
  • vp test run on the five touched test files: 101 passed.
  • Targeted tsgo typecheck for contracts/server/web and vp lint on touched files: clean.
  • Browser pass on a dev server: flipped both switches and confirmed persistence to settings.json (enableMcpServer: false, providerInstances.codex.config.injectDeveloperInstructions: false) and correct stripping back to defaults when re-enabled.

Screenshots

Before After
Settings → General before-general after-general
Settings → Providers → Codex before-codex after-codex

— Kimi K3 via OpenCode

…-code MCP server

Both default to on, preserving current behavior. The Codex provider
grows a Developer instructions switch (schema-driven, per instance) that
gates the developer_instructions payload on Codex turns. Server settings
grow an enableMcpServer toggle that gates MCP credential issuance in
ProviderService, so agents are no longer offered the preview browser
tools; it applies on the next session start without a server restart.
@hwanseoc

Copy link
Copy Markdown
Owner Author

Superseded by two focused PRs per contributing guidelines (one concern per PR): #5 (Codex developer instructions toggle) and #6 (t3-code MCP server toggle).

@hwanseoc hwanseoc closed this Jul 31, 2026
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