Skip to content

fix(ui): keep automation history on the selected task - #147399

Merged
steipete merged 1 commit into
mainfrom
codex/qa-cron-selection-20260913
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-cron-selection-20260913

Conversation

@steipete

@steipete steipete commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Running one automation and selecting another before the run request finishes can replace the selected task’s history with the earlier task’s history.

User Impact

Run history stays attached to the selected task while earlier run requests finish. Normal run acknowledgements, filters, pagination, overview history and active refreshes retain their behavior.

Why This Change Was Made

The run-history owner accepted a second job identity from callers in addition to the current selection. A delayed mutation could therefore start a request for an obsolete target and invalidate the correct pending read. Remove that redundant argument and derive history identity from the current view state. All callers use the same owner; production changes by +16/−20, net −4 lines. No Gateway, scheduler, stored-data, configuration or protocol contract changes.

Evidence

All 279 focused tests pass. Paired Chromium scenarios reproduced both delayed queued-run and invalid-spec failures on the baseline; the candidate passed those cases and both settled-read controls. The built Control UI used the existing mock Gateway with synthetic data. Screenshots and finalized recordings were inspected; this is browser boundary proof, not a live Gateway or provider run.

The normal changed gate passed 18 stages, then lint found two missing test braces. Only those braces changed. The final mounted suite passed 33/33; formatting, targeted lint and the remaining UI styles check passed. Passed types and guards were reused as a documented composite. Fresh final-byte P0–P2 review found no actionable findings. No full core build was needed or run.

Validation was performed on ec049f94608c606780b845e83b3838d74cc5aa3b plus this patch. All cron owner, view, test and feature-reference files remain byte-identical on comparison main d534c3153d3460ebb1d7e2f2d7876617643db7de. Exact-head CI and the required gate passed. An additional independent review of the complete owners and callers found no actionable P0–P2 issues.

Before - Alpha history replaces the selected Beta task history

After - Beta history remains attached to the selected task

@clawsweeper

clawsweeper Bot commented Sep 13, 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: S maintainer Maintainer-authored PR labels Sep 13, 2026
@steipete
steipete marked this pull request as ready for review September 13, 2026 20:45
@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 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 4:53 PM ET / 20:53 UTC.

ClawSweeper review

What this changes

The PR makes automation history refresh from the currently selected task, updates all callers, adds delayed-run regression coverage, and documents the behavior.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix for a selection race present on current main. The browser evidence supports the intended result, and no introduced correctness or security defects were found.

Priority: P2
Reviewed head: b9e2450be3329db8ab09e42d0e2a8a4977a13ff7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with relevant mounted regression tests and directly inspected browser evidence.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after Chromium captures show the built Automations page changing from Alpha history under selected Beta to Beta’s own history after the controller repair; the supplied scenario uses the repository’s mock Gateway and covers this UI boundary.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after Chromium captures show the built Automations page changing from Alpha history under selected Beta to Beta’s own history after the controller repair; the supplied scenario uses the repository’s mock Gateway and covers this UI boundary.
Evidence reviewed 7 items Current main still contains the race: Both run-completion branches still pass the original run target into history loading. The relevant controller and page files are unchanged between the pinned merge base and fetched main, so the proposed repair remains necessary.
Selection-owned repair and complete caller migration: The loader now reads cronRunsJobId from current view state. Existing connection, agent, selection, filter, pagination, and request-identity checks remain intact; inspected callers all use the new internal signature. The change does not alter Gateway authorization, persisted data, configuration, or plugin APIs.
Mounted regression coverage: The two new cases click Run on Alpha, select Beta while its history read is pending, deliver a refresh event, and resolve Alpha with either a queued acknowledgement or invalid-spec outcome. They assert that Beta remains selected and displays Beta history after the older read settles. Existing tests retain filter, pagination, stale-result, and coalescing coverage. Tests were inspected, not executed during this read-only review.
Findings None None.
Security None None.

How this fits together

The Control UI’s Automations page sends run requests and reads history from the Gateway. Its history controller combines the current task selection and filters, then publishes only responses that still match that view.

flowchart TD
  A[Task selection and filters] --> C[History controller]
  B[Run acknowledgement or refresh event] --> C
  C --> D[Gateway history request]
  D --> E{Still the current request?}
  E -->|Yes| F[Selected task history]
  E -->|No| G[Discard stale response]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -4, Tests +114, Docs 0. Total +110 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 2 16 20 -4
Tests 3 132 18 +114
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 149 39 +110

Review metrics

