Skip to content

fix(ui): recover failed new-session navigation without duplicate tasks - #126873

Merged
steipete merged 2 commits into
mainfrom
codex/autoqa-ui-new-session-navigation-failure-20260820
Aug 20, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/autoqa-ui-new-session-navigation-failure-20260820

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users creating a new Control UI session would see no explanation when the session was created successfully but loading its chat page failed. Retrying could create a duplicate normal session, while a cloud/device placement could leave the Start action incorrectly disabled after its session had already started.

Why This Change Was Made

New-session navigation now owns the exact already-committed Gateway client, selected session, and agent. A failed chat transition remains visible, and retrying opens the same committed session without creating or starting it again. The existing submission gate, attachment-read lifecycle, draft edits, Gateway changes, selected-session/agent changes, terminal starts, and teardown retire or fence that private claim appropriately. Optional route preloading keeps its existing direct-navigation recovery.

User Impact

Operators receive a visible error if a newly created task cannot open. They can safely retry the same existing normal or cloud/device task without duplicate sessions or duplicate remote startup, while attachment reads and switching to Start in Terminal remain safe.

Evidence

  • Regression-first owner proof: both actual normal and cloud-placement public DraftSubmissionFlow.submit() paths failed before the fix when an already committed session's real navigateAndWait rejected. An independently discovered normal double-submit created two sessions and the placement flow incorrectly disabled retry; both now navigate the same committed session with exactly one create/start.
  • Additional independently discovered lifecycle regressions first failed for an in-flight real attachment read bypassing its existing visible submission gate and for an actual resolved-catalog, admin-enabled sessions.catalog.startTerminal leaving an obsolete chat retry alive. Both now pass at their canonical owners.
  • Seven public-owner negative controls cover edited messages, attachment replacement, visibility changes, Gateway invalidation, selected-session replacement, agent changes, and a replacement Gateway client; no stale or cross-owner route is retried. The in-flight retry keeps the existing busy gate.
  • 118 tests passed across nine new-session submission, composer, route-transition, draft persistence, cloud/device placement, recovery, and application startup sibling suites. Existing direct navigation after optional preload failure and successful navigation remain covered.
  • Full assertion-safety and max-lines ratchets, direct focused oxlint, focused oxfmt, and git diff --check all pass. The final full independent owner-boundary review and authenticated full committed Codex review found no actionable issues.
  • Production +84/-49 (net +35): the previously absent exact private committed-session/client/agent claim and retry lifecycle justify the growth; the existing crowded submission owner shrank by four lines and duplicated selection/navigation paths were removed. Tests +199/-12.
  • Existing mounted/browser Control UI proof cannot start in this linked worktree because the unrelated pre-existing @panzoom/panzoom import in ui/src/components/image-lightbox.ts is unavailable; installing dependencies in linked worktrees is prohibited. Zero browser scenarios were executed. Actual public submission owners, Gateway requests, placement startup, terminal action, transition/preload, visible error state, and user-retry contracts are exercised directly by the passing suites.
  • No visual/layout change, public API, Gateway protocol, settings, storage, security policy, or persistent-state change.
  • Exact reviewed head: 506bf5dc68d40de631f43d23ed8036da4814f7e6.

@clawsweeper

clawsweeper Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 20, 2026
@steipete
steipete marked this pull request as ready for review August 20, 2026 22:53
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Aug 20, 2026
@clawsweeper

clawsweeper Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 20, 2026, 7:15 PM ET / 23:15 UTC.

ClawSweeper review

What this changes

The PR retains a committed session after failed Control UI chat navigation so retry opens that same session without creating or starting another one.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

This PR is still necessary: current main discards failed new-session chat navigation, while this patch preserves the committed session and retries navigation without recreating it. No blocking patch defect was found; await exact-head CI.

Priority: P2
Reviewed head: a53a0b36f65b3c88c77cf5666820ea077f635064

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused lifecycle repair with strong source and regression coverage; exact-head CI remains the merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored UI PR documents a concrete browser-proof blocker and supplies focused owner-level regressions; a redacted mounted Control UI recording would still strengthen landing evidence.
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 UI PR documents a concrete browser-proof blocker and supplies focused owner-level regressions; a redacted mounted Control UI recording would still strengthen landing evidence.
Evidence reviewed 5 items Current-main failure path: Current main catches and discards every new-session chat-transition rejection, leaving the submission owner unable to surface the failure.
Owner-bound repair: The patch retries only while the connected client, selected session key, and agent match the committed record; it does not re-enter create or placement-start work.
Regression coverage: Focused tests cover normal and placement navigation failure, same-session retry, attachment-read gating, state retirement, and terminal-start retirement.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs ui/src/pages/new-session/draft-submission-flow.test.ts

