Skip to content

fix(update): deliver final progress after updates exceed 45 minutes - #139289

Merged
obviyus merged 4 commits into
openclaw:mainfrom
TheAngryPit:fix/update-watcher-late-terminal-progress
Sep 5, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
TheAngryPit:fix/update-watcher-late-terminal-progress

Conversation

@TheAngryPit

@TheAngryPit TheAngryPit commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Related: #139284. This fixes the Gateway watcher workstream; the separate CLI initialization work in #139288 is outside this PR.

What Problem This Solves

A connected operator can miss an update's terminal progress when the update remains active for more than 45 minutes. The durable run completes, but the passive Updates page can remain on Staging with configuration controls disabled.

Why This Change Was Made

Remove the watcher's elapsed-time cutoff and start timestamp. Observe an active run until its terminal outcome or Gateway teardown. The ledger retains ownership of the result. The refreshed head preserves main's notice-draining shutdown behavior from #139304. Production code is net −5 lines.

User Impact

Late completion reaches connected clients, allowing the Control UI to read the terminal row and release its update interlock. Existing acknowledgement and final-notice deduplication remain intact.

Evidence

The long comparison used actual shipped gateway call update.run requests, normally authenticated passive clients, and the built Updates page. An isolated controller paused only each request's real Git clean-check child for 46 minutes, then resumed that same child. The unchanged updater returned its own dirty-checkout refusal. No fake clock, manual ledger admission/completion, command shim, installation, or managed-service simulation was used for these requests.

Observation Baseline 672adca9aa6f Tested candidate 198bf65d99f6
Real Git clean-check duration 46m 0.255s 46m 0.198s
Natural result skipped: dirty, no restart skipped: dirty, no restart
Passive terminal event Missing Exactly one, matching the final row revision
Acknowledgement / direct final notice One each One each
Durable active run after completion Cleared Cleared
Passive Updates page Still Staging and locked; deliberate reload recovered Terminal result and unlocked controls without reload

A fresh source-blind validator passed all nine long-request acceptance clauses. The baseline also emitted its existing expiry-time duplicate Staging event; it never emitted a terminal event through observation and deliberate disconnect. Thus the direct CLI response and direct notice did not hide the passive-client failure.

After this proof completed, a real test conflict with #139304 required integration with main. The integrated head 166b0227a9f0 has a separate clean build and fresh source-blind shipped-request acceptance over a 15-second real child hold: natural refusal, one matching terminal event, one acknowledgement and final notice, unchanged-page unlock, and independently verified clean shutdown. The completed long observations retain their original build identities. The integrated watcher preserves the same active polling and terminal logic; the imported change adds shutdown custody for pending notices. No separate 46-minute observation is claimed for the integration commit. The contributor subsequently refreshed main through 8d35b0e2d91d and current head b2d8bafa7c6c. The watcher, tests, updater, ledger, notice path, update UI, and dependency pins remain unchanged from the tested integration. Retained observations stay bound to build 166b0227a9f0; fresh exact-head review checks that reuse.

  • The resolved late-terminal regression fails on current main for the missing event and passes on the integrated candidate.
  • 137 tests on the integrated watcher, startup, and shutdown source pass, including entered-notice draining and queued-notice retirement. Pinned formatting, the full isolated build, and independent code review pass.
  • Earlier 149-test coverage, the independent 50-minute watcher-controlled run, next-run discovery, and measured teardown/late-wake checks remain retained under their tested identities.
  • Current-head CI checks are verified by the landing gate.

This proves refused unmanaged Git updates. It does not claim successful installation or managed restart. The two retained long-run builds reported serviceRestartSafe=false / runtime-verification-failed; that limitation was preserved. The fresh integration build reports its generated build identity normally. No existing build stamp was rewritten.

The existing configuration-write protection is the Control UI interlock. Direct authorized configuration requests remain a separate unchanged policy. This PR does not add killed-updater recovery or close the umbrella issue.

Actual late shipped request: baseline stays locked, candidate completes

