Skip to content

#827 follow-ups: Codex tool-set timing and failed-read caching #918

Open

Description

@scuttletoby

Follow-ups from the two review lenses on #827 (security: SAFE, state: SAFE). None block; none gives a thread more than its profile allows.

From the security lens

  1. apps/server/src/fork/codexMcpProfile.ts:340-353: when Codex starts a turn by itself, the narrowed T3 tool set is fixed a few milliseconds after the turn starts. Fix the set before the turn can make its first request.
  2. apps/server/src/fork/codexMcpProfile.ts:289 (reached from watchTurn at :340-342 and from thread/goal/set at :322-324): a sub-agent turn, or a goal set to active, fixes the parent thread's set again while the parent's turn is still running, so a profile change can reach a running turn early. The docs say a running turn keeps its set: fix the code or the docs.
  3. apps/server/src/fork/codexMcpProfile.ts:341: a turn on a thread T3 has not seen yet keeps the last set it had.
  4. Requests that do not come from a thread (for example a shell t3 command) see every T3 tool. Already documented; listed here so it stays a known limit.

From the state lens
5. apps/server/src/fork/mcpT3ToolFilter.ts:234-239: if a request arrives before any turn (Codex listing tools while loading a thread) and the store or settings read fails right then, the refused set is remembered. A provider that lists tools once keeps the short list after the next turn fixes the real set. Do not remember a failed read; work it out again on the next request.
6. apps/server/src/fork/mcpProfileTurnCheck.ts:121: each Codex turn works out its profile three times, each reading settings and the store. Work it out once per turn.

Each fix needs a test that fails without it.

Part of #814.

🤖 Generated with Claude Code

Activity

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