Repository navigation
fix(agents): show recovery when a model harness is unavailable - #134468
fuller-stack-dev wants to merge 48 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed September 1, 2026, 6:18 AM ET / 10:18 UTC. ClawSweeper reviewWhat this changesThe branch adds owner-specific recovery guidance when a selected model harness cannot register, and routes direct-host and provider-usage lookups through registries that retain those diagnostic facts. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessThe PR’s diagnostic repair is useful, but its new provider-usage fallback loses the active Gateway registry’s loaded plugin scope whenever it supplies a harness selection. Fix that regression before merge. Priority: P1 Review scores
Verification
How this fits togetherAgent turns and model-usage checks resolve a selected harness from a request-scoped plugin registry. The final guard either starts the harness or reports why its owning plugin could not be activated. flowchart LR
A[Model or usage request] --> B[Gateway plugin registry]
B --> C[Selected harness scope]
C --> D[Harness registration guard]
D -->|Available| E[Agent turn or usage result]
D -->|Unavailable| F[Owner-state diagnosis]
F --> G[Recovery guidance]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +107, Tests +380. Total +487 across 6 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the new diagnostic context, but build selected provider-usage registries from the active Gateway registry’s loaded IDs plus the selected harness owners, with regression coverage for that composed scope. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: invoke the cold provider-usage fallback inside a Gateway registry with loaded plugin records and a harness selection; the introduced call forces an empty base scope. This read-only review did not execute the scenario. Is this the best way to solve the issue? No. Carrying diagnostics to the final guard is the right ownership boundary, but the new caller must preserve the Gateway’s loaded runtime IDs instead of discarding them. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against dfd2e744caa3. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
2755afa to
e505f9c
Compare
|
@clawsweeper re-review |
|
@clawsweeper re-review Exact head: The user explicitly authorizes specialist model/runtime routing. The change from the previously requested head is a fresh-main merge only; the added range updates the repository's ClawSweeper/merge policy, Swift test routing, docs, and cron tests, without touching the six authored files or the proven model-status, prepared-harness, turn, provider-usage, or shallow-health paths. Exact-head review artifacts validate with zero findings and Please review this pinned head and report every Rank-up move. Existing explicit-runtime auto-activation remains out of scope. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Exact head: The user explicitly authorizes specialist model/runtime routing. The post-review head changes are fresh-main ancestry merges only; the latest delta is the Control UI boot manifest and does not touch the six authored files or the proven model-status, prepared-harness, turn, provider-usage, or shallow-health paths. Local review artifacts remain finding-free and Please review this pinned head and report every Rank-up move. Existing explicit-runtime auto-activation remains out of scope. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Exact head: The user explicitly authorizes specialist model/runtime routing. The latest head movement is an ancestry-only diagnostics metrics refactor; it does not touch the six authored files or the proven model-status, prepared-harness, turn, provider-usage, or shallow-health paths. Local review remains finding-free and Please review this pinned head and report every Rank-up move. Existing explicit-runtime auto-activation remains out of scope. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Please review exact head Since the previous review, the real exact-head lifecycle failure was reproduced and repaired by deferring direct-registry context imports until after the borrowed Gateway-registry fast path. The focused runtime, harness, provider-auth/status, and lifecycle set passes 261/261; adjacent session create/patch coverage passes 236/236. Latest canonical main is included. The prior rank-up move remains mandatory: land only after exact-head required CI is green. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Preserve the interrupted worker's seven pending files alongside 81fd1a7. This is an incomplete recovery checkpoint, not a land-ready change. Related: #134468 and #134304. Reported by @goslingmanagment. The session selection work is already merged separately in #134837. The recovery-only production delta remains +107, exceeding this sweep's net-zero constraint. Pending owner tests expose contextless disabled-policy and mixed-owner diagnostic gaps. Gateway selection coverage also exposed an enabled-to-disabled fixture race with background sticky config writes. Build, changed checks, and final branch review are not complete. Co-authored-by: Jason (Json) <[email protected]>
|
Opened credited replacement #135118 for this repair, with Json retained as co-author and the original report linked to #134304. It includes the direct-registry context reuse and shared load-options refactors, the explicit-config/mixed-owner/default-enable diagnostic corrections, the borrowed-registry lazy-import fix, and the ordered sticky-config fixture join. The final local proof is green: 141 relevant tests across the owner/lifecycle and ordered Gateway runs, full changed-file checks, build, and a fresh isolated built-Gateway run. The first chat error preserves the owner, disabled-policy reason, and complete doctor recovery command while health/readiness remain 200. Exact-head hosted CI and the native landing gates remain before merge. This original PR stays open until the replacement is verified on main. Thanks @fuller-stack-dev for the original repair and lifecycle follow-up. |
* fix(agents): show recovery when a model harness is unavailable Carry the prepared plugin generation's activation and owner facts to the final harness guard. Reuse the scoped registry owner for direct agents and provider usage, preserving loaded request plugins when adding a selection. Put recovery commands before longer details so the first bounded chat error retains the operator's next action. Fixes #134304. Reported by @goslingmanagment. Release-note context: unavailable model harnesses explain plugin recovery while model status continues to report route availability independently of Gateway liveness. Co-authored-by: Jason (Json) <[email protected]> * chore: preserve blocked harness recovery checkpoint Preserve the interrupted worker's seven pending files alongside 81fd1a7. This is an incomplete recovery checkpoint, not a land-ready change. Related: #134468 and #134304. Reported by @goslingmanagment. The session selection work is already merged separately in #134837. The recovery-only production delta remains +107, exceeding this sweep's net-zero constraint. Pending owner tests expose contextless disabled-policy and mixed-owner diagnostic gaps. Gateway selection coverage also exposed an enabled-to-disabled fixture race with background sticky config writes. Build, changed checks, and final branch review are not complete. Co-authored-by: Jason (Json) <[email protected]> * fix(agents): preserve exact harness recovery policy Diagnose unavailable harness owners from the prepared registry, preserve explicit policy for direct hosts, and classify mixed/default-enabled owners correctly. Reuse activation context and shared registry load options; keep borrowed Gateway registry dependencies lazy. Join sticky config mutations before Gateway fixture teardown. Co-authored-by: Json <[email protected]> * test(gateway): join sticky mutations with explicit cleanup Keep the original ordered activation assertions while awaiting every captured config mutation in a lint-safe try/finally. Co-authored-by: Json <[email protected]> * test: isolate provider hook proofs by execution mode The previous case bundled compilation and four fresh subprocesses under one deadline. Give source and compiled execution their own cases, compile only the compiled case, and retain both provider scopes, lifecycle assertions, and the existing timeout. Co-authored-by: Json <[email protected]> --------- Co-authored-by: Jason (Json) <[email protected]> Co-authored-by: Json <[email protected]>
|
Superseded by the credited replacement #135118, now merged as cfefc26 (verified on |
…5118) * fix(agents): show recovery when a model harness is unavailable Carry the prepared plugin generation's activation and owner facts to the final harness guard. Reuse the scoped registry owner for direct agents and provider usage, preserving loaded request plugins when adding a selection. Put recovery commands before longer details so the first bounded chat error retains the operator's next action. Fixes openclaw#134304. Reported by @goslingmanagment. Release-note context: unavailable model harnesses explain plugin recovery while model status continues to report route availability independently of Gateway liveness. Co-authored-by: Jason (Json) <[email protected]> * chore: preserve blocked harness recovery checkpoint Preserve the interrupted worker's seven pending files alongside 81fd1a7. This is an incomplete recovery checkpoint, not a land-ready change. Related: openclaw#134468 and openclaw#134304. Reported by @goslingmanagment. The session selection work is already merged separately in openclaw#134837. The recovery-only production delta remains +107, exceeding this sweep's net-zero constraint. Pending owner tests expose contextless disabled-policy and mixed-owner diagnostic gaps. Gateway selection coverage also exposed an enabled-to-disabled fixture race with background sticky config writes. Build, changed checks, and final branch review are not complete. Co-authored-by: Jason (Json) <[email protected]> * fix(agents): preserve exact harness recovery policy Diagnose unavailable harness owners from the prepared registry, preserve explicit policy for direct hosts, and classify mixed/default-enabled owners correctly. Reuse activation context and shared registry load options; keep borrowed Gateway registry dependencies lazy. Join sticky config mutations before Gateway fixture teardown. Co-authored-by: Json <[email protected]> * test(gateway): join sticky mutations with explicit cleanup Keep the original ordered activation assertions while awaiting every captured config mutation in a lint-safe try/finally. Co-authored-by: Json <[email protected]> * test: isolate provider hook proofs by execution mode The previous case bundled compilation and four fresh subprocesses under one deadline. Give source and compiled execution their own cases, compile only the compiled case, and retain both provider scopes, lifecycle assertions, and the existing timeout. Co-authored-by: Json <[email protected]> --------- Co-authored-by: Jason (Json) <[email protected]> Co-authored-by: Json <[email protected]>
Fixes #134304
Independent decision
The issue remains real on canonical
main.models statuscan identify an OpenAI/Codex harness owner that cannot activate, while the real turn reaches the final prepared-run registration guard and returns generic recovery text. The smallest canonical repair is to carry the prepared registry's activation and owner facts to that guard. Shallow Gateway health remains independent of optional model routes.Root cause and repair
The final guard discarded the authoritative failure state already known by the prepared plugin generation. Direct-agent and cold provider-usage registries could also reach that guard without their exact load context.
This change:
openclaw doctor --fix/openclaw plugins inspect <owner-plugin-id>/ restart guidance;owner-plugin-degraded, and an unknown owner asowner-plugin-not-activatable; andRaw
PluginRecord.erroris deliberately omitted. It can contain stack traces, paths, secrets, or terminal control text; the turn exposes no new unredacted egress surface.The Codex owner fallback mirrors the existing runtime-plugin-load-plan compatibility mapping. It is used only when disabled or missing-manifest facts were deliberately carried, and does not broaden activation policy.
Evidence
main6e8e6fcd000f0c60eb19157a03ef9fcb5058e7e2: the status knows the stable reason, but the turn gives generic recovery. Contact sheet. Manifest.f921b91c48369360bc700b1b4363730f9b1778b9: status, real Gateway turn, shallow health, direct disabled, and direct restrictive-allowlist proof. Contact sheet. Checksum manifest.codexexecutable placed first onPATHwas never invoked. Plugin inventory and restrictive allowlist were unchanged before and after both failed turns./health,/healthz, and/readyzreturned HTTP 200 before and after the failed Gateway turn. The built-in OpenClaw harness is the healthy non-plugin negative control.PR head
76b1f6fd6b2caca886a7d570497a01479ecdc9a0contains canonicalmain09f9cbd2d06. Main movement that touched plugin loading, Codex runtime, doctor, model auth/status, turn preparation, setup, and UI build inputs was integrated and the affected tests, build, check, and packaged behavior gates were rerun. The latest plugin-capability-consent and CI-timing movement changes documentation, comments, test naming, and CI timing persistence only; it does not change runtime activation logic. The adjacent session-creation change (#135048) carries a catalog-selected runtime into the existing validator; it neither adds a shared persisted-selection readiness preflight nor changes this PR's final runtime guard. The five other authored files remain byte-for-byte identical to the packaged ac4f659 proof.src/agents/runtime-plugins.tsadditionally defers direct-registry context imports until after the borrowed Gateway-registry fast path, fixing the exact adjacent lifecycle regression found by hosted and local gates.Validation
pnpm vitest run src/plugins/provider-runtime.usage-harness.test.ts src/agents/runtime-plugins.test.ts src/agents/harness/runtime-plugin.test.ts src/commands/models/list.status.test.ts: 101 passed at ac4f659 after integrating the latest model-auth/status worker changes.src/agents/harness/registry.test.tsandsrc/agents/cli-runner/prepare.test.tspassed 248/248 after integrating adjacent harness-registry and turn-preparation changes;ui/src/pages/model-setup/wizard-runner.test.tspassed 33/33 in the earlier relevant setup merge.45772102395, before the final docs/comments-only main merge, 261/261 focused runtime, harness, provider-auth/status, and lifecycle tests passed. The lifecycle file had failed on the preceding head because eager direct-registry context imports initialized logging before the borrowed-registry fast path; deferring those imports makes all 13 lifecycle cases pass.sessions.createandsessions.patchsuites passed 236/236 on45772102395.pnpm build: passed on the immediately preceding authored tree after the policy-required dependency refresh; startup JavaScript measured 348199 B under the 349244 B enforcement limit. The latest main merge did not touch authored files; exact-head hosted CI remains the broad build gate.pnpm check: passed on the immediately preceding authored tree.test/scripts/release-workflow-matrix-plan.test.ts: 14/15 passed locally. Its sole failure is unchanged canonical-main behavior because macOS system Bash 3.2 does not support${GITHUB_REPOSITORY,,}; exact-head hosted Linux CI is required for that matrix.2026.8.1 (ac4f659).models statusreportedowner-plugin-not-activatable; the real Gateway turn named ownercodex, reported plugins disabled, and recommendedopenclaw doctor --fix;TURN_EXIT=1; the sentinel was not invoked; all three shallow health endpoints returned HTTP 200 before and after; and the Gateway drained cleanly.withAgentPluginRegistrywithensureSelectedAgentHarnessPluginforplugins.enabled=falseand a restrictive allowlist.scoped-clean, with no findings and 0.91 confidence. It specifically confirmed that the deferred imports preserve the borrowed Gateway-registry fast path while direct registries retain their prepared policy context.Review and scope
openai/codex@dde85b435b16:codex-rs/app-server-protocol/src/protocol/v2/model.rs:53and:147;codex-rs/app-server/src/request_processors/catalog_processor.rs:168and:242;codex-rs/app-server/src/models.rs:13;codex-rs/app-server-protocol/src/protocol/v2/account.rs:519;codex-rs/app-server/src/request_processors/account_processor.rs:1108;codex-rs/app-server/src/request_processors/turn_processor.rs:166,:499, and:607;codex-rs/core/src/thread_manager.rs:801and:947; andcodex-rs/core/src/codex_thread.rs:337and:475. Model listing, account state, and turn start are separate; no Codex contract supports making shallow Gateway health a model dependency probe.+132/-25(net+107); tests+430/-50(net+380). The production growth establishes one prepared-registry ownership contract shared by Gateway, direct-host, and provider-usage callers. No smaller existing seam preserved selections, environment, and request-scope extension semantics while carrying the authoritative activation facts.Authored with OpenAI Codex under maintainer supervision.