Repository navigation
Conversation
3afd9f4 to
c716984
Compare
|
Codex review: found issues before merge. Reviewed August 2, 2026, 5:06 AM ET / 09:06 UTC. ClawSweeper reviewWhat this changesThe PR binds MCP attach bearer grants to canonical session keys and revokes matching grants after committed session deletion or agent deletion. Merge readinessKeep this PR open for a current-main rebase and owner review. The session-side defect remains on the stated current main, and the PR has credible exact-head Gateway/MCP behavior proof, but its agent-deletion hook targets an older handler shape that current main has replaced; the revocation must be relocated into the current deletion lifecycle before this security-boundary change can merge. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway issues short-lived attach bearer tokens that authorize MCP loopback requests for a session. Session and agent lifecycle code later deletes those scopes, so the grant store must invalidate the matching in-memory credential after the authoritative deletion commit. flowchart LR
A[Attach client] --> B[Gateway attach grant]
B --> C[Canonical session lookup]
C --> D[In-memory bearer grant]
E[Session or agent deletion] --> F[Committed lifecycle mutation]
F --> G[Grant revocation]
D --> H[MCP authorization]
G --> H
Before merge
Findings
Agent review detailsSecurityNeeds attention: The patch narrows an MCP bearer credential lifetime, but its stale agent-delete integration must be repaired and the required direct Codex-source contract check remains unavailable in this read-only checkout. PR surfaceSource +37, Tests +268. Total +305 across 10 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Rebase the session-event revocation onto current main, place agent-scoped revocation immediately after the current authoritative agent deletion commit, then repeat focused lifecycle coverage and exact-head Gateway/MCP authorization proof before owner approval. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the current-main path: attach grants remain in the in-memory store until TTL expiry or explicit revoke, while committed session deletion only emits an observer event that no current grant-store listener consumes. The PR body also records an exact-head live Gateway/MCP authorization run, although the linked artifact could not be fetched from this restricted environment. Is this the best way to solve the issue? No, not as the branch currently stands. Centralizing session revocation on the committed identity-deletion event is the right owner boundary, but the agent revocation must be relocated into current main’s journaled deletion lifecycle rather than the obsolete handler placement. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a154b4faea41. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (14 earlier review cycles; latest 8 shown)
|
c716984 to
cb0c282
Compare
|
Exact-head live MCP proof is now in the PR body for The production-path run built and started the real Gateway, created two persisted sessions, minted two real attach grants, and exercised MCP loopback bearer authorization: The same exact head also passed the focused suite: 10 files / 216 tests, plus a full build on macOS arm64 with Node v22.22.0. Synthetic tokens and temporary MCP config paths were deleted; only redacted outcomes were retained. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Follow-up evidence hardening: I published the exact executable harness and its complete sanitized command transcript: https://gist.github.com/arcabotai/22ed734eea1bbce29f5977aff184e341 The transcript includes distinct persisted session keys, non-secret bearer fingerprint prefixes, exact RPC ordering, response bodies, and the same target fingerprint before/after deletion. This makes the live proof independently inspectable rather than relying only on the summarized outcomes in the PR body. |
cb0c282 to
235dc97
Compare
6430795 to
1884daf
Compare
|
Follow-up hardening on exact head |
1884daf to
78667c1
Compare
78667c1 to
fb137a7
Compare
|
Exact-head live proof is now refreshed for |
|
@clawsweeper re-review The requested exact-final-head proof now exists for |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
Closing due to inactivity. |
Summary
What Problem This Solves
attach.grantpreviously stored the caller-provided session key verbatim. Session deletion resolves aliases to a canonical key, but no production deletion path revoked attach grants. As a result:Codex treats the configured environment bearer as a persistent MCP credential, so lifecycle revocation belongs on the OpenClaw server boundary.
Ownership and ordering
deletemutations revoke grants, synchronously after the session transaction commits. Every deleted canonical/alias key in the mutation is covered, so RPC deletion, cron cleanup, and plugin/harness rollback share one owner boundary.reset, which the listener deliberately ignores.--print-configbehavior is unchanged; normal spawned attach clients still explicitly revoke on exit/error.Evidence
Exact-head live gateway/MCP proof and CI
Reproducible portable harness and complete sanitized command transcript: public proof artifact
The live artifact runs the unmodified production source through the repository's
pnpm openclawlauncher on the exact current head. Current-head CI independently passed the production build, type, lint, boundary, security, and relevant test shards; its sole remaining failure is an unrelated current-base dead-export allowlist mismatch in untouched Control UI files.The artifact records distinct persisted session keys plus non-secret SHA-256 prefixes for the target and unrelated bearers. The same target fingerprint appears before and after
sessions.delete, while the unrelated fingerprint remains authorized.Production paths exercised:
sessions.patchattach --print-config→attach.grantpathDELETE /mcpsessions.delete401 unauthorized200 {"ok":true}The proof used synthetic credentials only. Token values and temporary MCP config paths were deleted before sandbox teardown; the retained transcript contains outcomes only.
Focused regression suite
Post-format verification:
Regression coverage exercises the real
attach.grantalias flow, canonical response and storage, raw legacy alias-only rows, direct deletion-event filtering, RPC session deletion, real persisted cron continuation cleanup, ordinary and plugin-owned initialization rollback, unrelated-grant preservation, reset preservation, and agent-scoped revocation.Codex contract checked
codex-rs/codex-mcp/src/connection_manager.rs: MCP client startup and environment bearer configurationcodex-rs/rmcp-client/src/auth_status.rs:bearer_token_env_varauthentication and streamable HTTP bearer behaviorNo config/default surface changes. No database migration.