Baseline after natural completion at more than 46 minutes:

Baseline still shows staging

Baseline configuration controls remain disabled

Candidate after natural completion on its unchanged passive page:

Candidate terminal result and enabled controls

Retained 50-minute watcher transition recording

This separate recording shows the earlier canonical-ledger stimulus reaching the connected UI after 50 minutes, followed by usable controls. It is complementary watcher evidence, not the shipped-request admission/completion proof above and not an actual installation. The excerpt preserves the original transition and removes unrelated waiting time.

retained-late-watcher-transition.mp4

@clawsweeper

clawsweeper Bot commented Sep 5, 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 gateway Gateway runtime size: S labels Sep 5, 2026
@TheAngryPit
TheAngryPit marked this pull request as ready for review September 5, 2026 18:36
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 7:34 PM ET / 23:34 UTC.

ClawSweeper review

What this changes

Keeps the Gateway observing active updates until completion or shutdown so connected clients receive late final progress.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused repair: current main still abandons observation after 45 minutes. The retained real-request proof supports the fix, and no introduced correctness defect was found.

Priority: P2
Reviewed head: b2d8bafa7c6c270cec667f4814536201716b476f

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A small owner-level repair with strong, scoped before/after runtime evidence and preserved lifecycle safeguards.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied real-request observations exercise the production watcher through a 46-minute Git-child hold and show the missing terminal event restored, with passive-page unlock and unchanged notice counts. Separate integration proof covers shutdown; relevant source matches the reviewed head. Media retrieval was unavailable, but the recorded runtime observations remain sufficient for this bounded repair.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied real-request observations exercise the production watcher through a 46-minute Git-child hold and show the missing terminal event restored, with passive-page unlock and unchanged notice counts. Separate integration proof covers shutdown; relevant source matches the reviewed head. Media retrieval was unavailable, but the recorded runtime observations remain sufficient for this bounded repair.
Evidence reviewed 9 items Current main still contains the defect: The fetched main watcher stops scheduling polls when elapsed observation reaches 45 minutes, even while the ledger row remains running.
Verified introduced change: The pinned base-to-head diff removes elapsed-time abandonment while retaining the polling interval, terminal rediscovery, acknowledgement check, notice scope, and teardown fencing. The replacement regression checks a terminal transition after 46 minutes and retains teardown coverage.
Established progress contract: Documentation promises update.run.changed events while a run is active and authoritative history reads for recovery.
Findings None None.
Security None None.

How this fits together

The Gateway watcher reads the durable update ledger and broadcasts changes to connected clients. The Control UI uses those events to fetch the authoritative result and release its update controls.

flowchart LR
  A[Update request] --> B[Updater writes ledger]
  B --> C[Gateway watcher]
  C --> D{Run terminal?}
  D -->|No| C
  D -->|Yes| E[Final progress event]
  E --> F[Control UI refreshes result]
  D -->|Acknowledged run| G[Deduplicated final notice]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -5, Tests +9. Total +4 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 7 12 -5
Tests 1 20 11 +9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 27 23 +4

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #139284
Summary: This PR addresses the tracker's late-observation workstream; CLI terminalization remains separate.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Observe the authoritative run until terminal state or teardown, preserving notice deduplication and shutdown ownership.

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

Yes: current-main source stops observation at 45 minutes, and a later terminal ledger change cannot reach that stopped watcher. Contributor evidence demonstrates the corresponding real-request failure; this read-only review did not execute tests.

Is this the best way to solve the issue?

Yes: removing observer abandonment repairs the documented progress contract at its owner without inventing recovery authority or changing the ledger.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs stale progress after unusually long updates; the supplied baseline recovered through a page reload.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied real-request observations exercise the production watcher through a 46-minute Git-child hold and show the missing terminal event restored, with passive-page unlock and unchanged notice counts. Separate integration proof covers shutdown; relevant source matches the reviewed head. Media retrieval was unavailable, but the recorded runtime observations remain sufficient for this bounded repair.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied real-request observations exercise the production watcher through a 46-minute Git-child hold and show the missing terminal event restored, with passive-page unlock and unchanged notice counts. Separate integration proof covers shutdown; relevant source matches the reviewed head. Media retrieval was unavailable, but the recorded runtime observations remain sufficient for this bounded repair.

