Skip to content

fix(update): block restart when plugin readiness fails - #134699

Merged
Patrick-Erichsen merged 1 commit into
mainfrom
codex/fix-134204-llama-cpp-migration
Sep 1, 2026
Merged

Patrick-Erichsen merged 1 commit into
mainfrom
codex/fix-134204-llama-cpp-migration

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add an internal, owner-declared post-plugin readiness phase to Doctor health checks
  • run that phase in the updated CLI after plugin convergence and before Gateway restart
  • enroll Memory Core's managed local embedding check and return its interactive llama.cpp remediation without changing config or downloading a model

Fixes #134204.

Root cause and repair

The managed local embedding check already owned the exact readiness decision, but update finalization only ran fresh Doctor repair and strict config validation. A retained memory.search.provider: "local" configuration could therefore pass update finalization even when the upgraded llama.cpp provider had no managed service/model setup.

The updater now asks the updated process to run only health checks whose owner declares updateReadiness: "post-plugin". The selection contract remains internal (no public Plugin SDK or CLI surface), the updater names no plugin or check ID, and every readiness run uses an isolated plugin-state snapshot. Structured findings become blocking post-update plugin results; malformed output, execution failure, or zero declared checks fail closed. Existing fresh-resume, current-process, and repair lanes all stop before restart.

No compatibility path, config key, schema, migration, model download, or automatic provider setup was added. The issue's non-mutating stop-with-action boundary was approved in #134204 (comment).

TDD and validation

RED was captured before implementation across four independent boundaries: phase selection ran unrelated checks, Memory Core did not declare update readiness, update finalization never invoked readiness, and a readiness finding did not block restart or carry remediation.

GREEN:

  • affected Doctor/Memory/update suites: 452 passed
  • legacy updater orchestration suite: 317 passed
  • process-level update lifecycle suite: 26 passed, including readiness finding and execution failure across fresh-resume, current-process, and repair lanes
  • pnpm check:changed
  • pnpm build
  • npm tarball integrity check with the llama.cpp plugin bundled

Packaged Linux proof used retained local-memory config plus an existing semantic index and missing managed llama.cpp setup. The updated CLI ran exactly one declared check, exited 1, and returned:

Run openclaw models --agent main auth login --provider llama-cpp --method local in an interactive terminal, then rerun this check.

The config and semantic-index SHA-256 hashes were unchanged before/after, and no model was downloaded.

Scope audit

  • architectural owner: Memory Core declares the readiness requirement; Doctor owns isolated health execution; update finalization owns restart admission
  • caller/callee: fresh post-core resume/current-process/repair -> completePostCorePluginUpdate -> updated doctor --lint -> Memory Core -> llama.cpp provider policy inspection
  • siblings: all three update execution lanes and both structured-finding/execution-failure paths covered
  • removed/avoided paths: no core llama.cpp/check-ID special case; no broad doctor --lint --all; no public flag or SDK contract; no automatic setup fallback
  • production: +224/-10 (net +214)
  • tests/test support: +360/-15 (net +345)
  • docs: +4/-0

Positive production LOC implements the generic cross-process readiness protocol, strict child-result validation, fail-closed update result mapping, and isolated owner selection; there was no existing post-plugin readiness transport to absorb this into without hardcoding Memory Core policy in the updater.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: memory-core Extension: memory-core cli CLI command changes commands Command implementations size: L maintainer Maintainer-authored PR labels Sep 1, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. 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 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 11:41 PM ET / September 1, 2026, 03:41 UTC.

ClawSweeper review

What this changes

The PR adds an internal, plugin-declared Doctor readiness phase that blocks Gateway restart after an update when managed local embeddings are not ready.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

No introduced correctness defect was found, but the intentionally fail-closed update behavior needs explicit maintainer acceptance before merge because it can leave an update-stopped Gateway down pending interactive remediation.

Priority: P1
Reviewed head: e6937fba1458987f14c43182308c95a1555d012a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The implementation is coherent and has focused source-level coverage; merge readiness depends on the explicit availability-policy decision.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository state identifies this as maintainer-authored, so the external-contributor proof gate does not apply; the PR body additionally describes a packaged Linux after-fix run, but no artifact was needed for this classification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository state identifies this as maintainer-authored, so the external-contributor proof gate does not apply; the PR body additionally describes a packaged Linux after-fix run, but no artifact was needed for this classification.
Evidence reviewed 6 items Restart admission: The completion path invokes readiness after fresh Doctor/config validation or directly when no fresh pass is needed; the post-update caller exits before restart for this new error class.
Owner-bound selection and isolation: Doctor derives the post-plugin phase from the update environment, selects only tagged checks, and routes that selection through isolated plugin state; Memory Core owns the sole current tag.
Failure-path coverage: The lifecycle suite covers both a readiness finding and execution failure across resume, current-process, and repair lanes, asserting that restart is not called.
Findings None None.
Security None None.

How this fits together

The update command converges installed plugins and validates the updated installation before restarting the Gateway. This change makes an owner-declared readiness result an additional restart-admission decision.

flowchart LR
A[Update command] --> B[Plugin convergence]
B --> C[Updated Doctor]
C --> D[Plugin readiness checks]
D --> E{Readiness passes?}
E -->|Yes| F[Restart Gateway]
E -->|No| G[Return remediation and keep Gateway stopped]
Loading

Decision needed

