Repository navigation
codex: opt-in route where incode's toolbox runs every tool call; team identity reaches codex's MCP server - #17
Merged
Conversation
With `codex_tools: "incode"` in admin.json (or INCODE_CODEX_TOOLS=incode), codex is driven like the Claude route: a model only, its own tools switched off by `-c` overrides, `--ignore-user-config`, read-only + approval never, and one MCP server — `incode --tool-server` — reached over the tool bridge. runs_tools_here() is true there, so allowed-tools, permission rules, guards, hooks, the engine and the OS sandbox apply and the "not enforced" notice stops. The default stays `own`, byte-identical (argv pinned by a test), until a turn with a real model has run this way. Every override was read from codex's source (rust-v0.163.0, checked against 0.153.4 and 0.145.0) and measured on the 0.163.0 binary against a stand-in Responses endpoint that recorded the tool list, then end to end through `incode -t`: a scripted Write ran in the toolbox, a deny rule refused one, and apply_patch (no switch exists) was rejected unrun. - tool_bridge: the turn loop (Incoming, pump, Turn::open, drive, CANCELLED) factored out of claude_code and shared. - codex: CodexTools, MODEL_ONLY_OVERRIDES, the bridge registration (env_vars — codex passes a stdio server only listed variables —, approve, required, tool_timeout_sec, omit_tools_from), bridged_command, run_bridged, toolbox forwarding, one line reader for both routes that does not show codex's echo of incode's own calls twice. - admin: codex_tools, resolve_codex_tools, the report line. - cli: codex_backend builds either route. - agy: why it cannot be bridged. README, ARCHITECTURE §5a, ROADMAP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011DiH8n52ifWoCd5Kx2aHwT
Codex starts an MCP stdio server with only HOME, PATH and a few others plus the variables named in its env_vars (codex rmcp-client/src/utils.rs), so INCODE_TEAM_AS, set on codex's own process, never reached incode's team server and its messages were filed as unrouted. The override now names it. Found while bridging codex's tools; an older codex ignores the key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011DiH8n52ifWoCd5Kx2aHwT
This was referenced Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
codex through incode's tools (
codex_tools: "incode"in admin.json, orINCODE_CODEX_TOOLS=incode)allowed-tools, hooks, sandbox and the memory engine's checks now apply to codex.runs_tools_here()is true on this route, so the "not enforced" notices stop.own): with it off, codex starts exactly as before, and a test pins the old command line on both the fresh and the resumed spawn.-ckeys):features.shell_tool,view_image,web_search,goals,request_user_input, sub-agents, apps, plugins, browser and computer use are switched off;--ignore-user-configstops codex reading the operator's own config and MCP servers;env_varshands the bridge address and token to the tool server;default_tools_approval_mode="approve"stops codex refusing incode's calls itself;omit_tools_from=["deferred"]keeps incode's tools from being hidden behind codex's tool search.apply_patchcan't be removed (the model catalogue decides), so codex runs withsandbox_mode="read-only", which rejects a patch before it is applied (seen live).claude_code.rstotool_bridge.rsand is shared; the Claude route's behaviour is unchanged.agy mcp add. Now written inagy.rsand the README.docs/ARCHITECTURE.md§5a, anddocs/ROADMAP.md.Fix: team messages from codex were unrouted
HOME,PATHand a few others, plus the variables named inenv_vars.INCODE_TEAM_ASnever reached the team server, so codex's messages were filed as unrouted.Test plan
scripts/test-all.sh, all parts pass:clippy -D warnings,cargo test --lib(2,117),--bins(52),sbx_engine,-p incord-sandbox;--admin.mcp_tool_calloutput parses; each call is shown once, under incode's id.Writeover MCP: one write lands through incode's toolbox, and one is refused by aWrite(secret.txt)deny rule with nothing written.incode -t, against a local stand-in model endpointown.Generated by Claude Code