Result: PASS (completed)

node scripts/run-vitest.mjs ui/src/pages/new-session/draft-submission-flow.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126873-2eNqSI/target$ node scripts/run-vitest.mjs ui/src/pages/new-session/draft-submission-flow.test.ts
[test] starting test/vitest/vitest.ui.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-126873-2eNqSI/target

node scripts/run-vitest.mjs ui/src/pages/new-session/draft-submission-flow.test.ts
 ✓  ui  ui/src/pages/new-session/draft-submission-flow.test.ts (18 tests) 269ms

 Test Files  1 passed (1)
      Tests  18 passed (18)
   Start at  23:16:29
   Duration  3.93s (transform 2.31s, setup 116ms, import 2.47s, tests 269ms, environment 655ms)

[test] passed 1 Vitest shard in 4.43s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126873-2eNqSI/target$ node scripts/run-vitest.mjs ui/src/pages/new-session/draft-submission-flow.test.ts



































Assertions:

  • PASS expect_output: Test Files

How this fits together

Control UI submission creates a Gateway session or starts a placement, selects it, then transitions to chat. The patch adds a private retry record for that handoff and retires it when the draft, Gateway, session, or agent ownership changes.

flowchart LR
  A[New session form] --> B[Submission flow]
  B --> C[Gateway create or placement start]
  C --> D[Committed session claim]
  D --> E[Select session and build chat route]
  E --> F[Chat transition]
  F --> G[Visible error and same-session retry]
Loading

Before merge

  • Resolve merge risk (P1) - Production code is net +35 lines for a private session/client/agent claim; it is justified by the ownership boundary but should remain confined to this navigation owner.
  • Resolve merge risk (P1) - Exact-head CI is still running, and no mounted Control UI recording is available because the linked worktree lacks an unrelated image-lightbox dependency.
  • Complete next step (P2) - This active maintainer-owned implementation has no concrete repair finding; complete normal exact-head review and CI rather than opening a second fix lane.
Agent review details

Security

None.

PR surface

Source +35, Tests +186. Total +221 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 84 49 +35
Tests 1 198 12 +186
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 282 61 +221

Review metrics

Metric Value Why it matters
Production versus test LOC production +84/-49 (net +35); tests +198/-12 The lifecycle claim adds bounded production state while the submission owner shrinks and tests cover its invalidation boundary.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the retry record private to the submission-to-chat handoff, retain its lifecycle regressions, and land after exact-head CI completes with the documented UI-proof constraint accepted or replaced by a redacted browser run.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the retry record private to the submission-to-chat handoff, retain its lifecycle regressions, and land after exact-head CI completes with the documented UI-proof constraint accepted or replaced by a redacted browser run.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main discards the failed chat transition after creation, and the focused regression tests inject that failure at the owner boundary.

Is this the best way to solve the issue?

Yes: an exact private committed-session/client/agent claim at the submission owner is safer than retrying the create or placement-start side effect.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against e78b9d3ce4aa.

Labels

Label changes:

  • add P2: This fixes a normal Control UI task-creation recovery path that can otherwise duplicate a session or leave a started placement unrecoverable.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored UI PR documents a concrete browser-proof blocker and supplies focused owner-level regressions; a redacted mounted Control UI recording would still strengthen landing evidence.

Label justifications:

  • P2: This fixes a normal Control UI task-creation recovery path that can otherwise duplicate a session or leave a started placement unrecoverable.
  • 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 UI PR documents a concrete browser-proof blocker and supplies focused owner-level regressions; a redacted mounted Control UI recording would still strengthen landing evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main history identifies Peter Steinberger on the submission owner, and blame attributes the proposed retry owner to the same contributor. (role: current implementation introducer and recent area contributor; confidence: high; commits: 0e781ea8d281, a53a0b36f65b; files: ui/src/pages/new-session/draft-submission-flow.ts, ui/src/pages/new-session/started-session-navigation.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for exact-head CI to complete successfully.
  • If the dependency issue is resolved, add a redacted Control UI run showing failure, visible error, and same-session retry.

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.

@steipete
steipete merged commit 91b8a03 into main Aug 20, 2026
154 checks passed
@steipete
steipete deleted the codex/autoqa-ui-new-session-navigation-failure-20260820 branch August 20, 2026 23:27
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 21, 2026
openclaw#126873)

* fix(ui): preserve committed sessions when chat navigation fails

* test(ui): keep committed-session retry fixtures fully typed
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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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