Skip to content

fix(update): finish failed recovery startup records - #208794

Merged
vincentkoc merged 1 commit into
mainfrom
fix/update-recovery-row-finalization-20261130
Nov 30, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/update-recovery-row-finalization-20261130

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Early-release recovery creates an update-history row before acquiring the preparation lock. If acquisition fails, or recording an interrupted predecessor fails, that new row stays marked running even though recovery has stopped.

User Impact

Update status records the failed recovery instead of showing a phantom active update. The original failure remains visible; a secondary recording failure still releases acquired custody and preserves both errors. No configuration or database migration is required.

Why This Change Was Made

One failure boundary in the recovery-record owner covers acquisition and predecessor bookkeeping. It finishes the known new row before releasing its acquired lock. The existing cleanup helper retains failures from recording and release. Successful handoff and competing-update handling are unchanged.

Production +23/-6 (net +17) closes this ownership boundary. Tests +82/-15 observe durable rows and the status at release, cover both hold and unheld-outcome callers, and exercise a real filesystem acquisition error.

Evidence

  • Four regression cases fail against the prior owner: premature release, lost secondary error, and both callers leaving active rows after a real acquisition failure. The repaired recovery suite passed 76/76 twice, including the final equivalent error-handling refinement.
  • Independent P0–P3 review of the two-file repair was clean. A separate reader verified the refinement preserves error order, cause and cleanup.
  • This head is a patch-identical rebase onto merged fix(update): preserve preparation lock ownership #207139 at 743f83aa4c226d5489a26fa5e6fb979aa8c09bd6. The owner, its tests and the shared error helper did not change in the base.
  • At exact head 530d8d9a24f3a3b632af48e0452a2258b25c03b4: all four focused regression cases, formatting, targeted lint and affected test types pass after a frozen dependency refresh. The pre-rebase full build passed in 281.7 seconds.
  • The current-head full build fails the SDK declaration size check: 5,386,239 bytes versus the 5,385,536-byte limit. A paired canonical full-graph declaration check on the complete base tree and restored candidate produced exactly the same 5,386,239 bytes; the candidate reused the fresh base generation. The budget is unchanged. UI size overages are reported by the build's existing report-only path.
  • Normal CI finished: 26 passed, 28 skipped, two unrelated failed jobs plus their aggregate. The unchanged channel-settings test mock omits export preservation; main's wrapper inventory omits a provider-rejection module already imported on main. Actual tested merge f77d81e9a1aaf4814ad8d5e4c4a2de04db79b710 has main baseline fe3677b383f93b6401c08706815fede8e0705a7c and this head as parents. The failure inputs are identical between baseline and merge. The report's name-level comparison calls them new without comparing selected scope; direct source/causal inspection establishes they pre-exist this repair. Landing uses the native attributed-failure exception; failed CI is not described as green.
  • Published-driver qualification passed for exact 530d8d9a: ordinary 2026.11.12 installation finished with /readyz 200 and the running version verified; PostgreSQL 2026.11.5 migrated state 36→42 and agent 38→45 while preserving Gateway history; native systemd 2026.10.9 updated successfully. Candidate package checksum matched. The manual workflow's remaining failure is the same unrelated mock ratchet plus its aggregate.
  • Fresh exact-head review passed with no findings or remaining before-merge actions.

Later failures inside final outcome recording and abrupt-parent-death settlement remain separate follow-ups.

@clawsweeper

clawsweeper Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Pull request received.

ClawSweeper review complete

ClawSweeper finished reviewing this revision.

View the workflow run.

@vincentkoc vincentkoc self-assigned this Nov 30, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 30, 2026
@vincentkoc
vincentkoc force-pushed the fix/update-recovery-row-finalization-20261130 branch 2 times, most recently from 1191a9d to 16b50c1 Compare November 30, 2026 04:43
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 30, 2026
@clawsweeper

clawsweeper Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

The PR records failed recovery startup attempts before releasing acquired update custody and preserves secondary cleanup errors.

Example: Recovery creates an update-history row, then lock acquisition fails with EEXIST because the releases path is a file.

  • Before: The recovery stops while its new history row remains running.
  • After: The row becomes failed with reason early-release-recovery-error, and the original EEXIST error propagates.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct repair with meaningful owner-level regression coverage and limited direct runtime evidence.
Proof confidence 🦐 gold shrimp (3/6) The inspected regressions exercise the production record owner with real filesystem and database operations plus injected recording failures; the reported passes support the repair, while ongoing published-driver qualification does not demonstrate this failure path and the maintainer proof exemption requires no additional contributor capture.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Update status can show a recovery as running after its startup has already failed.
Reason: The maintainer-authored repair restores accurate update history within the existing ownership boundary without adding configuration or changing public contracts.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current recovery-startup bookkeeping defect in the existing owner; no introduced correctness or security defect was found.

Reviewed head: 530d8d9a24f3a3b632af48e0452a2258b25c03b4

Before merge

None.

Findings

None.

Agent review details

How this fits together

The early-release recovery runner uses the recovery-record owner to create update-history rows, acquire preparation custody, and publish outcomes consumed by update status.

flowchart TD
  A[Early release recovery] --> B[Recovery record owner]
  B --> C[Preparation lock store]
  B --> D[Update run writer]
  D --> E[Update history database]
  E --> F[Update status]
Loading

Technical review

Best possible solution:

Keep startup settlement in openHeldRun, finish its newly created row before releasing acquired custody, and retain all cleanup failures.

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

Current-main source establishes both stranded-row paths, and the PR reports four regressions failing before the repair and passing afterward; this read-only review ran no target code.

