Skip to content

fix: repair legacy config on identical-package updates - #165242

Merged
shakkernerd merged 1 commit into
mainfrom
fix/upgrade-survivor
Oct 5, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/upgrade-survivor

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #165229.

What Problem This Solves

An update from the identical package tarball can reject supported legacy configuration after candidate admission has already accepted it as Doctor-repairable. The package updater recognizes the same version and build identity, skips candidate rehearsal, and enters already-current finalization. That branch loses the accepted config check and only prepares a legacy repair when --channel was supplied, so the ordinary update fails on fields such as agents.list.

User Impact

The same-artifact update now completes the existing Doctor config repair and continues plugin maintenance without replacing unchanged package bytes or requiring a channel change. This repair is available once the updater containing this change is installed. Valid configuration keeps ordinary no-op behavior, and unrepairable configuration remains refused. Repairs affecting only an included config file report completed maintenance accurately.

Why This Change Was Made

Already-current finalization now preserves the candidate's config admission and obtains a fresh, source-bound plan from the existing Doctor owner when rehearsal was skipped. The repair uses the existing plugin lease and config writer, with the original update authority retained through lock waits and publication. Root and included-file identities, environment references, and the existing schema and service checks remain in force.

This keeps the identical-build optimization and corrects its missing maintenance step. It introduces no new configuration option, dependency, migration format, or package-replacement rule. The repair message also describes updates that do not change channels.

Evidence

The recorded upgrade-survivor failure accepted legacy config, then failed with invalid-config on agents.list. The unchanged Docker scenario reached the corrected real CLI path with isolated synthetic state: update returned status: ok, before/after build identities were equal, plugin maintenance completed, and subsequent config validation, HTTP health/readiness, and Gateway RPC status succeeded.

Focused Linux validation passed on the candidate:

  • Changed-file formatting/lint, the core production compiler graph, and the update-CLI test compiler graph.
  • 95 existing tests in update-command-noop.test.ts, update-command-execution.test.ts, and update-command-config-fence.test.ts, including concurrent source changes and revoked root/include write authority.
  • Three existing controls for an unchanged identical package and non-mutating refusal of invalid or retired config.
  • The production npm bulk audit at high severity and the trusted-base private-key scan. The dependency audit does not cover every upstream advisory source.

Both maintained Docker cells passed in full with exit 0 on the verified candidate tree:

  • Identical-package update: configuration and state survived, Gateway startup took 26 seconds, and the RPC status check took 1 second.
  • Published-driver upgrade: the npm [email protected] updater installed the 2026.9.8 candidate. Automatic migration and preservation assertions passed before standalone Doctor, unavailable plugin-path configuration remained intact, and subsequent Gateway startup, HTTP probes, and RPC status passed (startup 20 seconds; each probe/status check 1 second).

The source tree was verified before and after each run. Hosted CI and applicable security checks passed on the PR head.

@clawsweeper

clawsweeper Bot commented Oct 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 cli CLI command changes size: XS labels Oct 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 9:47 PM ET / October 5, 2026, 01:47 UTC (Revision 2).

ClawSweeper review

What this changes

The updater completes supported legacy configuration repairs when the requested package is already installed and reports repairs to included files as completed maintenance.

Merge readiness

✅ Ready for maintainer review

This remains a necessary, focused fix. The updated upgrade evidence resolves the prior review’s blocker, and no introduced correctness or security defect was found.

Priority: P2
Reviewed head: 5f40032092e41a4f11d059a05c7eb591cc0935a5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant runtime and upgrade evidence, existing writer controls, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body reports the real Docker CLI exercising the changed already-current finalizer with legacy state, equal build identities, successful repair, and subsequent readiness/RPC checks. Its added published-2026.9.7-to-candidate cell verifies automatic migration and state preservation before standalone Doctor, resolving the prior upgrade gap. Existing migration formats and guarded publication remain intact.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body reports the real Docker CLI exercising the changed already-current finalizer with legacy state, equal build identities, successful repair, and subsequent readiness/RPC checks. Its added published-2026.9.7-to-candidate cell verifies automatic migration and state preservation before standalone Doctor, resolving the prior upgrade gap. Existing migration formats and guarded publication remain intact.
Evidence reviewed 10 items Verified introduced changes: The pinned introduction diff adds candidate config admission propagation, fresh Doctor planning, executor-guarded repair, and include-only maintenance reporting.
Still necessary on current main: Fetched main still omits candidate admission checks from already-current inspection and restricts legacy repair to explicit channel requests.
Latest release retains the affected path: The v2026.9.8 source also conditions prepared legacy repair on an explicit channel request; this PR is not an already-shipped fix.
Findings None None.
Security None None.

