Skip to content

MCP profiles part 5 (Codex): follow-ups from the lens reviews #814

Open

Description

@scuttletoby

Follow-ups from the two lens reviews of MCP profile part 5 (Codex servers), seam PR #801:

The fix round on branch fork/mcp-profile-codex closed both blocking items and the majors (see the "Fix round (code branch)" comment on #801). These were left. None of them gives a thread more servers than its profile.

  1. MCP4/MCP5 turn-check split (lens A 5, lens B 6). MCP4 (fork/mcp-profile-t3-tool-groups) fixes each non-Claude thread's T3 tool set in mcpProfileTurnCheck.checkTurnProfile. MCP5 adds codex to MCP_PROFILE_DRIVERS, which takes Codex out of that path. Whichever of the two merges second must split the check: fix the T3 tool set for every driver, and refuse outside servers only for drivers not in MCP_PROFILE_DRIVERS. Safe today, because Codex refuses any t3Tools other than "all". Expect a text conflict in the MCP_PROFILE_DRIVERS comment.
  2. MCP-Apps calls are not checked (lens A 7). mcpServer/tool/call, mcpServer/resource/read and mcpServerStatus/list sent by the UI through withLoadedThread do not pass the turn check. Low impact.
  3. A user's own server named t3-code or t3-code-direct is never switched off (lens A 8).
  4. The store refusal also hits all threads (lens A 9, lens B 5). A projection lag would break every Codex thread. The docs now say so. A code change could resolve a thread missing from the store as all when no profile setting exists at all.
  5. The narrowed latch covers the whole app-server (lens B 3). Codex sub-agents T3 has seen spawned are now counted as their parent's thread, so their model lookup loads under the parent's profile. A sub-agent from before an app-server restart is still refused (cosmetic: its model is not shown).
  6. Gate MCP tool calls per call. Codex asks the client before an MCP tool call (mcpServer/elicitation/request with codex_approval_kind: "mcp_tool_call"). Denying calls to servers outside the profile there would also cover the remaining edges below, as Claude's per-call check does.
  7. Edges of the turn watch. A turn already running when the profile is narrowed keeps its servers until it ends (documented). A Codex-started turn that ends before its check returns is not stopped; its goal is still paused, without a message. A sub-agent's first turn can start before T3 sees the spawn item; it runs with the set its parent's checked turn had.
  8. Plugin servers. A server a Codex plugin adds is not switched off; every turn is refused while it is on (fail closed). It could be switched off with plugins."<id>".mcp_servers.<name>.enabled = false (the id is in mcpServerStatus/list's pluginId), but only after a first load.

Activity

  1. scuttletoby commented on Nov 21, 2026

    @scuttletoby
    OwnerAuthor

    Orchestrator diff check of the fix round (branch fork/mcp-profile-codex 3c0db1b): OK to go ahead. Two small follow-ups for this issue:

    • watchTurn checks only Codex threads already in known. A turn on a thread T3 has not seen yet (e.g. a Codex sub-agent whose receiverThreadIds arrive only on item/completed, after its first turn started) is not checked, even while a narrowed profile is in use. Sub-agents copy the parent's loaded config, so this matters only when the profile was narrowed after the parent loaded. Consider: while narrowed, stop a turn on an unknown thread unless it is adopted within a short wait.
    • The turn check runs after turn/started (forked), so a stopped turn can run briefly (a model step, possibly a tool call) before the interrupt lands. Say so in docs/fork, or hold the first tool call of a watched turn until its check finishes.
  2. scuttletoby commented on Nov 22, 2026

    @scuttletoby
    OwnerAuthor

    Orchestrator decision on item 8 (switch off a plugin's MCP server): keep today's behaviour. A turn that would reach a plugin server outside the profile is refused, which is safe. Switching the server off would need a Codex config key Codex does not validate, and a wrong plugin id could make Codex refuse the whole thread. Revisit when Codex validates that key. Items 2-7 are in #961; this issue closes when #961 merges and item 8 is tracked here as 'won't do for now'.

    🤖 Generated with Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions