Repository navigation
test(codex): split the session-catalog suite along module seams - #124397
Conversation
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).
…ture 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).
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 12:09 AM ET / 04:09 UTC. ClawSweeper reviewWhat this changesThe branch replaces one large Codex session-catalog test file with seven focused suites and shared fixtures, adds a narrow PTY mock seam, and supplies the required caller origin in an app-server test fixture. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer review. The protected Priority: P3 Review scores
Verification
How this fits togetherThe Codex plugin catalogs, reads, resumes, and archives local or paired-node Codex sessions through app-server and terminal helpers. The changed tests exercise those session-management paths while the production terminal helper resolves and runs the local Codex executable. flowchart LR
A[Session catalog tests] --> B[Shared catalog fixtures]
B --> C[Narrow PTY mock seam]
C --> D[Catalog terminal helper]
D --> E[Local Codex executable]
F[Configured MCP test fixture] --> G[Authority capability]
G --> H[App-server tool setup]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +573, Tests +235, Other -1. Total +807 across 13 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the minimal PTY re-export seam and caller-origin fixture repair, then merge after exact-head Codex validation confirms the split remains behavior-neutral. Do we have a high-confidence way to reproduce the issue? Yes, from source: the old fixture creates an active authority object without callerOrigin, and current main dereferences callerOrigin.kind during tool setup. The branch supplies the missing local origin; no local test was run because this is a read-only review. Is this the best way to solve the issue? Yes. The two-function local re-export narrows only the broad mocked dependency while preserving the terminal helper's existing behavior, and the fixture now matches the authority owner’s current contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against acbbff19bad0. 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
|
|
Land-ready verification for head
Known proof gap: the pre-existing unsharded extension-codex one-shot teardown crash remains a separate follow-up. The documented split/unsplit clean-box A/B passed every test before the identical teardown failure; exact-head sharded Codex CI is green. No gate was bypassed. |
|
Merged via squash.
|
…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
What Problem This Solves
Two things, discovered in sequence:
extensions/codex/src/session-catalog.test.tswas 4,818 lines with a grandfatheredoxlint max-linessuppression and aconfig/max-lines-baseline.txtratchet entry. PR refactor(session-catalog): split codex catalog modules and unify adoption coordination #124178 measured why a naive split is impossible: copying its fivevi.mockblocks into N files worker-crashes the non-isolated extension-codex lane (the lane runsfileParallelism: false— one worker accumulates every file's mocked module graphs, andvi.mock("openclaw/plugin-sdk/node-host")forks a large slice of the plugin-sdk graph per file).app-server/run-attempt.configured-mcp.test.tsdeterministically time out (120s each), reproduced standalone on macOS (Node 24.19/26.7), on a clean AWS Crabbox Linux box (cbx_59673c86ba92, runrun_31cae5037a94), and on an unmodified origin/main clone. Bisect pinned the first bad commit to fix(discord): bind transcript capture to source account [AI] #118579 (fix(discord): bind transcript capture to source account), which widened the in-processCronCreatorAuthorityCapabilitycontract with a requiredcallerOriginand added transcript tool wiring that reads it. The codex test's hand-built capability fixture (as never) lacked the field, sobindActiveOperatorTurnAuthoritythrewTypeError: Cannot read properties of undefined (reading 'kind'), rejectingrunCodexAppServerAttemptwhile the tests awaitedturn/start— presenting as timeouts, then a worker teardown crash. fix(discord): bind transcript capture to source account [AI] #118579's CI never ran the extension-codex lane (Discord/gateway diffs don't classify into it), so the break landed green — the exact cross-lane trap root AGENTS.md warns about.Why This Change Was Made
Mock narrowing first, split second, plus the red-main repair:
session-catalog-pty.runtime.tsnarrow boundary re-exports exactly the two node-host functionssession-catalog-terminal.tsconsumes (resolveNodeHostExecutable,runNodePtyCommand). Tests mock this 3-line leaf instead of the plugin-sdk barrel, so the sdk graph stays shared across files. The four remaining mocks (command-rpc,app-server/{request,shared-client,transcript-mirror}) were already narrow local factory mocks, replicated per file.session-catalog.test-helpers.ts(same pattern asapp-server/session-binding.test-helpers.ts), identifier-stable so test bodies move verbatim.listing,listing-cache,node-listing,adoption,adoption-recovery,archive,node-continue), each well under the 1000-counted-line test cap. Suppression and baseline entry removed (ratchet shrinks to 910).callerOrigin: { kind: "local" }, matching the gateway-minted run-scope contract fix(discord): bind transcript capture to source account [AI] #118579 established. This un-reds the lane; prod behavior was never wrong (the capability is in-process and always minted with the field at runtime).User Impact
None at runtime — production delta is +3 lines (the re-export boundary) plus an import rewire in
session-catalog-terminal.ts. Maintainability: the codex session-catalog suite is navigable, the max-lines ratchet moves forward, and the codex lane is green again for every future PR that runs it.Evidence
itarguments — 96/96 tests identical between the old mega-file and the split;session-catalog-create.test.tsbyte-identical.extensions/codexone-shot on clean AWS Linux boxes (c7a.8xlarge), post-fix: every reported test passes end-to-end in ~245s on BOTH sides of the A/B — split tree (cbx_e4c804319801) and unmodified origin/main + fixture fix (cbx_d0045e753f72) — and both then die identically in end-of-run worker teardown. That teardown crash is a pre-existing main condition of the unsharded serial lane (fileParallelism: false, one worker accumulates all module graphs), invisible on CI's sharded config; the split is A/B-proven outcome-neutral. Follow-up filed to chunk the extension-codex lane likeresolveBoundedVitestInvocationsalready does for gateway-server.run-attempt.configured-mcp.test.ts14/14 post-fix; pre-fix 5 failed / 9 passed (three independent runs + Linux Crabbox).7862a5da159(refactor(session-catalog): split codex catalog modules and unify adoption coordination #124178 merge) → first bad8668aeb9698(fix(discord): bind transcript capture to source account [AI] #118579), converged in 6 steps on the single-test repro.check-max-lines-ratchetOK at 910 entries.Follow-up (separate issue): PR-CI lane classification let #118579 change
src/agentssurfaces thatextensions/codextests import without running the extension-codex lane.