Skip to content

fix(update): let finalization finish without an implicit deadline - #153085

Merged
fuller-stack-dev merged 6 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-aggregate-work-deadlines-20260919
Sep 19, 2026
Merged

fuller-stack-dev merged 6 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-aggregate-work-deadlines-20260919

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Related: #152973

What Problem This Solves

Fixes healthy update finalization being canceled by an overall deadline when the operator did not request one.

User Impact

Current CLI updates and gateway Git finalization can finish without an implicit overall time limit. Explicit operator limits and inherited limits from older update handoffs retain their behavior.

Why This Change Was Made

Preserve omitted operator input at update admission and across the fresh-process handoff. The handoff reuses the existing private timeout record so older receivers still get their compatibility allowance. Probes, cancellation cleanup and mutation ownership retain their existing rules.

Evidence

Exact-lock Linux focused tests: 155 passed across CLI execution, post-core continuation, executor settlement, activation, migrated continuation, migrated worker and RPC finalization. The first run exposed one stale assertion requiring an implicit timeout; the corrected test and all 32 infra cases passed. Test summary, original result, corrected result, artifact manifest.

The test cell used base f2dff0dcf9cca6e11aba8cbdf35a3005027894d3 plus frozen candidate patch d85cb222e3fcb26b4b8017dcd0b28a1589dece68074b431c4a78af632fc3ca5b, followed by the one-test correction. Ten changed files retain their tested bytes. The worker was subsequently integrated with the separately landed SQLite reporting fix and its actual timeout-selection and ownership controls passed again. Its test fixture later gained an explicit undefined iterator return for Node type compatibility, with no runtime change. This is focused test evidence; installed-driver qualification is recorded separately.

Base runtime observations show implicit three-hour ordinary CLI, four-and-a-half-hour campaign-default and two-hour RPC finalizer deadlines on omitted input. These observe real timer/process admission, without waiting those elapsed durations.

Independent runtime validation passed the original scoped timer, handoff and child-process clauses. Its supplemental run passed canonical lease admission, paired invalid-identity controls, cooperative cancellation ordering, and an independent 421 ms child variation. The original report remains preserved: its root-lease readbacks used a noncanonical path and are explicitly superseded by positive admission and settlement observations. Original report, passed supplement, raw observation manifest.

The scoped observations use controlled update preparation and finalization effects; they do not establish a full update. The final base includes the separately landed Git work-deadline and SQLite terminal-reporting fixes. The integrated worker passed six timeout-selection cases and four actual ownership cases. Independent worker revalidation passed on the published head. Final worker report, final worker artifact manifest. The published-head qualification run passed all 139 affected focused cases. Installed OpenClaw 2026.9.3 then updated synthetic operator state to exact candidate 253eeb0, with all 47 compatibility phases passing through final gateway readiness and status. This uses a manual gateway restart and no live provider credentials. Source remained clean before and after build/test, and package identity plus the evidence archive were verified. Compatibility receipt, focused test receipt, installed-driver artifact manifest.

Current head: f4cc6543956654e418d89f52a5293e0c6ca1839e, including canonical 6f36619571aebcf883e44ed488b5c15b4cce1f6b. The 139-case run and final worker report use 253eeb0; every product file in this PR remains byte-identical. The later upstream ACP task and doctor profile-workspace changes do not alter the tested deadline or ownership paths. CI found one test iterator typing error on 253eeb0; the corrected head adds an explicit return undefined, which passed scoped independent review. The originally failing core-test type stripe 3/5 now passes on exact 253eeb0 plus that one-line correction, with Node 24.19.0 and @types/node 26.5.1. Type-gate receipt, correction and artifact manifest. Full GitHub CI and both required merge-gate entries passed on 678c881, including security reevaluation.

The documentation follow-up clarified omitted versus explicit aggregate deadlines and legacy handoff behavior. Scoped independent review, documentation formatting, MDX checks, and all 14,152 internal links passed. The green parent CI above remains bound to 678c881.

The current signed main merge includes the canonical test-partition repair from #153004. All 13 authored files are byte-identical to reviewed 07d50aec, and the complete candidate received a fresh clean review against the updated base. Canonical managed-helper activation changes preserve the existing live handoff validator; the installed-driver proof above uses manual restart and does not claim managed-service coverage. The updated base also adds isolated test-worker build entries. Current-head CI is validating those integrated inputs through the normal required gates.

@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 cli CLI command changes size: M maintainer Maintainer-authored PR labels Sep 19, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 19, 2026, 4:02 PM ET / 20:02 UTC (Revision 5).

ClawSweeper review

What this changes

Update finalization preserves an omitted timeout across CLI and fresh-process execution while retaining explicit deadlines, inherited allowances, and separate operation bounds.

Merge readiness

⛔ Blocked before merge - 1 item remains

