Skip to content

fix(codex): keep plugin loaded for explicit multi-agent gateways - #124172

Merged
steipete merged 1 commit into
mainfrom
codex/codex-session-catalog-owner-routing
Aug 15, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/codex-session-catalog-owner-routing

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Gateways with multiple explicitly owned agents lost the bundled Codex plugin during startup. The Gateway remained generally healthy, but Codex session catalogs, harness turns, tools, hosted search, and media support were all absent because plugin registration threw AgentSelectionRequiredError before any request owner existed.

Regression provenance: #123899 added the eager bind in squash merge 632581477f042de83bfdc095b9fdb042330deb72. Line blame attributes it to WhatsSkiLL (PR author @IWhatsskill); the PR was merged by @steipete on 2026-08-15.

Why This Change Was Made

Codex registration is now owner-neutral. The already-authorized catalog request carries its agent ID through every paired-node list, transcript, continuation, eligibility, history, and terminal-resume hop; the node binds CodexSessionCatalogControlFactory.forRequest(agentId) only when handling that request. Missing owners still fail closed for explicit multi-agent configurations, and config reloads cannot retain a startup-selected owner.

This is the owning boundary because Codex App Server has no OpenClaw-agent field: it resolves one CODEX_HOME at process startup and keeps one process-scoped thread store. Upstream source: find_codex_home, process-scoped thread store, and thread/list store dispatch.

Production LOC: +66/-22 (net +44) | Tests: +133/-16. The production growth is the explicit ownership handoff across the five paired-node operation families; it replaces the invalid single registration-time owner with one canonical request-bound flow.

User Impact

Operators can run Codex on explicit multi-agent Gateways without losing the plugin at startup. Paired-node catalogs and terminals now use the selected agent's Codex home instead of an ambient default. Release-note context: fix Codex plugin startup and paired-node ownership for explicit multi-agent configurations.

Evidence

  • Immutable built-output A/B reproduction with the same explicit three-agent config:

    94a06613227b5d1bedea7115af39b4219b81c104 register ok
    3109bc3b5d1504ee635bd25aee0f7ac14379df99 AgentSelectionRequiredError: session agent resolution has no explicit owner
    
  • Focused regression proof: pnpm test extensions/codex/index.test.ts extensions/codex/src/session-catalog.test.ts — 138/138 passed. It covers explicit registration with the catalog enabled and disabled, sole-to-explicit config reload, beta-only control selection, missing-owner rejection, beta CODEX_HOME, and alpha/beta paired-node continuation isolation.

  • Changed gate: pnpm check:changed — all selected formatting, guards, plugin boundaries, typechecks, lints, dead-export, database-first, and import-cycle checks passed on Blacksmith Testbox run 31884284652.

  • Structured autoreview: clean, with no accepted/actionable findings.

  • git diff --check: clean.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 15, 2026, 9:01 AM ET / 13:01 UTC.

ClawSweeper review

What this changes

The PR defers Codex session-catalog agent binding until each paired-node request so explicit multi-agent gateways do not fail during plugin registration.

Regression provenance

Possible regression — probable (reviewed change; known regression link). No predecessor PR is attributed.

Merge readiness

⛔ Blocked by patch quality or review findings - 8 items remain

Keep open: the earlier P1 remains. This PR sends agentId through existing paired-node v1 commands, but an older paired node advertises the same command names while rejecting that extra key, so a Gateway-first upgrade breaks catalog operations. Likely related people: IWhatsskill (feature introduction) and steipete (merge/follow-up), medium confidence.

Priority: P1
Reviewed head: d1c02043abbfd6d7c6d017870939efc527bddbf0
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch has focused regression coverage and a coherent local repair, but the unresolved P1 rolling-upgrade break prevents merge readiness.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; the reported A/B output supports the regression context but does not resolve the node-version finding.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; the reported A/B output supports the regression context but does not resolve the node-version finding.
Evidence reviewed 6 items Current registration failure path: Current main selects a session agent and binds the node catalog control during plugin registration, before a catalog request has supplied an owner.
Old node handlers reject the new field: The current v1 catalog parser rejects every key outside its fixed allowlist, including agentId.
PR sends agentId over unchanged command: The branch adds agentId to a paired-node invocation without changing the command name or advertising a separate capability.
Findings 1 actionable finding [P1] Version the agent-aware node command
Security None None.

How this fits together

The bundled Codex plugin registers catalog commands with a Gateway, which then asks paired nodes to list, read, continue, or resume Codex sessions. The selected agent determines the Codex home used by each node-side command.

flowchart LR
A[Gateway catalog request] --> B[Selected agent]
B --> C[Paired-node command selection]
C --> D[Node command handler]
D --> E[Codex App Server]
E --> F[Sessions and terminal resume]
Loading

Decision needed

Question Recommendation
Must a Gateway upgraded ahead of paired nodes preserve catalog access, or may explicit multi-agent catalog operations require every paired node to upgrade first? Preserve rolling upgrades: Add an agent-aware command or capability, select it only when a node advertises support, and cover new-Gateway/old-node behavior.

Why: That upgrade policy determines whether this change needs an additive node protocol/capability or an intentional incompatibility boundary, and repository policy requires owner confirmation for protocol-version direction.

