Repository navigation
fix(agents): keep healthy models working when a harness plugin fails to load - #137777
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 1:02 AM ET / 05:02 UTC. ClawSweeper reviewWhat this changesThe PR lets healthy model turns borrow an open prepared runtime generation when a different configured harness plugin has recorded a load failure, while retaining the failed harness’s repair diagnostic. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 2 items remain Keep this maintainer-labeled PR open: the introduced selection-specific admission check addresses the reported regression without a definite correctness or security defect, but its exact-head CI gate is not yet green. Priority: P1 Review scores
Verification
How this fits togetherPrepared model runtime generations load the provider and harness plugins required for an agent turn. Nested reply execution borrows the parent generation only when it owns the requested selection, then dispatches the chosen provider or emits a harness diagnostic. flowchart LR
A[Model turn request] --> B[Prepared runtime generation]
B --> C[Requested provider and harness]
C --> D{Recorded plugin state}
D -->|Healthy owner| E[Borrow parent generation]
D -->|Selected failed harness| F[Show repair diagnostic]
E --> G[Provider dispatch]
F --> H[No harness dispatch]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -1, Tests +48, Docs +2. Total +49 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the selection-specific containment repair and land it after the exact current head has a complete green CI rollup. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main retains the all-configured-harness containment check, and the supplied before/after Gateway trace exercises the resulting superseded-generation failure. Is this the best way to solve the issue? Yes: checking only the requested selection at borrowed-generation admission preserves the lifecycle owner boundary, while the existing harness availability owner continues to report the selected failed plugin. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3b710e4b75c9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
01c466f to
974ff03
Compare
Preserve recorded failed-plugin outcomes within the exact open parent generation. Validate only the requested selection so an unrelated configured harness cannot poison healthy provider turns. Keep executable availability and stale-lease rejection unchanged. Fixes #137748. Reported by Conan (conan6764) on Discord.
974ff03 to
f483edd
Compare
Consume the staged blob before returning empty output so git cat-file cannot receive SIGPIPE before the hook checks the formatter result. Preserve the existing diagnostic and index assertions. Observed in CI run 33840115492, job 100920714520. All 49 formatter-hook tests pass after the fixture repair.
|
The generation-admission repair is ready to land. The owner now checks the requested selection against the exact parent registry's recorded outcomes; a failed load no longer makes healthy models appear superseded. Selected failed harnesses retain their actionable diagnostic, and the existing lease, identity, release, and executable-availability fences remain unchanged. Validation: two new regressions fail before the fix with the reported error; 153 focused owner/registry tests pass on the unchanged runtime repair; all 49 formatter-hook tests pass after the bounded stdin-drain fixture repair. Commands: Crabbox run 33826909245 exercised real isolated Gateways built from separate baseline/candidate checkouts. Healthy turns changed from the superseded error to visible replies, including after selecting the broken harness and after doctor/restart. Repairing the payload and restarting restored its registration. The runtime owner source is unchanged on the final head. The PR body contains the transcript and inspected synthetic before/after screenshots; the lease is stopped. This proof uses a local HTTP Responses fixture, not an authenticated external model account, and the reporter's exact incompatible installed payload version remains unknown. CI 33841360276, attempt 2 is complete and green on exact head ClawSweeper's latest review has no code or security findings; its before-merge requests require the complete green exact-head CI result above. Production +13/-14 (net -1), tests +61/-8 (net +53), docs +2. No configuration, schema, protocol, or dependency changes. NO-FOLLOW-UP: the owner refactor already removes the duplicate policy; another abstraction would add no value. |
|
Merged via squash.
|
…to load (openclaw#137777) * fix(agents): isolate failed plugins during generation admission Preserve recorded failed-plugin outcomes within the exact open parent generation. Validate only the requested selection so an unrelated configured harness cannot poison healthy provider turns. Keep executable availability and stale-lease rejection unchanged. Fixes openclaw#137748. Reported by Conan (conan6764) on Discord. * test: drain stdin in empty formatter fixture Consume the staged blob before returning empty output so git cat-file cannot receive SIGPIPE before the hook checks the formatter result. Preserve the existing diagnostic and index assertions. Observed in CI run 33840115492, job 100920714520. All 49 formatter-hook tests pass after the fixture repair.
Closes #137748
What Problem This Solves
Fixes an issue where model turns fail with "prepared model runtime plugin generation was superseded" when another configured harness plugin cannot load. Conan (
conan6764) reported this after upgrading to 2026.9.1: an incompatible installed Codex payload failed on a missing SDK export, and both OpenAI and MiniMax turns then failed, including the OpenClaw harness. Original report.Why This Change Was Made
Nested admission confused executable plugin availability with ownership of the still-open parent generation. It also rebuilt the requirement set from every configured harness, so a failed unrelated plugin rejected healthy selections. The owner check now examines the requested selection and recognizes a recorded failed load as an owned, unavailable outcome. The existing runtime availability check still reports the plugin's repair diagnostic; missing, disabled, deferred, copied, and released owners remain fenced.
This removes redundant configured-harness expansion and loaded-base validation. It does not reset a generation, retry a turn, restore the retired SDK export, or introduce persistent state. The check was introduced in #132804 (
bee48f7f56808eff2f7aaa035509b8a39b3988e2) and is present in the 2026.9.1 tag. The reporter's precise incompatible installed plugin version remains unknown.User Impact
Healthy providers can complete turns while another plugin is unavailable. Selecting the failed harness produces its actionable inspect/repair/restart error. Supported installation repairs still belong to doctor, and repaired plugin payloads become visible after a Gateway restart. The plugin architecture guide now explains this behavior.
Evidence
CI 33841360276, attempt 2 is complete and green on exact head
f8d63102676e578681b0f3b93e4c0d44c0f5041bafter rerunning the inherited scanner timing failure. The audit job explicitly reported incomplete coverage after three npm timeouts; no hosted advisory clearance was obtained. Main's shared outage policy fix(ci): warn when npm advisory service is unavailable #137881 permits that warning in ordinary CI; this PR changes no audit policy. The unchanged full local audit completed at 04:45 UTC; subsequent npm requests timed out. The runtime repair and Crabbox-tested owner source hash are unchanged.CI rerun context: job 100924347615 failed the inherited scanner OOM diagnostic assertion: RSS measurement failed before signal classification. The scanner and test match the previous passing PR head and green main run 33841381813. The failed-job rerun passed without code changes. This is a named follow-up for scanner RSS/child-exit timing if it recurs; this PR preserves the fail-closed scanner behavior and assertion.
Bounded CI cleanup: job 100920714520 exposed a flaky inherited empty-formatter fixture from fix(git-hooks): keep unstaged bytes out of pre-commit formatting #137723. Its stub exited without reading stdin, allowing
git cat-fileto receive SIGPIPE (exit 141) before the expected empty-output check. The fixture now drains stdin before returning empty output. Its diagnostic, staged-content, and no-commit assertions are unchanged; production hook behavior is unchanged. All 49 formatter-hook tests pass withnode scripts/run-vitest.mjs test/git-hooks-pre-commit.test.ts;node scripts/check-changed.mjs -- test/git-hooks-pre-commit.test.tsalso passes.Failing-before regression:
node scripts/run-vitest.mjs src/agents/prepared-model-runtime.reply-fallback.test.ts— two new cases fail on unchanged production code with the reported superseded error (six existing cases pass).Focused owner and sibling proof for the unchanged runtime repair:
node scripts/run-vitest.mjs src/agents/prepared-model-runtime.reply-fallback.test.ts src/agents/prepared-model-runtime.inbound-registry.test.ts src/agents/prepared-model-runtime.owner-selection.test.ts src/plugins/active-runtime-registry.test.ts src/plugins/registry.provider-like.test.ts src/plugins/registry.diagnostics.test.ts— 153 tests pass, including still-open parent borrowing, released/copied/missing owners, disabled/deferred availability, fallback restrictions, healthy unrelated selection, selected failed-harness diagnostics, and registration rollback.node scripts/check-changed.mjs: passed all selected formatting, typecheck, lint, dependency, schema, and runtime-cycle gates.pnpm build: passed, including native plugin control-plane loads, public SDK exports, and the Control UI build.Crabbox live comparison passed on Blacksmith Testbox run 33826909245, lease
tbx_01m1n1dn6j7ra2360fhk4hk500. Separate fresh source checkouts built baseline3c0eb9fd822f8101dc3117ce40dbd2b0f5e01930and exact candidate01c466fe24051757dd0117621aee6a569f35b9da; the candidate owner source SHA256 matched the local source. Each ran a real Gateway with isolated temporary state/workspace, a free loopback port, a synthetic harness throwing a missing-export error, and a local HTTP Responses provider. The real CLI flow usedsessions.create,sessions.patch,chat.send,agent.wait, andchat.history. This exercises Gateway/provider HTTP integration; it does not authenticate to an external model service.Healthy replies were verified from
agent.waitterminal status andterminalReply.text=UNRELATED_PROVIDER_HEALTHY, not session titles. The unavailable harness keepsreason=owner-plugin-degradedand the existing inspect/repair/restart diagnostic. Local real Gateway iteration produced the same candidate result. The initial remote setup attempt lacked the shallow baseline object; the completed comparison fetched both exact commits into separate checkouts.Before (real baseline Control UI):
After (real candidate Control UI, failed harness still present):
Both full screenshots were inspected and contain only synthetic task data. The Testbox lease was stopped and independently verified completed after collecting the evidence.
Independent local and committed-branch reviews found no actionable P0–P2 findings. ClawSweeper’s latest review (05:02 UTC) reports no correctness/security findings. Its before-merge requests require the complete exact-head CI rollup to be green; that gate is now satisfied by the green final-head run.
git diff --numstatfor the final four-file change:Production: +13/-14, net -1. Tests: +61/-8, net +53. Docs: +2/-0.
Direct dependency inspection: Codex
codex-rs/app-server/src/request_processors/initialize_processor.rs:44-156keeps initialization connection-scoped; this failure occurs in OpenClaw before app-server/provider dispatch. The shared plugin loader already records failed phase/error outcomes insrc/plugins/loader-records.ts; the fix consumes that existing fact.Related scope: #133692 is a separate cron publication race; #126108 is a catalog-worker reconstruction mismatch. Neither is closed by this repair.
NO-FOLLOW-UP: this repair already removes the duplicate availability policy from generation borrowing; another abstraction would add indirection without simplifying ownership.