Question Recommendation
Should a managed Gateway remain stopped after update when post-plugin readiness requires interactive local-embedding remediation? Approve the fail-closed gate: Accept the documented stopped-Gateway outcome so operators receive remediation before an unusable configured memory path can resume.

Why: The code correctly implements the proposed safety boundary, but choosing a temporary service outage over restarting with unavailable semantic memory is an operator-facing availability policy.

Before merge

  • Resolve merge risk (P1) - Merging changes existing managed-update behavior: a readiness finding or unreadable readiness result now leaves a previously stopped Gateway unavailable until the operator completes remediation.
  • Complete next step (P2) - No mechanical repair remains; the unresolved action is an explicit maintainer choice on the stopped-Gateway upgrade policy.
Agent review details

Security

None.

PR surface

Source +214, Tests +345, Docs +4. Total +563 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 8 224 10 +214
Tests 9 360 15 +345
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 588 25 +563

Review metrics

Metric Value Why it matters
Production versus test delta production +214 net, tests/test support +345 net, docs +4 The new generic cross-process readiness protocol is substantial for a bug fix, though its owner-bound selection and failure paths are covered by focused tests.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/cli/update-cli/update-command-fresh-doctor.ts, migration/backfill/repair: src/cli/update-cli/update-command-post-plugin-readiness.ts, migration/backfill/repair: src/commands/doctor-lint.ts, migration/backfill/repair: src/flows/doctor-lint-flow.ts, serialized state: src/cli/update-cli/update-command-post-plugin-readiness.ts, unknown-data-model-change: src/cli/update-cli/update-command-post-plugin-readiness.ts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Confirm the stopped-service policy (recommended)
    Merge after the responsible owner explicitly accepts the documented behavior for upgrades whose readiness check needs interactive remediation.
  2. Preserve automatic restart
    Revise the design to report readiness remediation without withholding restart if service availability is the preferred upgrade contract.

Technical review

Best possible solution:

Keep the generic owner-declared gate and land it only after the responsible maintainer explicitly accepts the documented stopped-service behavior for affected upgrades.

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

Yes. The linked report supplies a concrete 2026.7.1-to-2026.8.1 upgrade scenario, and the reviewed pre-change completion path had no post-plugin readiness admission step.

Is this the best way to solve the issue?

Unclear. The technical design correctly keeps provider-specific readiness in Memory Core and the generic admission path in core, but maintainers must choose the service-availability tradeoff before it is the best product solution.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 09a71580645f.

Labels

Label justifications:

  • P1: This affects managed upgrades and can either leave configured semantic memory unusable or intentionally keep the Gateway stopped.
  • merge-risk: 🚨 compatibility: Existing managed-update expectations change from restarting after convergence to blocking restart on a newly selected readiness result.
  • merge-risk: 🚨 availability: A readiness failure can keep a managed Gateway down until an operator performs the remediation.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository state identifies this as maintainer-authored, so the external-contributor proof gate does not apply; the PR body additionally describes a packaged Linux after-fix run, but no artifact was needed for this classification.

Evidence

What I checked:

  • Restart admission: The completion path invokes readiness after fresh Doctor/config validation or directly when no fresh pass is needed; the post-update caller exits before restart for this new error class. (src/cli/update-cli/update-command-fresh-doctor.ts:248, e6937fba1458)
  • Owner-bound selection and isolation: Doctor derives the post-plugin phase from the update environment, selects only tagged checks, and routes that selection through isolated plugin state; Memory Core owns the sole current tag. (src/commands/doctor-lint.ts:115, e6937fba1458)
  • Failure-path coverage: The lifecycle suite covers both a readiness finding and execution failure across resume, current-process, and repair lanes, asserting that restart is not called. (src/cli/update-cli/update-command-lease.test.ts:427, e6937fba1458)
  • Operator-visible contract: The documentation states that a readiness error retains the stopped Gateway and returns remediation without interactive setup, downloads, or config changes. Public docs: docs/cli/update.md. (docs/cli/update.md:283, e6937fba1458)
  • Feature-history routing: The current Doctor lint owner was introduced in the merged commit that created its implementation; raw commit metadata identifies its recorded parent for host verification. (src/commands/doctor-lint.ts:114, b99512eefe5a)
  • Current-main limitation: The supplied state identifies an open, distinct PR head; direct retrieval of the supplied current-main object and live discussion failed because the local promisor remote could not resolve DNS. No current-main implementation claim is made.

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record explicit owner confirmation that a failed readiness check may retain an update-stopped Gateway.

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-09-01T03:08:43.054Z sha 310d10f :: needs maintainer review before merge. :: none

@Patrick-Erichsen
Patrick-Erichsen force-pushed the codex/fix-134204-llama-cpp-migration branch from 310d10f to e6937fb Compare September 1, 2026 03:32
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

Maintainer decision: accept the fail-closed availability policy implemented here. When an owner-declared post-plugin readiness check requires interactive remediation, update finalization must leave the Gateway stopped and return that remediation instead of restarting with an unavailable configured memory path. This resolves the ClawSweeper Decision needed, merge-risk item, and Rank-up move. Original decision: #134204 (comment)

@Patrick-Erichsen
Patrick-Erichsen merged commit 2bfa68d into main Sep 1, 2026
259 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the codex/fix-134204-llama-cpp-migration branch September 1, 2026 04:04
@Patrick-Erichsen

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

cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: memory-core Extension: memory-core maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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]: 8.1 llama.cpp upgrade leaves configured local memory without managed embedding setup

1 participant