Skip to content

fix(ui): restore Custodian wizard session recovery coverage - #148444

Merged
steipete merged 1 commit into
mainfrom
codex/custodian-session-fixture-20260914
Sep 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/custodian-session-fixture-20260914

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Reproduced on main 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.
  • Fresh independent review through P2: no actionable findings.
  • Formatting and git diff --check passed. 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.
  • The first local changed-check attempt rejected borrowed dependencies. Qualification was repeated successfully with a private dependency installation; no guard was relaxed.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 2:32 PM ET / 18:32 UTC (Revision 2).

ClawSweeper review

What this changes

Updates 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
Reviewed head: 8110927c94d59ff7b3e97b0bf67ffb477e52029c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair preserves meaningful recovery assertions and has reported targeted validation, with no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test repair has no changed production behavior requiring live proof; its mounted-page scenario exercises choice submission and session recovery with synthetic Gateway responses.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored test repair has no changed production behavior requiring live proof; its mounted-page scenario exercises choice submission and session recovery with synthetic Gateway responses.
Evidence reviewed 6 items Introduced change preserves recovery coverage: The pinned merge-base-to-head diff changes only the interaction used by the existing eviction test. Assertions still check the exact typed answer, a different session ID, absence of replayed message and wizardAnswer, the fresh reply, and removal of the old wizard.
Current production interaction: The shared choice renderer submits option.value directly when there are at most two options. Custodian’s transcript renderer delegates to this control and forwards answers to its session store. The shared renderer is unchanged between the reviewed head and fetched main.
Still necessary on main: Inspection of the fetched main revision shows the eviction test still waiting for two radio inputs before attempting recovery. The latest supplied release, v2026.9.4, also contains that old test interaction; this does not establish a released runtime defect.
Findings None None.
Security None None.

How this fits together

Custodian 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests 0. Total 0 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 8 8 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 8 8 0

Review metrics

None.

Technical review

Best 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.

Labels

Label justifications:

  • P3: This repairs an obsolete test interaction without changing runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored test repair has no changed production behavior requiring live proof; its mounted-page scenario exercises choice submission and session recovery with synthetic Gateway responses.

Evidence

What I checked:

  • Introduced change preserves recovery coverage: The pinned merge-base-to-head diff changes only the interaction used by the existing eviction test. Assertions still check the exact typed answer, a different session ID, absence of replayed message and wizardAnswer, the fresh reply, and removal of the old wizard. (ui/src/pages/custodian/custodian-page.session-lifecycle.test.ts:290, 8110927c94d5)
  • Current production interaction: The shared choice renderer submits option.value directly when there are at most two options. Custodian’s transcript renderer delegates to this control and forwards answers to its session store. The shared renderer is unchanged between the reviewed head and fetched main. (ui/src/components/wizard-step-controls.ts:107, 5cc4537a456f)
  • Still necessary on main: Inspection of the fetched main revision shows the eviction test still waiting for two radio inputs before attempting recovery. The latest supplied release, v2026.9.4, also contains that old test interaction; this does not establish a released runtime defect. (ui/src/pages/custodian/custodian-page.session-lifecycle.test.ts:290, 5cc4537a456f)
  • Existing session owner: The session store sends typed wizard answers through its normal request boundary and handles invalidation by minting a session ID and issuing an input-free initialization. The patch exercises this existing owner without changing production authority or persistence. (ui/src/pages/custodian/custodian-session-store.ts:357, 8110927c94d5)
  • Discussion, validation, and review continuity: The supplied complete body reports reproduction on the merge base, 50 passing tests across the lifecycle and page suites, and successful changed checks after a private frozen-lockfile installation. The prior review had no findings and requested leaving draft status; supplied current metadata and the ready-for-review timeline event establish that this was completed. Tests were not executed during this read-only review; git diff --check passed. (8110927c94d5)
  • Related merged work and routing history: The supplied GitHub context verifies fix(ui): complete provider sign-in from the waiting dialog #148300 as merged and describes direct binary-choice submission. Local history records Ayaan Zaidi on shared wizard work and Peter Steinberger on prior wizard/test maintenance. Exact line-introduction inspection could not complete because historical blobs were unavailable, so these are routing suggestions rather than verified introduction attribution. (ui/src/components/wizard-step-controls.ts, ae1205dc0be2)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-14T18:24:01.218Z sha 8110927 :: needs changes before merge. :: none

@steipete
steipete marked this pull request as ready for review September 14, 2026 18:25
@steipete
steipete merged commit cbb8472 into main Sep 14, 2026
132 checks passed
@steipete
steipete deleted the codex/custodian-session-fixture-20260914 branch September 14, 2026 18:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 14, 2026
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]>
steipete added a commit that referenced this pull request Sep 14, 2026
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.
steipete added a commit that referenced this pull request Sep 14, 2026
* 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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant