Repository navigation
fix(ui): restore Custodian wizard session recovery coverage - #148444
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 2:32 PM ET / 18:32 UTC (Revision 2). ClawSweeper reviewWhat this changesUpdates Custodian’s session-recovery test to select the visible Twitch button while preserving its existing recovery assertions. Merge readiness✅ Ready for maintainer review The repair remains necessary on current main, and no actionable patch defects were found. The previous draft blocker is resolved; this protected, maintainer-authored PR can proceed through normal merge gates. Priority: P3 Review scores
Verification
How this fits togetherCustodian is OpenClaw’s built-in setup and assistance conversation. Its UI renders Gateway wizard steps, submits typed answers, and starts a fresh session without replaying an answer when the Gateway invalidates the session. flowchart LR
A[Gateway wizard step] --> B[Shared choice buttons]
B --> C[Custodian typed answer]
C --> D[Gateway session response]
D --> E{Session invalidated?}
E -->|Yes| F[Fresh session without replay]
E -->|No| G[Continue conversation]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests 0. Total 0 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep recovery coverage attached to the rendered choice controls while retaining the existing typed-answer and no-replay invariants. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the test failure: current main expects radio inputs while the two-choice renderer produces buttons. The PR reports a failing baseline run; this review did not execute tests. Is this the best way to solve the issue? Yes. Clicking the rendered option is the narrow repair and preserves the substantive recovery checks without adding mocks, weakening assertions, or changing production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5cc4537a456f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Merge inspected main cbb8472, including the verified Custodian test repair from #148444. Preserve the previously published signed integration and Vincent's original inventory correction. The PR delta against main remains one removed duplicate registration. The prior CI attempt reproduced the obsolete radio-input interaction. Retain its failure and the separate hosted SDK report OOM as failed proof; this merge changes no gate, heap, timeout, or runner policy. Validation: the existing planner and Custodian owner/sibling tests pass on the integrated tree; actual planner generation and fresh P2 review pass. Co-authored-by: Vincent Koc <[email protected]>
Keep gateway-lock within the existing line limit by inlining its temporary cmdline string. Remove a duplicate wizard recovery entry introduced by overlapping database-worker routing fixes, preserving its canonical fork ownership. Apply the existing wizard choice-button interaction from #148444 while retaining typed answer, session rotation, and no-replay assertions. Validation: 175 tooling/config, 46 gateway-lock, and 53 UI lifecycle/render/submission cases passed; focused formatting/lint and independent P2 review passed. No schema, policy, deadline, threshold, or expectation changes.
* refactor: speed up repeated schema validation Enable native lazy Zod compilation across core, plugins, workers, and tooling. Preserve existing schemas, parse results, and runtime fallbacks for unsupported schemas and strict-CSP browsers. Warm synthetic validation improves while first-use compilation adds CPU and memory cost. * perf: reuse compiled schemas in repeated validation Cache stable recommendation, dashboard, memory-event, and Workboard schemas so repeated reads do not repeat compilation. Preserve validation and serialized output, and resolve side-effect imports in the relocated updater survival fixture. * test: initialize shared voice mocks sequentially Load the Discord voice runtime before its realtime sibling so their shared async audio mock completes once. Concurrent imports can otherwise return separate export objects and leave WAV writer spies disconnected from the running consumer. Preserve every assertion and timeout. * test: synchronize memory provider shutdown assertions * test: use supported deferred helper for provider lifecycle * test: stabilize browser fixtures and clarify native policy failures * test: repair schema rollout CI integration Keep gateway-lock within the existing line limit by inlining its temporary cmdline string. Remove a duplicate wizard recovery entry introduced by overlapping database-worker routing fixes, preserving its canonical fork ownership. Apply the existing wizard choice-button interaction from #148444 while retaining typed answer, session rotation, and no-replay assertions. Validation: 175 tooling/config, 46 gateway-lock, and 53 UI lifecycle/render/submission cases passed; focused formatting/lint and independent P2 review passed. No schema, policy, deadline, threshold, or expectation changes. * perf: compile only measured nested tool validation Replace process-wide Zod compiler activation with one lazy compiled schema at the nested-tool activity owner. Ordinary transcript rows bypass compilation and the parsed-output contract is unchanged. Keep measured schema reuse for recommendation reads, Workboard event normalization, and memory event storage normalization. Config, transcript-entry, and relay-frame compilation did not justify their caller or first-use costs. Synthetic Node 26.8.2/Zod 4.5.4 measurements: nested reads 0.483 to 0.061 microseconds; 512 mixed rows 28.2 to 6.95 microseconds; approximately 1.42 ms compilation cost and 0.174 ms additional first-read cost. Full session-load results did not establish a compilation win. Schema reuse reduced representative reads from 6.16 to 1.77, 12.02 to 5.30, and 4.51 to 2.95 microseconds without compilation. These are measured boundaries, not aggregate Gateway throughput. Validation: 232 focused tests, including persistence, history projection, Workboard and strict-CSP browser startup; core/extension typechecks, targeted lint, formatting, and independent P2 review. Preserve schema definitions, serialized output, stored formats, permissions, and dependency versions. * test: move Radius auth integration to its boundary Keep the six generic provider-auth URL-routing cases in core. Move the two registered Radius device-flow cases to the existing root plugin integration test surface, which admits the real plugin entrypoint and is checked outside core TypeScript graphs. Preserve device destination, code and expiry, browser suppression, cancellation, awaited settlement, and single-fetch assertions. No production changes or boundary exceptions. Validation: 31 behavior and boundary tests, the complete core TypeScript boundary guard, root test typecheck, scoped lint, formatting, and independent P2 review passed. * test: separate CLI auth fixture setup from account assertions Prepare each isolated real Gateway and Claude CLI fixture in beforeEach under the existing fixture-hook budget. Keep the six ordered account transitions, real restart, and every auth/history assertion inside the unchanged 90-second behavior deadline. Register cleanup before awaiting acquisition, join acquisition and case work, and close the current Gateway after restart. Failed preparation cleans partial resources; the cancellation regression exercises the same preparation owner. CI exposed cold setup consuming the account test's deadline. A restored local phase probe measured 39.74 seconds for initial Gateway startup, 10.92 seconds for the first turn, and 4.21 seconds for the remaining five turns; shutdown was brief. No timeout values, mocks, or assertions are relaxed. Validation: all six cases pass with the explicit CI configuration, including cancellation; gateway test types, lint, formatting, and independent P2 review pass.
* refactor: speed up repeated schema validation Enable native lazy Zod compilation across core, plugins, workers, and tooling. Preserve existing schemas, parse results, and runtime fallbacks for unsupported schemas and strict-CSP browsers. Warm synthetic validation improves while first-use compilation adds CPU and memory cost. * perf: reuse compiled schemas in repeated validation Cache stable recommendation, dashboard, memory-event, and Workboard schemas so repeated reads do not repeat compilation. Preserve validation and serialized output, and resolve side-effect imports in the relocated updater survival fixture. * test: initialize shared voice mocks sequentially Load the Discord voice runtime before its realtime sibling so their shared async audio mock completes once. Concurrent imports can otherwise return separate export objects and leave WAV writer spies disconnected from the running consumer. Preserve every assertion and timeout. * test: synchronize memory provider shutdown assertions * test: use supported deferred helper for provider lifecycle * test: stabilize browser fixtures and clarify native policy failures * test: repair schema rollout CI integration Keep gateway-lock within the existing line limit by inlining its temporary cmdline string. Remove a duplicate wizard recovery entry introduced by overlapping database-worker routing fixes, preserving its canonical fork ownership. Apply the existing wizard choice-button interaction from openclaw#148444 while retaining typed answer, session rotation, and no-replay assertions. Validation: 175 tooling/config, 46 gateway-lock, and 53 UI lifecycle/render/submission cases passed; focused formatting/lint and independent P2 review passed. No schema, policy, deadline, threshold, or expectation changes. * perf: compile only measured nested tool validation Replace process-wide Zod compiler activation with one lazy compiled schema at the nested-tool activity owner. Ordinary transcript rows bypass compilation and the parsed-output contract is unchanged. Keep measured schema reuse for recommendation reads, Workboard event normalization, and memory event storage normalization. Config, transcript-entry, and relay-frame compilation did not justify their caller or first-use costs. Synthetic Node 26.8.2/Zod 4.5.4 measurements: nested reads 0.483 to 0.061 microseconds; 512 mixed rows 28.2 to 6.95 microseconds; approximately 1.42 ms compilation cost and 0.174 ms additional first-read cost. Full session-load results did not establish a compilation win. Schema reuse reduced representative reads from 6.16 to 1.77, 12.02 to 5.30, and 4.51 to 2.95 microseconds without compilation. These are measured boundaries, not aggregate Gateway throughput. Validation: 232 focused tests, including persistence, history projection, Workboard and strict-CSP browser startup; core/extension typechecks, targeted lint, formatting, and independent P2 review. Preserve schema definitions, serialized output, stored formats, permissions, and dependency versions. * test: move Radius auth integration to its boundary Keep the six generic provider-auth URL-routing cases in core. Move the two registered Radius device-flow cases to the existing root plugin integration test surface, which admits the real plugin entrypoint and is checked outside core TypeScript graphs. Preserve device destination, code and expiry, browser suppression, cancellation, awaited settlement, and single-fetch assertions. No production changes or boundary exceptions. Validation: 31 behavior and boundary tests, the complete core TypeScript boundary guard, root test typecheck, scoped lint, formatting, and independent P2 review passed. * test: separate CLI auth fixture setup from account assertions Prepare each isolated real Gateway and Claude CLI fixture in beforeEach under the existing fixture-hook budget. Keep the six ordered account transitions, real restart, and every auth/history assertion inside the unchanged 90-second behavior deadline. Register cleanup before awaiting acquisition, join acquisition and case work, and close the current Gateway after restart. Failed preparation cleans partial resources; the cancellation regression exercises the same preparation owner. CI exposed cold setup consuming the account test's deadline. A restored local phase probe measured 39.74 seconds for initial Gateway startup, 10.92 seconds for the first turn, and 4.21 seconds for the remaining five turns; shutdown was brief. No timeout values, mocks, or assertions are relaxed. Validation: all six cases pass with the explicit CI configuration, including cancellation; gateway test types, lint, formatting, and independent P2 review pass.
Related: #148300
What Problem This Solves
Resolves a problem where the Custodian session-eviction regression test stops before exercising recovery because it waits for radio inputs that the two-choice wizard no longer renders.
Why This Change Was Made
The shared wizard introduced in #148300 submits binary choices directly from their buttons. This test now clicks the visible Twitch button. It retains the existing typed-answer request, session rotation, no-replay, fresh-session reply, and retired-wizard assertions.
User Impact
No production behavior changes. Custodian recovery coverage exercises the interaction users receive today.
Evidence
9c583a3bc193e82c293f48f836ee6980f137a170: the original case fails because it expects two radio inputs and finds zero, before submitting an answer.node scripts/run-vitest.mjs ui/src/pages/custodian/custodian-page.session-lifecycle.test.ts ui/src/pages/custodian/custodian-page.test.ts: 50 tests passed across both files with synthetic Gateway responses after a successful frozen-lockfile install on the published head.git diff --checkpassed. CI planner selects bounded changed-node and boundary jobs.node scripts/check-changed.mjs --base 9c583a3bc193e82c293f48f836ee6980f137a170 -- ui/src/pages/custodian/custodian-page.session-lifecycle.test.ts: passed after the exact frozen-lockfile install, including UI fixture types, i18n, guards, dead-export scans, and lint.