The PR remains useful: current main and the latest release still impose aggregate finalization deadlines. The previous documentation finding is resolved, and this review found no actionable introduced defect.

Priority: P2
Reviewed head: f4cc6543956654e418d89f52a5293e0c6ca1839e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant runtime and upgrade evidence, compatible handoffs, and no remaining actionable finding.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The source-matched PR evidence records production timer/handoff and real child-process observations for omitted and explicit limits, ownership rejection, and cancellation settlement, plus a published-updater upgrade through readiness and status. Changed product bytes match the tested candidate; artifact retrieval was reviewer-blocked, and manual restart limits the upgrade claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The source-matched PR evidence records production timer/handoff and real child-process observations for omitted and explicit limits, ownership rejection, and cancellation settlement, plus a published-updater upgrade through readiness and status. Changed product bytes match the tested candidate; artifact retrieval was reviewer-blocked, and manual restart limits the upgrade claim.
Evidence reviewed 9 items Current main still needs the change: Fetched main unconditionally calculates the aggregate activation allowance before mutable activation and the whole-process allowance for RPC finalization, including when the operator omitted a timeout.
Latest-release comparison: Inspection of v2026.9.5 also shows an unconditional whole-process finalization budget; the submitted behavior is not already present in that release.
Compatible timeout handoff: The shared reader recognizes omission only for supported metadata matching the serialized positive timeout. The migrated worker preserves an inherited activation allowance before considering omission; unknown and legacy input retain finite budgeting.
Findings None None.
Security None None.

How this fits together

OpenClaw’s updater activates a candidate installation, then finishes Doctor, plugin reconciliation, and Gateway verification. Timeout intent crosses process boundaries so the installed updater and candidate runtime can coordinate that work.

flowchart TD
  A[CLI or Gateway update] --> B[Read operator timeout]
  B --> C[Activate candidate]
  C --> D[Carry timeout intent]
  D --> E{Explicit or inherited limit?}
  E -->|Yes| F[Bound aggregate finalization]
  E -->|No| G[Finalize without aggregate deadline]
  F --> H[Settle children and report outcome]
  G --> H
Loading

Before merge

  • Resolve merge risk (P1) - The linked runtime receipts were inaccessible through this reviewer’s network allowlist; their detailed, source-matched PR summaries were inspected. The recorded installed-driver qualification uses manual restart and does not establish managed-service restart coverage.
Agent review details

Security

None.

PR surface

Source +45, Tests +179, Docs +4. Total +228 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 8 108 63 +45
Tests 4 183 4 +179
Docs 1 14 10 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 305 77 +228

Review metrics

Metric Value Why it matters
Production versus regression coverage production +45 net lines; tests and test support +179 net lines Production growth carries timeout intent across existing process boundaries; regression cases distinguish omission, explicit limits, inherited allowances, and malformed handoffs.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep timeout intent distinct from compatibility allowances, with the existing executor retaining ownership and cancellation safeguards throughout finalization.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep timeout intent distinct from compatibility allowances, with the existing executor retaining ownership and cancellation safeguards throughout finalization.

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

Yes, from source: current main converts omitted timeout input into a finite aggregate activation or finalizer deadline. This review did not execute a long-running update.

Is this the best way to solve the issue?

Yes. The patch preserves omission at the existing producers and receivers, reuses the private handoff contract, and leaves explicit limits and live ownership checks intact.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a focused update-reliability repair for healthy finalization exceeding an implicit aggregate allowance.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The source-matched PR evidence records production timer/handoff and real child-process observations for omitted and explicit limits, ownership rejection, and cancellation settlement, plus a published-updater upgrade through readiness and status. Changed product bytes match the tested candidate; artifact retrieval was reviewer-blocked, and manual restart limits the upgrade claim.
  • proof: sufficient: Contributor real behavior proof is sufficient. The source-matched PR evidence records production timer/handoff and real child-process observations for omitted and explicit limits, ownership rejection, and cancellation settlement, plus a published-updater upgrade through readiness and status. Changed product bytes match the tested candidate; artifact retrieval was reviewer-blocked, and manual restart limits the upgrade claim.

Evidence

