Repository navigation
refactor(session-catalog): split codex catalog modules and unify adoption coordination - #124178
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
The coordinator migration hoisted history to an optional outer binding; afterCreate needs the definite array from the create scope. Also drop the retired session-catalog max-lines ratchet entry.
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 9:34 AM ET / 13:34 UTC. ClawSweeper reviewWhat this changesThe PR splits Codex session-catalog responsibilities into focused modules and consolidates Anthropic and paired-node continuation deduplication on the shared adoption coordinator. Merge readinessNo blocking patch defect found: the exact head preserves paired-node agent identity through list, read, and continue paths, addressing the prior P1 finding. Keep this maintainer-owned PR open until exact-head checks complete; likely related people are steipete and IWhatsskill. Priority: P1 Review scores
Verification
How this fits togetherThe session catalog serves UI and CLI requests to list, read, continue, and archive provider sessions. It propagates an agent owner and source identity through provider code to local Codex app-server or paired-node session stores. flowchart LR
A[UI and CLI catalog request] --> B[Agent and source resolution]
B --> C[Codex catalog provider]
C --> D[Local or paired-node catalog]
D --> E[Adoption coordination]
E --> F[Session binding and transcript state]
F --> G[Catalog or continuation result]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +2, Other -1. Total +1 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Complete exact-head validation while retaining the agent-qualified paired-node RPCs and source-qualified exclusive adoption locks. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-neutral refactor rather than a standalone bug report; existing tests exercise the moved multi-agent ownership path. Is this the best way to solve the issue? Yes, provisionally: shared coordination removes duplicated memoization while the specialized local Codex path keeps its pinned exclusive revalidation; upstream Codex-source confirmation remains unavailable. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 987c73e79304. LabelsLabel changes:
Label justifications:
EvidenceWhat 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 (1 earlier review cycle)
|
1b85123 to
0b9244a
Compare
|
ClawSweeper rank-up move disposition for exact head
No actionable ClawSweeper finding remains. |
|
Merged via squash.
|
) * refactor(anthropic): split session-catalog into concept modules Follow the #124178 sibling seam pattern while preserving behavior. Remove the max-lines suppression and baseline entry after the split. * refactor(anthropic): own record caches in session-catalog-discovery The record-shaped caches (catalogDiscoveryCache, claudeSessionScanCache, their entry types, bounds, and TTLs) are consumed only by discovery; moving them out of scan removes the scan->discovery type-import edge flagged by the madge topology gate and leaves scan as record-agnostic fs primitives.
…tion coordination (openclaw#124178) * refactor(session-catalog): unify adoption coordination * refactor(codex): split session catalog modules * fix(anthropic): narrow adopted history for import The coordinator migration hoisted history to an optional outer binding; afterCreate needs the definite array from the create scope. Also drop the retired session-catalog max-lines ratchet entry.
…claw#124342) * refactor(anthropic): split session-catalog into concept modules Follow the openclaw#124178 sibling seam pattern while preserving behavior. Remove the max-lines suppression and baseline entry after the split. * refactor(anthropic): own record caches in session-catalog-discovery The record-shaped caches (catalogDiscoveryCache, claudeSessionScanCache, their entry types, bounds, and TTLs) are consumed only by discovery; moving them out of scan removes the scan->discovery type-import edge flagged by the madge topology gate and leaves scan as record-agnostic fs primitives.
) * test(codex): split the session-catalog suite along module seams Replace the 4.8k-line grandfathered session-catalog.test.ts with seven seam-anchored suites plus shared fixtures, and remove its max-lines suppression and baseline entry. The broad openclaw/plugin-sdk/node-host vi.mock becomes a narrow session-catalog-pty.runtime.ts boundary so the non-isolated extension-codex worker no longer re-instantiates the plugin-sdk graph once per split file (the crash PR #124178 measured). Test bodies are verbatim; AST parity across the split checked out 96/96 identical. AI-assisted (Codex worker under maintainer review). * test(codex): carry caller origin in the cron-authority capability fixture PR #118579 widened the in-process CronCreatorAuthorityCapability run scope with a contractually required callerOrigin, and the new transcript tool wiring reads it during turn startup. The hand-built fixture in run-attempt.configured-mcp.test.ts predated the field, so bindActiveOperatorTurnAuthority threw and runCodexAppServerAttempt rejected while five tests awaited turn/start - 120s timeouts, then a worker teardown crash. #118579's CI never ran the extension-codex lane (cross-lane classification gap), so main's codex lane was latently red. Bisected to 8668aeb; fixture now mints the local-operator origin the helper's name promises. AI-assisted (maintainer-diagnosed, Codex-era fixture repair). * test(codex): keep catalog fixture internals private
…claw#124397) * test(codex): split the session-catalog suite along module seams Replace the 4.8k-line grandfathered session-catalog.test.ts with seven seam-anchored suites plus shared fixtures, and remove its max-lines suppression and baseline entry. The broad openclaw/plugin-sdk/node-host vi.mock becomes a narrow session-catalog-pty.runtime.ts boundary so the non-isolated extension-codex worker no longer re-instantiates the plugin-sdk graph once per split file (the crash PR openclaw#124178 measured). Test bodies are verbatim; AST parity across the split checked out 96/96 identical. AI-assisted (Codex worker under maintainer review). * test(codex): carry caller origin in the cron-authority capability fixture PR openclaw#118579 widened the in-process CronCreatorAuthorityCapability run scope with a contractually required callerOrigin, and the new transcript tool wiring reads it during turn startup. The hand-built fixture in run-attempt.configured-mcp.test.ts predated the field, so bindActiveOperatorTurnAuthority threw and runCodexAppServerAttempt rejected while five tests awaited turn/start - 120s timeouts, then a worker teardown crash. openclaw#118579's CI never ran the extension-codex lane (cross-lane classification gap), so main's codex lane was latently red. Bisected to ffb2614; fixture now mints the local-operator origin the helper's name promises. AI-assisted (maintainer-diagnosed, Codex-era fixture repair). * test(codex): keep catalog fixture internals private
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
PR #123899 left three hand-rolled session-catalog continue-memo patterns and a grandfathered 1,775-line Codex session-catalog module. That duplication obscured the race and ownership invariants and made the Codex catalog harder to navigate and maintain.
Why This Change Was Made
This behavior-neutral cleanup moves the simple Anthropic and paired-node Codex continuation paths onto the existing race-safe Plugin SDK adoption coordinator, while retaining the specialized Codex-local path because it must revalidate and unarchive the bound generation and refresh its canonical-thread baseline inside one pinned exclusive operation. It also splits the Codex production catalog into concept-owned control/cache, listing/read, adoption, archive, and provider-registration modules, each below the line cap, without adding public Plugin SDK surface.
User Impact
None. This is a behavior-neutral internal refactor: catalog listing, reading, continuation, archive, upstream baselines, agent-qualified memoization, and source-qualified exclusivity retain their existing behavior.
Evidence
node scripts/run-vitest.mjs extensions/codex/src extensions/anthropic/session-catalog.test.ts extensions/acpx/src/pi-session-catalog.test.ts extensions/opencode/session-catalog.test.ts src/plugins/session-catalog.test.ts src/gateway/server-methods/session-catalog.test.ts: passed with default workers; the Codex directory covered 153 files and 3,586 tests, and all six routed shards passed.CI=1 node scripts/check-changed.mjs: passed all selected core, core-test, extension, extension-test, and tooling lanes locally. The normal remote raw-sync path is unavailable for this linked worktree because the remote box lacksorigin/main.pnpm plugin-sdk:surface:check: passed at the existing surface budget.session-catalog.tsmax-lines suppression and its ratchet entry are retired.origin/mainpassed the same full proof with 3,586 Codex tests in 233 seconds; the split branch worker-exited under both default workers andOPENCLAW_VITEST_MAX_WORKERS=1. Restoring the original test file made the production-only branch pass with default workers.Follow-ups
Splitting
extensions/codex/src/session-catalog.test.ts(4.7k lines, grandfathered max-lines suppression) is blocked on mock-topology restructuring: per-filevi.mockduplication crashes non-isolated Vitest workers even serially. The fix path is narrowing the broad mock barrels to injection plus*.runtime.tsmocks perdocs/reference/test.mdguidance before re-attempting the split.extensions/anthropic/session-catalog.ts(2,083 lines) is the next production split candidate.