Skip to content

fix: restore selected task after chat reload - #153185

Merged
steipete merged 2 commits into
mainfrom
codex/fix-task-detail-reload
Sep 19, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/fix-task-detail-reload

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: reloading Chat replaces the task selected in Review with workspace Git changes or an empty Review panel.

User Impact

Review restores the selected task after reload, including older tasks outside the recent-task list. Loading and failed lookups remain visible, with an explicit retry action.

Why This Change Was Made

The panel layout survived reload, but its task selection did not. The existing session layout now retains the selected task ID, and the existing task-detail loader retrieves its current data. Closing Review or explicitly selecting another review target clears the task selection. Requests wait for the authoritative list to establish session scope, and obsolete responses cannot replace newer state after deletion, registry restoration, or a connection change.

Evidence

  • The browser regression fails on the original code after an actual page reload and passes with the repair, including an empty recent-task list and a delayed detail response.
  • 204 focused tests cover session isolation, unavailable tasks, retry, stale responses, explicit Git Review, and initial/restored-list ordering. The registered browser reload regression and scoped formatting, type, lint, and build checks pass.
  • Shared Chrome against a real local Gateway retained the same completed subagent transcript and result after reload. The served asset hash matched the reviewed candidate.
  • Independent review found no actionable P0–P2 issues. Inspected before/after screenshots below use synthetic test data; the before state loses the task and the after state restores it.

Before fix: reload loses the selected task

After fix: reload restores the selected task and result

@steipete steipete self-assigned this Sep 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 19, 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 docs Improvements or additions to documentation app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 19, 2026
@steipete
steipete marked this pull request as ready for review September 19, 2026 21:41
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 19, 2026, 5:58 PM ET / 21:58 UTC (Revision 2).

ClawSweeper review

What this changes

Chat remembers the task selected in Review across reloads, retrieves its current details, and shows loading, unavailable, and retry states.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on current main. No actionable correctness or security defects were found, and the supplied visual and runtime evidence supports the repair.

Priority: P2
Reviewed head: 16a0fb7a554dedfc01e2edc3099902d5a36d958b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with useful visual proof, lifecycle regression coverage, and no blocking findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after browser screenshots show the Review restoration outcome, supported by the supplied real-Gateway reload observation and matching served assets. The latest commit changes test-fixture placement only.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after browser screenshots show the Review restoration outcome, supported by the supplied real-Gateway reload observation and matching served assets. The latest commit changes test-fixture placement only.
Evidence reviewed 9 items Current main still loses the selection: At fetched main, openTaskDetailId reads only transient sidebar content, and SidebarPanel has no persisted taskId. The reload repair therefore remains distinct work.
Latest release storage contract: The latest release’s panel type contains only id and slot. Local release-blob inspection failed, but the GitHub contents API supplied the source successfully. The PR adds an optional field without replacing existing layout values.
Bounded persistence and upgrade compatibility: The existing normalizer retains only a normalized task ID on detail panels. Persistence tests retain legacy layouts and existing presentation preferences; fresh-mount tests cover restoration, closing Review, another session, and explicit Git Review.
Findings None None.
Security None None.

How this fits together

Chat’s Review panel displays background-task details alongside the conversation. Browser settings retain the selection, while the Gateway supplies current task data and transcripts.

flowchart LR
 A[Select task in Chat] --> B[Save session panel selection]
 B --> C[Reload Chat]
 C --> D[Load current task list]
 D --> E[Resolve selected task details]
 E --> F[Show transcript or recovery state]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +67, Tests +397, Docs 0. Total +464 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 9 132 65 +67
Tests 6 554 157 +397
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 687 223 +464

Review metrics

Metric Value Why it matters
Persisted presentation change 1 optional task ID; 0 new settings or Gateway parameters Existing layouts remain readable and task content continues to come from the Gateway.
Production versus test growth Production net +67 lines; tests and test helpers net +397 lines Production growth supports restoration and stale-response handling; tests cover reload and selection lifecycle behavior.

Technical review

Best possible solution:

Retain only the selected task identity in existing session layout settings and resolve its current content through the existing scoped Gateway loaders.

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

Yes: select a task in Review and reload Chat; current main persists the panel but not its task identity. Source and supplied before/after evidence establish the path; this review did not execute it.

Is this the best way to solve the issue?

Yes: extending the existing layout and task-loader owners avoids a competing store, preserves old layouts, and handles tasks outside the recent list.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a5fa4fee5503.

Labels

Label justifications:

  • P2: Losing the selected Review task on reload is a bounded Chat usability defect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after browser screenshots show the Review restoration outcome, supported by the supplied real-Gateway reload observation and matching served assets. The latest commit changes test-fixture placement only.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after browser screenshots show the Review restoration outcome, supported by the supplied real-Gateway reload observation and matching served assets. The latest commit changes test-fixture placement only.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after browser screenshots show the Review restoration outcome, supported by the supplied real-Gateway reload observation and matching served assets. The latest commit changes test-fixture placement only.

Evidence

What I checked:

  • Current main still loses the selection: At fetched main, openTaskDetailId reads only transient sidebar content, and SidebarPanel has no persisted taskId. The reload repair therefore remains distinct work. (ui/src/pages/chat/components/chat-detail-slot.ts:22, a5fa4fee5503)
  • Latest release storage contract: The latest release’s panel type contains only id and slot. Local release-blob inspection failed, but the GitHub contents API supplied the source successfully. The PR adds an optional field without replacing existing layout values. (ui/src/pages/chat/sidebar-layout-types.ts:14, ec9c1a13db89)
  • Bounded persistence and upgrade compatibility: The existing normalizer retains only a normalized task ID on detail panels. Persistence tests retain legacy layouts and existing presentation preferences; fresh-mount tests cover restoration, closing Review, another session, and explicit Git Review. (ui/src/pages/chat/sidebar-layout-normalize.ts:105, 16a0fb7a554d)
  • Current request and session ownership: Detail lookups validate their request generation, current connection/session state, returned task ID, and conversation scope. Deletion and registry-restoration events invalidate older requests. The restoration tests exercise delayed responses, retry, connection changes, and list ordering. (ui/src/pages/chat/components/chat-background-tasks.ts:545, 16a0fb7a554d)
  • Inspected visual proof and supplied live observation: Both prepared screenshots were inspected: the before image shows empty Review, while the after image shows the completed selected task and retained result. These are synthetic browser captures. The captured PR body separately reports a real local Gateway reload retaining the completed subagent transcript, with matching served assets. Its supplied source revision is 5c3739a8544d5e088065607073ef779078b8cad401e71873eed5aed65a10e1ee. (6dc2177aa7b0)
  • Re-review continuity: The GitHub commit patch confirms that the latest commit relocates the shared test fixture and adjusts imports. Production behavior is unchanged from the previous reviewed head, whose structured review contains no findings. (ui/src/pages/chat/test-helpers/chat-pane-review.ts:1, 16a0fb7a554d)

Likely related people:

  • 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-19T21:48:49.121Z sha 6dc2177 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 12b83e6 into main Sep 19, 2026
153 checks passed
@steipete
steipete deleted the codex/fix-task-detail-reload branch September 19, 2026 22:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
* fix: restore selected task after chat reload

* test: keep task review fixture in test helper scope
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 docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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