Repository navigation
fix(session-catalog): preserve explicit agent ownership across UI and CLI - #123899
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 15, 2026, 6:35 AM ET / 10:35 UTC. ClawSweeper reviewWhat this changesThe PR propagates an explicit agent owner and opaque Codex-home identity through session-catalog UI, Gateway, CLI, provider, terminal, and supervised-fork operations. Merge readiness⛔ Blocked until stronger real behavior proof is added - 9 items remain Keep open: two remaining P1 defects can cross explicit agent ownership during concurrent Pi or OpenCode session adoption. The PR is not on current main or released. Priority: P1 Review scores
Verification
How this fits togetherSession catalog requests originate in the Control UI or CLI, pass through Gateway authorization to a provider, then operate on an external session store. The selected agent and Codex home must remain attached through reads, continuation, archival, terminal launch, and later forks. flowchart LR
A[Control UI or CLI] --> B[Gateway catalog request]
B --> C[Agent owner resolution]
C --> D[Catalog provider]
D --> E[Selected local session store]
E --> F[Read, continue, archive, or terminal action]
F --> G[Agent-owned session result]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +899, Tests +1204, Docs +6, Other +28. Total +2137 across 67 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Namespace Pi and OpenCode adoption single-flight keys by agent, add two-agent concurrency regressions, and attach redacted real Control UI proof before merging. Do we have a high-confidence way to reproduce the issue? Yes, from source: concurrently continue the same Pi or OpenCode host/thread as alpha and beta; the second call reuses the first unqualified coordinator promise before reaching its own agent-scoped lookup. Is this the best way to solve the issue? No: owner propagation is otherwise coherent, but Pi and OpenCode must namespace their adoption coordinator by agent as Anthropic already does. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7e0941270d0d. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
Maintainer review (deep pass, including direct Findings that block merge as-is:
Smaller items: Since this branch allows maintainer edits, we are pushing fixes for the items above directly to it (test-file split, config-keyed snapshot, per-home facade refactor + LOC reduction), preserving your authorship on the base work. The additive public-contract scope ( Thanks @IWhatsskill — the direction and the sibling/UI coverage here are genuinely good work. |
Co-authored-by: IWhatsskill <[email protected]>
Co-authored-by: IWhatsskill <[email protected]>
Co-authored-by: IWhatsskill <[email protected]>
Co-authored-by: IWhatsskill <[email protected]>
4684fa1 to
e8925ce
Compare
|
Merged via squash.
|
… CLI (openclaw#123899) * fix(session-catalog): preserve explicit agent ownership across UI and CLI * fix(session-catalog): repair owner routing regressions * Fix-session-catalog-CI-checks * test(ui): split chat catalog pane coverage Co-authored-by: IWhatsskill <[email protected]> * refactor(session-catalog): bind Codex homes per request Co-authored-by: IWhatsskill <[email protected]> * refactor(session-catalog): centralize owner resolution Co-authored-by: IWhatsskill <[email protected]> * fix(codex): resolve session fork against the adopted home Co-authored-by: IWhatsskill <[email protected]> * refactor(ui): extract chat session discussion * test(sessions): stabilize archive worker responsiveness check --------- Co-authored-by: IWhatsskill <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
[AI-assisted]
What Problem This Solves
Session-catalog requests could lose their explicit OpenClaw agent owner between the route, provider, adoption, terminal handoff, and Codex App Server connection. The catalog also exposed only one Codex home, so sessions stored in a process CODEX_HOME or another configured agent codex-home could disappear from the Control UI.
Failure mode
In multi-agent installations, List, Read, Continue, Archive, adoption, and terminal actions could resolve different agent directories. Independently, a single App Server connection could only enumerate the thread store for one CODEX_HOME.
Why This Change Was Made
The Gateway now resolves one concrete owner for every catalog request and forwards it through providers and UI actions. The Codex provider discovers each existing local Codex home, gives it an opaque source identity, and routes later actions and supervised bindings back to the same home while retaining the route owner's agent directory.
Root Cause
Owner resolution was repeated at multiple layers and sometimes fell back to the default agent. The Codex catalog control also assumed one process-wide connection even though each App Server process reads exactly one Codex home.
Runtime ownership
The chat route or sidebar catalog owns agentId. The opaque home identity owns CODEX_HOME selection, pagination, reads, continuation, archive, terminal resume, and later supervised turns. One shared App Server connection remains scoped to each physical home.
User Impact
Users can see sessions from their process Codex home and configured agent Codex homes together, then read, continue, archive, adopt, or open the selected session without crossing agent or home boundaries. The Codex CLI also accepts --agent for list, continue, and archive, plus --host for actions on secondary local homes.
Evidence
Revalidated at exact head
21f7c721949ca0a1a29d96c7a6e314c74dbfe4a5: the focused ownership regression suite and a fresh real two-home App Server run passed after the CI repair. The runtime kept alpha and beta owners separate, retained stable source identity, isolated the two stores, rejected a wrong-home read, and reused one connection per physical home.Inspect exact-head proof ledger
Provenance
054354e099c4952af5152c974253b99af5cfb6760ffc5b730a96fd00c27c61fa69fd6de4aa11c043Direct behavior
Codex multi-home runtime command
Redacted exact-head terminal output
{"schema":"session-catalog-multihome-direct-proof-v1","head":"0ffc5b730a96fd00c27c61fa69fd6de4aa11c043","owners":{"alpha":true,"beta":true,"separated":true},"homes":{"discoveredForAlpha":2,"discoveredForBeta":2,"sharedSourceIdentity":true,"isolatedThreads":true,"secondHomeConnected":true},"appServers":{"oneConnectionPerHome":true,"sharedAcrossOwnersForSameHome":true},"list":true,"read":true}Automated verification
Session catalog ownership regressions
pnpm exec vitest run extensions/codex/src/session-catalog.test.ts extensions/codex/src/session-cli.test.ts src/plugins/session-catalog.test.ts src/gateway/server-methods/session-catalog.test.ts src/gateway/server-methods/session-catalog-visibility.test.ts ui/src/lib/sessions/catalog-key.test.ts ui/src/pages/chat/chat-pane.test.ts ui/src/pages/chat/chat-pane-history.test.ts ui/src/components/app-sidebar.test.ts ui/src/components/terminal/terminal-panel.test.tspnpm exec vitest run extensions/codex/src/session-catalog.test.ts extensions/codex/src/session-cli.test.ts src/plugins/session-catalog.test.ts src/gateway/server-methods/session-catalog.test.ts src/gateway/server-methods/session-catalog-visibility.test.ts ui/src/lib/sessions/catalog-key.test.ts ui/src/pages/chat/chat-pane.test.ts ui/src/pages/chat/chat-pane-history.test.ts ui/src/components/app-sidebar.test.ts ui/src/components/terminal/terminal-panel.test.ts— [TEST] 460/460 tests passed across 8 executed test files. Proves owner propagation, fail-closed multi-agent behavior, pagination, stale guards, home-qualified adoption identity, agent-qualified concurrent Continue operations, terminal handoff, CLI forwarding, and multi-home provider routing. Preserves legacy compatible-owner discovery and single-agent callers without --agent.Browser session-catalog E2E
node --import tsx scripts/ensure-playwright-chromium.mts && node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/codex-sessions.e2e.test.tsnode --import tsx scripts/ensure-playwright-chromium.mts && node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/codex-sessions.e2e.test.ts— [TEST] 7/7 browser E2E scenarios passed. Proves catalog grouping and pagination, progressive host results, failure presentation, and browser adoption with explicitagentId: "main"across List, Read, and Continue.Preserved boundaries
Proof gap
No known proof gaps remain: the targeted browser E2E, focused regressions, type checks, and real two-home runtime proof all passed on the exact PR head.
Artifacts
Current-head proof refresh
Validated on exact pushed head
21f7c721949ca0a1a29d96c7a6e314c74dbfe4a5.Real two-home App Server behavior
The production home snapshot and shared App Server clients discovered two real stores for both route owners. The same physical process home retained one opaque source identity and one shared connection across owners; reads stayed in the selected store, and a cross-home read was rejected.
{"schema":"session-catalog-multihome-direct-proof-v1","head":"21f7c721949ca0a1a29d96c7a6e314c74dbfe4a5","owners":{"alpha":true,"beta":true,"separated":true},"homes":{"discoveredForAlpha":2,"discoveredForBeta":2,"sharedSourceIdentity":true,"isolatedThreads":true,"secondHomeConnected":true},"appServers":{"oneConnectionPerHome":true,"sharedAcrossOwnersForSameHome":true},"list":true,"read":true}Focused regression proof
pnpm exec vitest run extensions/codex/src/session-catalog.test.ts extensions/codex/src/session-cli.test.ts src/plugins/session-catalog.test.ts src/gateway/server-methods/session-catalog.test.ts src/gateway/server-methods/session-catalog-visibility.test.ts ui/src/lib/sessions/catalog-key.test.ts ui/src/pages/chat/chat-pane.test.ts ui/src/pages/chat/chat-pane-history.test.ts ui/src/components/app-sidebar.test.ts ui/src/components/terminal/terminal-panel.test.tsAll selected regression files completed successfully. Current-head formatting, changed-file lint, and
pnpm check:test-typesalso passed.This evidence proves the current broad multi-home behavior; the separate maintainer scope decision requested by ClawSweeper remains unchanged.