Evidence

What I checked:

  • Current main still contains the defect: The fetched main watcher stops scheduling polls when elapsed observation reaches 45 minutes, even while the ledger row remains running. (src/gateway/update-run-watcher.ts:9, 67e8e2da4b10)
  • Verified introduced change: The pinned base-to-head diff removes elapsed-time abandonment while retaining the polling interval, terminal rediscovery, acknowledgement check, notice scope, and teardown fencing. The replacement regression checks a terminal transition after 46 minutes and retains teardown coverage. (src/gateway/update-run-watcher.ts:71, b2d8bafa7c6c)
  • Established progress contract: Documentation promises update.run.changed events while a run is active and authoritative history reads for recovery. Public docs: docs/cli/update.md. (docs/cli/update.md:190, b2d8bafa7c6c)
  • Client reconciliation preserves authorization: The event invalidates client state; the UI fetches privileged run facts through its current authenticated connection. This patch changes observation duration, not authorization or persisted representations. (ui/src/app/overlays-updates.ts:407, b2d8bafa7c6c)
  • Real-request before/after evidence: The supplied complete PR body records actual gateway call update.run requests with a real Git child paused for 46 minutes. Baseline 672adca missed the passive terminal event; candidate 198bf65 emitted exactly one matching final revision and unlocked the unchanged page after natural dirty-checkout refusal. Integration 166b022 separately passed a shorter real-request and shutdown check. These observations prove late completion reporting, not successful installation or managed restart. Linked image retrieval failed in this review environment; no independent visual inspection is claimed. (198bf65d99f6)
  • Retained proof matches the relevant current source: No differences were found between the tested integration and reviewed head in the watcher, watcher tests, ledger, record types, or notice runtime. Separate tree comparisons also matched the update RPC, startup owner, client reconciliation, shutdown notifier, asynchronous work scope, package manifest, and lockfile. (src/gateway/update-run-watcher.ts:17, b2d8bafa7c6c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: 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 (7 earlier review cycles)
  • reviewed 2026-09-05T18:41:58.321Z sha 198bf65 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-05T20:47:24.364Z sha 198bf65 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-05T20:55:43.394Z sha 198bf65 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-05T21:22:22.999Z sha 198bf65 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-05T23:04:22.763Z sha 166b022 :: blocked before merge. :: none
  • reviewed 2026-09-05T23:17:09.775Z sha 8d35b0e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-05T23:27:13.353Z sha b2d8baf :: needs maintainer review before merge. :: none

@obviyus obviyus self-assigned this Sep 5, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 5, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 5, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 5, 2026
@obviyus

obviyus commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator

The product proof and current-head review are complete. Both CI failures on b2d8bafa7c6c come from main's #139409 (introducing commit).

The new assertion at src/agents/embedded-agent-runner/run/assistant-failure.test.ts:273 reads failover.maybeRetryTransient, which #139397 had already removed from that fixture and handler contract. It produces both TS2339 and undefined is not a spy. The parent-relative changes and current fixture confirm the cause; it does not depend on watcher execution or timing. The current repair and earlier owned changes were checked against those owners.

The exact main parent 0cebe40cf7cb reproduces both errors in typecheck job 101393058670 and test job 101393059037. The corresponding PR jobs are 101393164757 and 101393167526.

The approved unrelated-CI route applies to these proved failures. The exact-head review and all other required checks remain enforced. Please keep this head stable while the guarded landing completes.

@obviyus

obviyus commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-unrelated-red
pr: 139289
head: b2d8baf
run: 33998492262 attempt: 1
failed: check-test-types-core-1 job=101393164757 conclusion=failure
failed: checks-node-compact-large-2 job=101393167526 conclusion=failure
check: openclaw/ci-gate

@obviyus
obviyus merged commit f284a91 into openclaw:main Sep 5, 2026
212 of 215 checks passed
@obviyus

obviyus commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Thanks @TheAngryPit — merged as f284a91e0aca from reviewed head b2d8bafa7c6c. Contributor credit and Ayaan's co-author trailer are verified.

Bug: a real update can finish after 45 minutes while a passive client misses its terminal event and the Updates page stays locked. Fix: observe the durable run until completion or Gateway shutdown, preserving notice draining.

Real shipped request after 46 minutes Baseline Candidate
Passive terminal event and page Missing; Staging and locked until reload One matching event; terminal result and unlocked without reload
Natural updater result and notices Dirty/skipped; one acknowledgement and final notice Dirty/skipped; one acknowledgement and final notice

The integration build also passed a fresh shipped-request/shutdown acceptance and 137 focused lifecycle tests. Exact-head reviews passed. The long observations remain bound to their original builds; the later main refreshes preserve the relevant watcher path. No installation or managed restart is claimed.

CI exception: applied the recorded approved exception to completed run 33998492262, attempt 1. Both failures are reproduced on the exact main parent 0cebe40cf7cb:

Failure PR job Matching main job
check-test-types-core-1: TS2339 at assistant-failure.test.ts:273 101393164757 101393058670
checks-node-compact-large-2: undefined spy in “surfaces storage failure without replaying the run or rotating credentials” 101393167526 101393059037

The parent-relative diff of c91b1eaab768 in #139409 adds an assertion on failover.maybeRetryTransient after #139397 removed that member from the fixture and handler contract. #139409 was authored and merged by steipete; GitHub is the commit committer. The property is absent by construction, explaining both compiler and runtime errors. The watcher delta and earlier owned repairs do not change those owners. The automatic matcher could not parse the compiler failure, so the explicit guarded approval route was used; other required checks and the exact-head review remained enforced.

#139284 and #139288 remain open.

vincentkoc added a commit that referenced this pull request Sep 5, 2026
* origin/main: (95 commits)
  perf(build): avoid unrelated gateway artifact scans (#127757)
  fix(update): deliver terminal progress after long updates (#139289)
  fix(ui): show session hover cards for local chat URLs (#139384)
  perf(ui): reuse unchanged transcript key snapshots (#139400)
  fix(ui): make subagent sessions view-only (#139381)
  fix: open agent state on SQLite builds without extensions (#139487)
  perf(skills): detach cached metadata from source strings (#139478)
  fix(ui): show primary user in multi-agent profile hero (#136736)
  perf(sessions): stop decoding the session row four times per SQLite entry patch (#136361)
  refactor(exec): share package-manager option scans (#139482)
  fix(ci): authorize frozen mobile release candidates (#139441)
  fix: avoid session deletion slowdown in large session stores (#139467)
  perf(gateway): reuse node invocation idle timers (#139354)
  fix(auth): preserve selected profiles across plugin scopes (#139413)
  fix(discord): retain voice input until transcription completes (#139484)
  fix(agents): name Gateway storage failures in run-failure copy (#139409)
  fix: keep subagent checks responsive in large session stores (#139450)
  fix(memory): index notes when optional embeddings cannot start (#139463)
  fix: refresh pending approvals when reopening chat (#139457)
  fix(tooling): preserve Git hook choices during install (#139461)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
…39289)

Keep active update observation until the ledger records a terminal outcome or the Gateway stops. Preserve notice draining during shutdown.

Real shipped requests held for 46 minutes reproduced the missing passive terminal event and locked page on baseline, while the candidate delivered one event and unlocked without reload. The integrated head retains that active watcher logic and passes a fresh shipped request, shutdown acceptance, and 137 focused lifecycle tests.

Related: openclaw#139284; the separate CLI initialization work remains outside this repair.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

2 participants