What I checked:

  • Current main still needs the change: Fetched main unconditionally calculates the aggregate activation allowance before mutable activation and the whole-process allowance for RPC finalization, including when the operator omitted a timeout. (src/cli/update-cli/update-command-execution.ts:537, 562088cdd5ea)
  • Latest-release comparison: Inspection of v2026.9.5 also shows an unconditional whole-process finalization budget; the submitted behavior is not already present in that release. (src/infra/update-post-core-finalize.ts:200, ec9c1a13db89)
  • Compatible timeout handoff: The shared reader recognizes omission only for supported metadata matching the serialized positive timeout. The migrated worker preserves an inherited activation allowance before considering omission; unknown and legacy input retain finite budgeting. (src/infra/update-migrated-finalize.worker.ts:88, f4cc65439566)
  • Ownership remains independent of elapsed-time policy: The existing executor still validates live parent, spawner, lease, and child identity, rechecks ownership through its fence, and settles children before releasing ownership. Omitting activation.start does not skip those checks. (src/cli/update-cli/update-command-executor.ts:186, f4cc65439566)
  • Re-review continuity: All 13 authored files are unchanged from the previous reviewed head, 07d50ae. The documentation now distinguishes omitted, explicit, inherited, and legacy deadlines, resolving the earlier finding. Public docs: docs/cli/update.md. (docs/cli/update.md:198, f4cc65439566)
  • Captured runtime and upgrade evidence: The fully retrieved PR body matches captured SHA256 3349572327d3fd3454312207fdf12e8e53a152d4c1810d078e322f3fd561c4da. It records actual timer admission, handoff, child-process, invalid-identity, and cancellation-settlement observations, plus 47 successful published-2026.9.3-to-candidate upgrade phases with synthetic retained state and manual Gateway restart. The changed production files are byte-identical to tested candidate 253eeb0. Linked R2 receipts could not be independently retrieved because this reviewer’s network allowlist blocks their host. (253eeb0ff603)

Likely related people:

  • Peter Steinberger: Raw commit 290613f adds src/infra/update-finalization-budget.ts:8 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 290613f538dd; files: src/infra/update-finalization-budget.ts)
  • fuller-stack-dev: 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 (4 earlier review cycles)
  • reviewed 2026-09-19T18:22:56.690Z sha 253eeb0 :: blocked before merge. :: [P3] Update the documented aggregate-timeout default
  • reviewed 2026-09-19T18:42:17.533Z sha 678c881 :: blocked before merge. :: [P3] Update the documented aggregate-timeout default
  • reviewed 2026-09-19T19:02:19.907Z sha 678c881 :: blocked before merge. :: [P3] Update the documented aggregate-timeout default
  • reviewed 2026-09-19T19:23:59.666Z sha 07d50ae :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Sep 19, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Addressed the documentation finding in 07d50ae. The Options section now says current CLI/RPC omission adds no aggregate activation deadline, distinguishes explicit and inherited limits from legacy or unrecognized handoffs, and preserves the separate operation, readiness, and cleanup bounds. It does not describe the remaining child-work budget changes as landed.

Validation passed: documentation formatting across 1,302 files, MDX checks across 1,314 files, 14,152 internal links with zero broken links, git diff --check, and scoped independent review. This follow-up changes only docs/cli/update.md; all product and test bytes match the fully green parent 678c881.

The artifact-access note is a restriction of the automated review environment. The publisher fetched every linked proof artifact after publication and verified HTTP status, size, and SHA256. I independently matched the local published files to those receipts. The Evidence section retains the exact candidate identities, raw-test receipts, independent observations, and the 47-phase installed-updater result, including its synthetic-state and manual-restart limits.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Replying to revision 5's merge-risk note.

The maintainer has accepted this as an explicit proof limitation. The coordinator independently downloaded the published receipts and verified their byte counts and SHA-256 hashes. The bot's artifact-host allowlist blocked its own retrieval; we do not claim the bot inspected those bytes.

The installed-driver receipt records all 47 phases passing for published OpenClaw 2026.9.3 updating to exact candidate 253eeb0ff603122289639ef86e344b3c351bde5f. It uses synthetic retained state and manual Gateway restart. It does not establish managed-service restart E2E coverage. The artifact manifest and focused-test receipt retain the exact build and 139-test identities. The downloaded installed-driver receipt hashes to 3d52fbef150978c34be0760e5f0e87feb3c0d91ed31b1b86af54550133edbcb2; the manifest hashes to 9f0c9c96051f585ebbbf4c6277f5cd40b320021682a1d9d920594536e9264256.

The affected contract has separate timer, explicit-limit, malformed/legacy-input, authority-rejection, lease-admission and child-settlement controls. The authored production bytes are unchanged from the executed candidate. The final signed head f4cc6543956654e418d89f52a5293e0c6ca1839e has the exact reviewed merge tree, and all 13 authored files match the previously reviewed 07d50aec.

The canonical managed-helper change was traced separately. It leaves the handoff identity validator, aggregate-budget owners, provenance contract, optional executor argument and lease protections unchanged. This PR does not claim broader managed-service proof. The maintainer accepts the existing evidence for this bounded change; native landing remains subject to the required current-head checks. The original review note is preserved.

@fuller-stack-dev
fuller-stack-dev merged commit d79393e into openclaw:main Sep 19, 2026
226 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the fix/update-aggregate-work-deadlines-20260919 branch September 19, 2026 20:27
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
…enclaw#153085)

* fix: preserve omitted update finalization deadlines

* test: align RPC finalizer omission expectation