Before merge

  • Version the agent-aware node command (P1) - This new field is sent to paired nodes that may still advertise the unchanged v1 command. Those old handlers reject unknown keys, while node discovery checks only the command name, so a Gateway-first upgrade makes catalog actions fail until every node upgrades. Advertise a new capability or command and route only compatible nodes; add a mixed-version regression.
  • Resolve merge risk (P1) - A Gateway upgraded before its paired nodes sends agentId to old strict v1 handlers, causing listing, transcript, continuation, and terminal lookup requests to fail rather than preserving or clearly negotiating compatibility.
  • Resolve merge risk (P1) - The bug fix grows production code by 44 net lines; request-bound binding is a coherent owner boundary, but its added flow should be consolidated with the required command-version negotiation where possible.
  • Resolve merge risk (P1) - The Codex App Server rationale could not be independently checked because the required sibling source checkout and external source access are unavailable in this review environment.
  • Complete next step (P2) - A maintainer must set the rolling-upgrade policy for paired-node command compatibility before a mechanical protocol repair can proceed.
  • Improve patch quality - Add capability or command negotiation for agent-aware node requests.
  • Improve patch quality - Cover an upgraded Gateway talking to an older paired-node handler.

Findings

  • [P1] Version the agent-aware node command — extensions/codex/src/session-catalog-node-continue.ts:115
Agent review details

Security

None.

PR surface

Source +44, Tests +117. Total +161 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 66 22 +44
Tests 2 133 16 +117
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 199 38 +161

Review metrics

Metric Value Why it matters
Production versus test LOC production +66/-22 (net +44); tests +133/-16 (net +117) The positive production delta implements request-bound ownership, but the remaining protocol compatibility gap must be resolved before that growth is justified.

Stored data model

Persistent data-model change detected: serialized state: extensions/codex/src/session-catalog-node-continue.ts, serialized state: extensions/codex/src/session-catalog-terminal.ts, serialized state: extensions/codex/src/session-catalog.test.ts, serialized state: extensions/codex/src/session-catalog.ts, unknown-data-model-change: extensions/codex/src/session-catalog-node-continue.ts, unknown-data-model-change: extensions/codex/src/session-catalog-terminal.ts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Negotiate an agent-aware node command (recommended)
    Version or capability-gate the node command and add a mixed-version regression so existing paired nodes are not sent an unsupported field.
  2. Pause for an upgrade-policy decision
    If all paired nodes must upgrade together, document and enforce that boundary before changing the v1 request payload.

Technical review

Best possible solution:

Keep request-bound catalog control, but introduce an agent-aware paired-node command/capability and route explicit-owner requests only to compatible nodes; add a mixed-version Gateway/node regression before merge.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: register the plugin with explicit multi-agent ownership to exercise the current eager binding, then run an upgraded Gateway against a node advertising only the old v1 command to observe the unsupported agentId request.

Is this the best way to solve the issue?

No: deferring ownership is the right boundary, but reusing a strict v1 node payload is not safe until the Gateway can negotiate an agent-aware command or clearly reject incompatible nodes.

Full review comments:

  • [P1] Version the agent-aware node command — extensions/codex/src/session-catalog-node-continue.ts:115
    This new field is sent to paired nodes that may still advertise the unchanged v1 command. Those old handlers reject unknown keys, while node discovery checks only the command name, so a Gateway-first upgrade makes catalog actions fail until every node upgrades. Advertise a new capability or command and route only compatible nodes; add a mixed-version regression.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against cc9883a3d33b.

Labels

Label justifications:

  • P1: A rolling upgrade can make existing paired-node Codex catalog workflows fail for explicit multi-agent operators.
  • merge-risk: 🚨 compatibility: The PR changes the payload of already-advertised v1 node commands without a compatibility discriminator.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; the reported A/B output supports the regression context but does not resolve the node-version finding.

Evidence

What I checked:

  • Current registration failure path: Current main selects a session agent and binds the node catalog control during plugin registration, before a catalog request has supplied an owner. (extensions/codex/index.ts:132, cc9883a3d33b)
  • Old node handlers reject the new field: The current v1 catalog parser rejects every key outside its fixed allowlist, including agentId. (extensions/codex/src/session-catalog-parsing.ts:204, cc9883a3d33b)
  • PR sends agentId over unchanged command: The branch adds agentId to a paired-node invocation without changing the command name or advertising a separate capability. (extensions/codex/src/session-catalog-node-continue.ts:115, d1c02043abbf)
  • No compatibility selection exists: Current node discovery selects paired nodes by the existing v1 command name alone, with no version or agent-aware capability check. (extensions/codex/src/session-catalog.ts:635, cc9883a3d33b)
  • Relevant history: Current main history places the merged session-catalog ownership change immediately before later main fixes; the PR context identifies that merge as the origin of the eager registration binding. (extensions/codex/index.ts:132, 632581477f04)
  • Codex dependency inspection limitation: The PR explicitly relies on Codex App Server storage behavior, but the required sibling Codex checkout is absent and network name resolution prevented direct upstream-source inspection; this review makes no independent claim about that upstream runtime contract.

Likely related people:

  • IWhatsskill: The merged session-catalog ownership change is the documented origin of the registration-time binding now being repaired. (role: feature introducer; confidence: medium; commits: 632581477f04; files: extensions/codex/index.ts, extensions/codex/src/session-catalog.ts)
  • steipete: Repository context identifies this person as merger of the preceding ownership change and author of the focused follow-up. (role: merger and follow-up owner; confidence: medium; commits: 632581477f04, d1c02043abbf; files: extensions/codex/index.ts, extensions/codex/src/session-catalog-node-continue.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-15T12:53:24.102Z sha 1d32ba87198ac03c10aed6685c8e92deeca1dfd4 :: found issues before merge. :: [P1] Version the agent-aware node command

@steipete
steipete force-pushed the codex/codex-session-catalog-owner-routing branch from 1d32ba8 to d1c0204 Compare August 15, 2026 12:55
@steipete
steipete merged commit da11168 into main Aug 15, 2026
99 checks passed
@steipete
steipete deleted the codex/codex-session-catalog-owner-routing branch August 15, 2026 13:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

extensions: codex maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant