Skip to content

fix(agents): show recovery when a model harness is unavailable - #134468

Closed
fuller-stack-dev wants to merge 48 commits into
mainfrom
fix/134304-harness-runtime-diagnostics
Closed

fuller-stack-dev wants to merge 48 commits into
mainfrom
fix/134304-harness-runtime-diagnostics

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Fixes #134304

Independent decision

The issue remains real on canonical main. models status can 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:

  • attaches config, activation policy, environment, workspace, manifest metadata, and requested selections where scoped agent registries are built;
  • when a Gateway request registry exists, prepares a selection-scoped generation from its loaded plugin IDs instead of silently reusing or replacing the request scope;
  • reports one stable reason for every unavailable arm, the owner plugin when known, bounded lifecycle phase, and actionable openclaw doctor --fix / openclaw plugins inspect <owner-plugin-id> / restart guidance;
  • classifies an activated owner that omitted registration as owner-plugin-degraded, and an unknown owner as owner-plugin-not-activatable; and
  • leaves the final exact-generation registration check in place as defense in depth.

Raw PluginRecord.error is 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

PR head 76b1f6fd6b2caca886a7d570497a01479ecdc9a0 contains canonical main 09f9cbd2d06. 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.ts additionally 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.
  • The same four files plus src/agents/harness/registry.test.ts and src/agents/cli-runner/prepare.test.ts passed 248/248 after integrating adjacent harness-registry and turn-preparation changes; ui/src/pages/model-setup/wizard-runner.test.ts passed 33/33 in the earlier relevant setup merge.
  • On behavior-equivalent head 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.
  • The newly adjacent sessions.create and sessions.patch suites passed 236/236 on 45772102395.
  • 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.
  • The newly integrated ordinary status refactor passed 25/25 focused status-all, report-data, and cold-import tests.
  • 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.
  • Package assembly, tarball integrity, and isolated installation passed at ac4f659. The installed package reported OpenClaw 2026.8.1 (ac4f659).
  • In that isolated package, models status reported owner-plugin-not-activatable; the real Gateway turn named owner codex, reported plugins disabled, and recommended openclaw 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.
  • Direct regressions compose withAgentPluginRegistry with ensureSelectedAgentHarnessPlugin for plugins.enabled=false and a restrictive allowlist.
  • Cold provider-usage regressions prove selection and environment preservation, successful real harness loading, and preparation of a selection-scoped generation from the existing Gateway request registry's loaded plugin IDs.
  • Activated-owner/no-record and unknown-owner regressions require a stable reason in the final error.
  • P0-P3 autoreview of the final authored change was 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

Authored with OpenAI Codex under maintainer supervision.

@clawsweeper

clawsweeper Bot commented Aug 31, 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 agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 31, 2026
@clawsweeper clawsweeper Bot added 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 Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed September 1, 2026, 6:18 AM ET / 10:18 UTC.

ClawSweeper review

What this changes

The 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 provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The 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
Reviewed head: 76b1f6fd6b2caca886a7d570497a01479ecdc9a0

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The diagnostic direction and focused coverage are useful, but the introduced registry-scope regression must be corrected before the patch is merge-ready.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate. The prepared local artifact confirms the reported pre-fix generic diagnostic; the referenced after-fix media was not locally prepared, so it is not used to establish this review finding.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate. The prepared local artifact confirms the reported pre-fix generic diagnostic; the referenced after-fix media was not locally prepared, so it is not used to establish this review finding.
Evidence reviewed 5 items Introduced scope regression: The new provider-usage fallback passes a selection into withAgentPluginRegistry. In a Gateway request scope that bypasses its reuse fast path, and the wrapper supplies basePluginIds: [], preventing the loader from retaining loaded Gateway runtime plugin IDs.
Existing scope invariant: The registry loader normally takes loaded IDs from the request registry when no explicit base is supplied, and existing coverage asserts that selected loads retain startup owners plus selected owners.
Current-main check: Current main is 17 commits beyond the PR base and the three affected production files still differ between current main and this PR, so the requested repair has not already landed.
Findings 1 actionable finding [P2] Preserve Gateway registry owners for usage fallback
Security None None.

How this fits together

Agent 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]
Loading

Before merge

  • Preserve Gateway registry owners for usage fallback (P2) - With a Gateway request registry and a selected harness, this call bypasses the borrowed-registry fast path; withAgentPluginRegistry then explicitly passes basePluginIds: [], suppressing the loader path that retains loaded Gateway IDs. The resulting usage harness runs in a registry missing every existing Gateway runtime owner. Preserve those IDs alongside the selected owner and add a nonempty Gateway-scope regression.
  • Resolve merge risk (P1) - Merging as-is can make a cold provider-usage lookup run against a registry that excludes already-loaded Gateway plugin owners, creating a compatibility regression for registry-scoped runtime contributions.

Findings

  • [P2] Preserve Gateway registry owners for usage fallback — src/plugins/provider-runtime.ts:673-676
Agent review details

Security

None.

PR surface

Source +107, Tests +380. Total +487 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 132 25 +107
Tests 3 430 50 +380
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 562 75 +487

Review metrics

Metric Value Why it matters
Production versus test delta production +107 net; tests +380 net The repair changes three production modules and adds focused diagnostics and lifecycle coverage; the production growth needs the composed-registry path to remain coherent.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #134304
Summary: This PR is the linked candidate repair for the unavailable-harness diagnostic behavior reported by the canonical issue.

Members:

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

Merge-risk options

Maintainer options:

  1. Preserve Gateway scope before merge (recommended)
    Include the request registry’s loaded runtime plugin IDs when composing a selected provider-usage registry, then prove both the retained base IDs and selected owner are present.
  2. Pause this diagnostic change
    Pause if retaining the full composed Gateway scope is intentionally undesirable and needs a new explicit registry-ownership contract.

Technical review

Best 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:

  • [P2] Preserve Gateway registry owners for usage fallback — src/plugins/provider-runtime.ts:673-676
    With a Gateway request registry and a selected harness, this call bypasses the borrowed-registry fast path; withAgentPluginRegistry then explicitly passes basePluginIds: [], suppressing the loader path that retains loaded Gateway IDs. The resulting usage harness runs in a registry missing every existing Gateway runtime owner. Preserve those IDs alongside the selected owner and add a nonempty Gateway-scope regression.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.92

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate. The prepared local artifact confirms the reported pre-fix generic diagnostic; the referenced after-fix media was not locally prepared, so it is not used to establish this review finding.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P1: The PR addresses unavailable model harnesses that stop affected agent work before inference and its introduced fallback can regress a Gateway runtime scope.
  • merge-risk: 🚨 compatibility: The new scoped registry can omit plugins already loaded by the Gateway, changing existing provider-usage runtime composition.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate. The prepared local artifact confirms the reported pre-fix generic diagnostic; the referenced after-fix media was not locally prepared, so it is not used to establish this review finding.

Evidence

What I checked:

  • Introduced scope regression: The new provider-usage fallback passes a selection into withAgentPluginRegistry. In a Gateway request scope that bypasses its reuse fast path, and the wrapper supplies basePluginIds: [], preventing the loader from retaining loaded Gateway runtime plugin IDs. (src/plugins/provider-runtime.ts:673, 76b1f6fd6b2c)
  • Existing scope invariant: The registry loader normally takes loaded IDs from the request registry when no explicit base is supplied, and existing coverage asserts that selected loads retain startup owners plus selected owners. (src/agents/runtime-plugins.ts:80, 76b1f6fd6b2c)
  • Current-main check: Current main is 17 commits beyond the PR base and the three affected production files still differ between current main and this PR, so the requested repair has not already landed. (src/agents/runtime-plugins.ts:165, dfd2e744caa3)
  • Area history: The scope-preservation behavior appears in recent agent-registry work by Peter Steinberger, including the commit that scoped fall-through loads to active runtime plugins. (src/agents/runtime-plugins.ts:80, 93d879dcd120)
  • Codex runtime boundary inspected: Codex’s model-list and turn-start handlers are separate app-server operations; this OpenClaw patch changes only local harness registry diagnostics and does not alter that protocol. (codex-rs/app-server/src/request_processors/turn_processor.rs:166, 78c290807ce7)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Preserve loaded Gateway plugin IDs when a selected provider-usage harness creates its scoped registry.
  • Add a regression that exercises a nonempty Gateway request registry together with a cold selected harness.

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 (13 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-01T01:30:35.882Z sha 6a9bdc9 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T01:45:44.233Z sha 25a7232 :: found issues before merge. :: [P2] Preserve diagnostics for contextless agent command registries
  • reviewed 2026-09-01T01:53:23.283Z sha 25a7232 :: found issues before merge. :: [P2] Preserve diagnostics for direct agent-command registries
  • reviewed 2026-09-01T03:11:32.897Z sha 67d6798 :: needs changes before merge. :: [P2] Preserve cold registry policy facts
  • reviewed 2026-09-01T05:10:36.818Z sha 4b6c1cc :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T05:45:01.681Z sha 4b6c1cc :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T07:05:44.193Z sha 1283258 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T08:58:32.194Z sha 98bf98f :: needs maintainer review before merge. :: none

@fuller-stack-dev
fuller-stack-dev force-pushed the fix/134304-harness-runtime-diagnostics branch from 2755afa to e505f9c Compare August 31, 2026 21:25
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 Aug 31, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review August 31, 2026 21:38
@fuller-stack-dev fuller-stack-dev self-assigned this Aug 31, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head: 225df86807257457e8651ec9cde8ba5b1c297fef.

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 READY FOR /prepare-pr.

Please review this pinned head and report every Rank-up move. Existing explicit-runtime auto-activation remains out of scope.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head: 1c16499733964bd339d79fc14daa3b0b98a1f008.

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 READY FOR /prepare-pr.

Please review this pinned head and report every Rank-up move. Existing explicit-runtime auto-activation remains out of scope.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head: 98bf98ff7e634f0f92329cf551f64312f23e69f0.

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 READY FOR /prepare-pr.

Please review this pinned head and report every Rank-up move. Existing explicit-runtime auto-activation remains out of scope.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 76b1f6fd6b2caca886a7d570497a01479ecdc9a0. The user explicitly authorized the specialist availability/model-runtime scope and landing.

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.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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
steipete added a commit that referenced this pull request Sep 1, 2026
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]>
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

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.

steipete added a commit that referenced this pull request Sep 1, 2026
* 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]>
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Superseded by the credited replacement #135118, now merged as cfefc26 (verified on main). Your diagnosis and repair were the foundation — the replacement preserves your co-authorship on every commit and extends the fix with prepared-registry activation facts at the owning guard, corrected explicit-config/mixed-owner classification, and a live-gateway proof (visible recovery text with the exact doctor --fix command on a broken selection). #134304 is closed by the merge. Thank you for the contribution — closing this PR in favor of the landed replacement.

@steipete steipete closed this Sep 1, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
…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]>
@RomneyDa
RomneyDa deleted the fix/134304-harness-runtime-diagnostics branch October 22, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Unregistered required agent harness leaves model-dependent turns failing while Gateway stays healthy

2 participants