Is this the best way to solve the issue?

The patch repairs the producer through the existing shared owner and cleanup helper, covers both callers, and preserves successful handoff and competing-update behavior.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Early-release recovery history keeps the original intent (f79ef8c: Restore automatic recovery for stranded early Git updaters and expose recovery outcomes through update status.)
  • Preparation custody and predecessor settlement keeps the original intent (743f83a: Retain acquisition-bound custody through joined recovery work and preserve successor locks during cleanup.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Jason (Json): Raw commit f79ef8c adds src/infra/update-early-release-recovery-record.ts:109 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f79ef8c18b9c; files: src/infra/update-early-release-recovery-record.ts)
  • Vincent Koc: Raw commit 743f83a adds src/infra/update-early-release-recovery-record.ts:122 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 743f83aa4c22; files: src/infra/update-early-release-recovery-record.ts)

PR surface

Source +17, Tests +67. Total +84 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 23 6 +17
Tests 1 82 15 +67
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 105 21 +84

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall readiness starts with the lower of the proof and patch scores. It is capped at 3/6 if the fix is partial, the change offers little benefit, a product decision is still open, or the PR reverses an earlier decision without saying why. ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-30T04:58:06.171Z sha 16b50c1 :: passed. :: none

Reviewed November 30, 2026, 12:48 AM ET / 05:48 UTC (Revision 2).

Base automatically changed from fix/update-prepare-lock-ownership-20261128 to main November 30, 2026 05:15
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: L and removed size: S labels Nov 30, 2026
@vincentkoc
vincentkoc force-pushed the fix/update-recovery-row-finalization-20261130 branch from 16b50c1 to 530d8d9 Compare November 30, 2026 05:21
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed docs Improvements or additions to documentation gateway Gateway runtime size: L labels Nov 30, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 30, 2026 05:24
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 530d8d9a24f3a3b632af48e0452a2258b25c03b4. This is the patch-identical rebase of the reviewed recovery-row repair onto merged #207139. The PR body records current-head focused proof, the paired baseline SDK budget failure, and the separately attributed CI failures.

@clawsweeper

clawsweeper Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@vincentkoc
vincentkoc merged commit 126c1c2 into main Nov 30, 2026
262 of 268 checks passed
@vincentkoc
vincentkoc deleted the fix/update-recovery-row-finalization-20261130 branch November 30, 2026 06:19
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

vincentkoc added a commit that referenced this pull request Nov 30, 2026
* commit 'c5c1dc278a6f789d739d70afe192c4d1e37058f5':
  fix(ci): include provider rejection text in PR tooling (#208891)
  feat: let plugins bring their own sidebar icon (#208885)
  docs: clarify node pairing and credentials on PostgreSQL gateways (#208850)
  fix(ui): show a confirmed subagent stop once in chat (#208533)
  fix(ui): keep collapsed work close to the reply in long chats (#207843)
  fix(update): finish failed recovery startup records (#208794)
  chore(ci): inventory media worker lifecycles (#208888)
  fix: use the same clock icon for Automations (#208539)
  improve(ci): reduce compiler round trips in database checks (#208878)
  fix(ci): preserve complete adaptive test observations (#208874)
  test(gateway): isolate usage context database fixtures (#208304)
  fix: avoid false worker cleanup failures (#208861)
  fix: let Git upgrade acceptance fetch its missing baseline (#208746)
  fix: isolate scheduled Processes reads in the Control UI config-change test (#208205)
  fix: make plugin hash worker tests independent of runner memory (#208860)
  fix(update): preserve serving state during candidate plugin maintenance (#208776)
  test(ui): preserve exact session keys in older chat links (#208873)
  docs(cli): say what bounds a yielded agent turn's subagent wait without --timeout (#208858)
vincentkoc added a commit that referenced this pull request Nov 30, 2026
* fix: restore managed worktrees from bare primary repositories

Managed worktrees created from a linked checkout record its primary repository. Resolve that registration during inspection, removal, and snapshot restore while keeping new checkout creation strict.

* Merge verified upstream CI repairs into managed worktree recovery

* commit 'c5c1dc278a6f789d739d70afe192c4d1e37058f5': (64 commits)
  fix(ci): include provider rejection text in PR tooling (#208891)
  feat: let plugins bring their own sidebar icon (#208885)
  docs: clarify node pairing and credentials on PostgreSQL gateways (#208850)
  fix(ui): show a confirmed subagent stop once in chat (#208533)
  fix(ui): keep collapsed work close to the reply in long chats (#207843)
  fix(update): finish failed recovery startup records (#208794)
  chore(ci): inventory media worker lifecycles (#208888)
  fix: use the same clock icon for Automations (#208539)
  improve(ci): reduce compiler round trips in database checks (#208878)
  fix(ci): preserve complete adaptive test observations (#208874)
  test(gateway): isolate usage context database fixtures (#208304)
  fix: avoid false worker cleanup failures (#208861)
  fix: let Git upgrade acceptance fetch its missing baseline (#208746)
  fix: isolate scheduled Processes reads in the Control UI config-change test (#208205)
  fix: make plugin hash worker tests independent of runner memory (#208860)
  fix(update): preserve serving state during candidate plugin maintenance (#208776)
  test(ui): preserve exact session keys in older chat links (#208873)
  docs(cli): say what bounds a yielded agent turn's subagent wait without --timeout (#208858)
  test(ui): keep real exports in the channel settings distribution mock (#208855)
  test(normalization): preserve inline code in quoted previews (#208857)
  ...

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

Labels

impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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