None.

Technical review

Best possible solution:

Keep task selection authoritative for every history refresh while preserving the existing stale-response and pagination guards.

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

Yes: run Alpha, select Beta before Alpha’s acknowledgement arrives, and delay Beta’s first history response. Current-main source establishes the stale-target request replacing the active read; supplied browser captures corroborate the visible failure, but this review did not execute it.

Is this the best way to solve the issue?

Yes. Removing the redundant caller-supplied identity repairs the existing history owner directly and prevents mutation completions from competing with current selection.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: Switching tasks during a pending run can leave misleading history in the selected task’s view, with impact bounded to the Automations UI.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after Chromium captures show the built Automations page changing from Alpha history under selected Beta to Beta’s own history after the controller repair; the supplied scenario uses the repository’s mock Gateway and covers this UI boundary.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after Chromium captures show the built Automations page changing from Alpha history under selected Beta to Beta’s own history after the controller repair; the supplied scenario uses the repository’s mock Gateway and covers this UI boundary.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after Chromium captures show the built Automations page changing from Alpha history under selected Beta to Beta’s own history after the controller repair; the supplied scenario uses the repository’s mock Gateway and covers this UI boundary.

Label justifications:

  • P2: Switching tasks during a pending run can leave misleading history in the selected task’s view, with impact bounded to the Automations UI.
  • 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 Chromium captures show the built Automations page changing from Alpha history under selected Beta to Beta’s own history after the controller repair; the supplied scenario uses the repository’s mock Gateway and covers this UI boundary.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after Chromium captures show the built Automations page changing from Alpha history under selected Beta to Beta’s own history after the controller repair; the supplied scenario uses the repository’s mock Gateway and covers this UI boundary.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after Chromium captures show the built Automations page changing from Alpha history under selected Beta to Beta’s own history after the controller repair; the supplied scenario uses the repository’s mock Gateway and covers this UI boundary.

Evidence

What I checked:

  • Current main still contains the race: Both run-completion branches still pass the original run target into history loading. The relevant controller and page files are unchanged between the pinned merge base and fetched main, so the proposed repair remains necessary. (ui/src/lib/cron/index.ts:1347, dab1f08376ca)
  • Selection-owned repair and complete caller migration: The loader now reads cronRunsJobId from current view state. Existing connection, agent, selection, filter, pagination, and request-identity checks remain intact; inspected callers all use the new internal signature. The change does not alter Gateway authorization, persisted data, configuration, or plugin APIs. (ui/src/lib/cron/index.ts:1440, b9e2450be332)
  • Mounted regression coverage: The two new cases click Run on Alpha, select Beta while its history read is pending, deliver a refresh event, and resolve Alpha with either a queued acknowledgement or invalid-spec outcome. They assert that Beta remains selected and displays Beta history after the older read settles. Existing tests retain filter, pagination, stale-result, and coalescing coverage. Tests were inspected, not executed during this read-only review. (ui/src/pages/cron/cron-page.test.ts:649, b9e2450be332)
  • Inspected browser before/after evidence: Both prepared images were opened locally. The before capture shows Beta selected with Alpha/overview history; the after capture shows Beta selected with Beta history, while the Alpha run acknowledgement remains visible. The captured PR body identifies Chromium using the built Control UI and existing mock Gateway with synthetic data. This directly supports the visible history correction, without establishing live Gateway or provider behavior. Sources: https://github.com/user-attachments/assets/e2b01be7-490c-44a0-8277-34ee940a0116 and https://github.com/user-attachments/assets/8504e571-97e8-4290-bcce-b52ee03cb677. (b9e2450be332)
  • Latest supplied release retains the old path: Inspection of v2026.9.4 shows the original job argument in run-completion refreshes and the loader’s caller-supplied identity fallback. This release does not contain the proposed correction. (ui/src/lib/cron/index.ts:1347, 3a9d69db306c)
  • Relevant merged-history routing: Current-main logs identify repeated automation-state and refresh work by Peter Steinberger. The GitHub commit endpoint verifies steipete as the author of a recent page-state repair and shows its routeJobRequested change; the raw commit records the same parent. Older blame traversal could not finish because a required historical object was unavailable, so no original introduction claim is made. (ui/src/pages/cron/cron-page.ts:63, bad814efcab6)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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.

@steipete
steipete merged commit 9d5fc2e into main Sep 13, 2026
186 checks passed
@steipete
steipete deleted the codex/qa-cron-selection-20260913 branch September 13, 2026 22:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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: S 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