Repository navigation
refactor(anthropic): split session catalog into concept modules - #124342
Conversation
Follow the #124178 sibling seam pattern while preserving behavior. Remove the max-lines suppression and baseline entry after the split.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 15, 2026, 10:02 PM ET / August 16, 2026, 02:02 UTC. ClawSweeper reviewWhat this changesThe PR splits Anthropic’s local Claude session catalog into scan, discovery, parsing, listing, and continuation modules while preserving its facade. Merge readinessKeep open: the refactor remains necessary, but the extracted modules introduce a static import cycle that blocks the required architecture check. Priority: P3 Review scores
Verification
How this fits togetherThe Anthropic plugin discovers local Claude sessions and exposes catalog listing, transcript reading, and session continuation through OpenClaw’s shared session-catalog API. Gateway requests enter via the registered provider and are delegated by the facade to these modules. flowchart LR
A[Claude session files] --> B[Discovery and scan]
C[Gateway catalog request] --> D[Anthropic catalog facade]
D --> E[Listing and transcript read]
E --> F[Session catalog response]
D --> G[Session continuation]
G --> H[OpenClaw session]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +113, Other -1. Total +112 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Move CatalogRecord into the existing leaf types module, import it from scan and discovery, and rerun the architecture guard. Do we have a high-confidence way to reproduce the issue? Yes. The architecture guard statically collects every import, and the scan/discovery pair forms a deterministic cycle from the proposed source. Is this the best way to solve the issue? No. The concept split is appropriate, but the shared record type must be a leaf contract rather than creating a scan/discovery dependency cycle. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2585edba2efd. 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
|
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.
|
ClawSweeper rank-up move handling for exact head
No behavior-changing edits were made after that reviewed head. |
|
Land-ready verification for exact head
Known proof gap: no live behavior proof was run; this is a behavior-neutral module extraction with unchanged importers, so focused regression suites plus exact-head CI are the appropriate proof surface. |
|
Merged via squash.
|
…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.
What Problem This Solves
The Anthropic session catalog remained a 2,075-line grandfathered max-lines file, which made its distinct responsibilities harder to review and kept the last suppression in this neighborhood outside the repository's current file-size standard.
Why This Change Was Made
This splits the catalog along the same concept-module seam pattern established for the Codex sibling in #124178: filesystem scan and bounded caches, CLI/Desktop discovery, parameter and cursor parsing, catalog/transcript listing, and adoption continuation.
session-catalog.tsremains a 210-line runtime assembly and grep-stable export facade, while the continuation path stays separate from adoption because folding it there would create an import cycle through the runtime.The change is behavior-neutral and leaves all existing importers untouched. It also removes the trailing max-lines suppression and its baseline entry, lowering the ratchet to 912.
User Impact
There is no user-visible behavior change. Maintainers get smaller concept-owned modules without importer churn, while the existing session catalog exports and adoption-continuation semantics remain intact.
Evidence
exportkeywords; all 92 top-level declarations are token-identical.createSessionCatalogAdoptionCoordinatorinstance, memo key${agentId}\0${sourceKey}, and narrowedloadedHistorylocal with its explanatory comment.session-catalog.test.ts,session-catalog-node-commands.ts, and the lazy-import boundary insession-catalog-registration.ts.node scripts/run-vitest.mjsoverextensions/anthropic/{session-catalog,lazy-import,session-catalog-history,index,openclaw.plugin}.test.ts: 5 files, 118 tests passed.CI=1 node scripts/check-changed.mjs: clean; max-lines ratchet 912, import cycles 0, oxfmt clean.8cbb88d489758844ccae2db6e296e27deca93df5moved the record-shaped caches into discovery, removing the scan-to-discovery type edge while keeping cache ownership with record discovery.AI-assisted change. No agent transcript included.