* test(update): type the migrated stdin iterator return

* docs(update): clarify aggregate deadline omission
tideclaw-bot added a commit that referenced this pull request Nov 26, 2026
…imeout

Restoring an implicit finalizer deadline added a failure path that a healthy but
slow update could hit (#153085 removed it for that reason), and its expiry is
reported as update-recovery-pending, which the helper does not route into
recovery. Drop it again: an explicit --timeout still bounds the worker, and its
update-activation-timeout result enters the verified interrupted recovery.

Refs #205547.

Co-authored-by: RomneyDa <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 26, 2026
… a verified Gateway (#205758)

* fix(update): admit migrated finalizer requester once

Co-authored-by: RomneyDa <[email protected]>

* fix(update): bound migrated finalization and verify interrupted recovery

Co-authored-by: RomneyDa <[email protected]>

* fix(update): require authenticated RPC in interrupted recovery wait

Co-authored-by: RomneyDa <[email protected]>

* test(update): scope the migrated worker capability stub

Co-authored-by: RomneyDa <[email protected]>

* test(update): keep the worker timeout stub typed

Co-authored-by: RomneyDa <[email protected]>

* fix(update): keep migrated finalization unbounded without an operator deadline

A default worker deadline terminated finalization into a pending recovery that leaves the managed Gateway stopped. Restore the explicit/inherited-only deadline until timeout recovery can verify a serving Gateway.

Co-authored-by: RomneyDa <[email protected]>

* fix(update): recover timed-out and orphaned finalizers to a verified Gateway

A finalizer stopped at its deadline left a pending recovery that the managed
helper treated as an explicit refusal, and a killed waiting updater left its
candidate worker holding the run's child lease, so the helper lost its claim.
Both left the Gateway stopped until a manual update repair.

Route the finalizer deadline into the helper's existing interrupted recovery,
join a settling candidate worker within the recovery budget before reclaiming
the claim, and restore the default finalizer deadline (an explicit --timeout
still takes precedence). Recovery still requires an authenticated health RPC
with the expected version and build.

Refs #205547, #205675.

Co-authored-by: RomneyDa <[email protected]>

* fix(update): keep migrated finalization bounded only by an operator timeout

Restoring an implicit finalizer deadline added a failure path that a healthy but
slow update could hit (#153085 removed it for that reason), and its expiry is
reported as update-recovery-pending, which the helper does not route into
recovery. Drop it again: an explicit --timeout still bounds the worker, and its
update-activation-timeout result enters the verified interrupted recovery.

Refs #205547.

Co-authored-by: RomneyDa <[email protected]>

---------

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot added a commit that referenced this pull request Nov 29, 2026
… a verified Gateway (#205758)

* fix(update): admit migrated finalizer requester once

* fix(update): bound migrated finalization and verify interrupted recovery

* fix(update): require authenticated RPC in interrupted recovery wait

* test(update): scope the migrated worker capability stub

* test(update): keep the worker timeout stub typed

* fix(update): keep migrated finalization unbounded without an operator deadline

A default worker deadline terminated finalization into a pending recovery that leaves the managed Gateway stopped. Restore the explicit/inherited-only deadline until timeout recovery can verify a serving Gateway.

* fix(update): recover timed-out and orphaned finalizers to a verified Gateway

A finalizer stopped at its deadline left a pending recovery that the managed
helper treated as an explicit refusal, and a killed waiting updater left its
candidate worker holding the run's child lease, so the helper lost its claim.
Both left the Gateway stopped until a manual update repair.

Route the finalizer deadline into the helper's existing interrupted recovery,
join a settling candidate worker within the recovery budget before reclaiming
the claim, and restore the default finalizer deadline (an explicit --timeout
still takes precedence). Recovery still requires an authenticated health RPC
with the expected version and build.

Refs #205547, #205675.

* fix(update): keep migrated finalization bounded only by an operator timeout

Restoring an implicit finalizer deadline added a failure path that a healthy but
slow update could hit (#153085 removed it for that reason), and its expiry is
reported as update-recovery-pending, which the helper does not route into
recovery. Drop it again: an explicit --timeout still bounds the worker, and its
update-activation-timeout result enters the verified interrupted recovery.

Refs #205547.

---------

(cherry picked from commit cc7f256)

Release adaptation: Keep timeout classification with the existing interrupted-recovery admission in the result source; leave the handoff entry point at its baseline line count. Preserve authenticated readiness and the retained package-slot/installed-generation recovery.

Later same-path commits from the pinned scan (separate behavior unless named as folded/selected below): f927fb1 #203406 reports explicit package recovery; 8bc37be #205850 and `020832b252e8` #205669 handle migrated channel owner admission; 31ea1c0 #206530 handles namespace-less Linux locks (separately deferred because explicitly superseded in pinned main)..

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

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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