How this fits together

The update CLI admits the selected package and operator configuration before performing maintenance. An unchanged package still needs eligible Doctor repairs before plugin and service finalization.

flowchart TD
 A[Update request] --> B[Package and config admission]
 B --> C{Package already installed?}
 C -->|Yes| D[Doctor repair plan]
 D --> E[Guarded config writer]
 E --> F[Plugin and service maintenance]
 C -->|No| G[Package replacement]
 G --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +22. Total +22 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 2 33 11 +22
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 33 11 +22

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #165229
Summary: This PR directly addresses the identical-package legacy-config failure recorded by the paired issue.

Members:

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

Technical review

Best possible solution:

Keep Doctor as the migration owner and complete supported repairs through the guarded writer while preserving the unchanged-package optimization.

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

Yes, source establishes the failing path: identical package identity skips rehearsal, then current main loses config admission and refuses repairable legacy configuration without a channel request. The paired issue records the Docker failure; this review did not execute it.

Is this the best way to solve the issue?

Yes, the patch fills the missing finalization step through existing Doctor and config-write owners, preserving source identity and live authority checks.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This fixes a bounded update failure involving identical packages and supported legacy configuration.
  • 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 (live_output): The captured body reports the real Docker CLI exercising the changed already-current finalizer with legacy state, equal build identities, successful repair, and subsequent readiness/RPC checks. Its added published-2026.9.7-to-candidate cell verifies automatic migration and state preservation before standalone Doctor, resolving the prior upgrade gap. Existing migration formats and guarded publication remain intact.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body reports the real Docker CLI exercising the changed already-current finalizer with legacy state, equal build identities, successful repair, and subsequent readiness/RPC checks. Its added published-2026.9.7-to-candidate cell verifies automatic migration and state preservation before standalone Doctor, resolving the prior upgrade gap. Existing migration formats and guarded publication remain intact.

Evidence

What I checked:

  • Verified introduced changes: The pinned introduction diff adds candidate config admission propagation, fresh Doctor planning, executor-guarded repair, and include-only maintenance reporting. (src/cli/update-cli/update-command-noop.ts:199, 5f40032092e4)
  • Still necessary on current main: Fetched main still omits candidate admission checks from already-current inspection and restricts legacy repair to explicit channel requests. (src/cli/update-cli/update-command-noop.ts:199, eded1a387b79)
  • Latest release retains the affected path: The v2026.9.8 source also conditions prepared legacy repair on an explicit channel request; this PR is not an already-shipped fix. (src/cli/update-cli/update-command-noop.ts, fc23bc864e45)
  • Verified three-way merge: The raw test-merge record has the pinned base followed by the exact PR head as parents. Its delta against that base contains the same two-file repair. (1896ee36d27a)
  • Source-bound repair and final-write safeguards: Doctor retains root hashes, include hashes and targets, environment references, and the expected config path. The new lock carries the original executor guard into the existing root/include writers, which recheck authority before publication. (src/commands/doctor/legacy-config-repair.ts:105, 5f40032092e4)
  • Allowed and revoked writer controls: Existing production-writer tests cover root and included-file publication with live and revoked executors, including revocation during synchronization. Rejected writes preserve configuration and retained backups. These tests were inspected, not executed during this review. (src/cli/update-cli/update-command-config-fence.test.ts:559, 5f40032092e4)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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-10-05T01:28:41.035Z sha 5f40032 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 5, 2026
@shakkernerd shakkernerd self-assigned this Oct 5, 2026
@shakkernerd
shakkernerd merged commit 1bef972 into main Oct 5, 2026
142 checks passed
@shakkernerd
shakkernerd deleted the fix/upgrade-survivor branch October 5, 2026 01:49
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: identical-package updates complete supported legacy configuration repairs without replacing the package.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
Complete supported legacy configuration repairs when an update reuses the installed package.

Fixes openclaw#165229.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes 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: XS 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.

[Bug]: identical-package update rejects admitted legacy config

1 participant