Repository navigation
fix: explain unavailable agent harnesses on failed turns - #135118
Conversation
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]>
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]>
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]>
Keep the original ordered activation assertions while awaiting every captured config mutation in a lint-safe try/finally. Co-authored-by: Json <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 7:16 AM ET / 11:16 UTC. ClawSweeper reviewWhat this changesThe PR makes unavailable agent-harness failures name the known plugin owner and activation or load blocker, while preserving the prepared registry context for direct agents and provider usage. Merge readinessKeep open for normal maintainer handling: current main and v2026.8.1 still emit the generic failed-turn message, while this member-authored PR adds the missing state-specific recovery at the final registry guard. No introduced correctness or security defect was found in the reviewed change. Priority: P2 Review scores
Verification
How this fits togetherAgent turns choose a model runtime from a prepared plugin registry. The final harness guard stops a turn before execution when that runtime is unavailable and now turns the registry’s state into actionable recovery guidance without changing Gateway health semantics. flowchart LR
A[Existing agent session] --> B[Selected model runtime]
B --> C[Prepared plugin registry]
C --> D[Final harness guard]
D --> E[Owner and blocker diagnosis]
E --> F[Actionable failed-turn reply]
D --> G[Gateway health remains separate]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +75, Tests +535, Docs +7. Total +617 across 9 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 one prepared-registry-owned diagnosis at the final turn guard, preserve independent Gateway health checks, and land only after the normal exact-head merge gates are satisfied. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main’s final guard produces the generic message when the prepared registry lacks the selected harness, while the supplied isolated Gateway transcript exercises that same disabled-plugin path. Is this the best way to solve the issue? Yes: the patch keeps diagnosis at the prepared-registry/final-guard boundary, reuses existing activation helpers, and preserves the established separation between model-route status, turn execution, and Gateway health. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0043769cabc1. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Maintainer review decision on the +75 production lines: accepted for the missing visible recovery capability, with both requested refactors already included (38 inherited lines removed). The PR body records the rationale and production/test split. Removing the diagnostic would lose the owner, blocking state, and next action in the first bounded failed-turn error; changing activation or health instead would alter a different contract. The rank-up move is already satisfied in this change: one All local gates and the isolated built-Gateway proof passed. Exact-head CI remains the final execution gate; no merge is being requested by this comment. |
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]>
|
Merged via squash.
|
|
Post-merge exact-revision verification for The isolated packaged build preserves |
…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]>
… Codex plugins Since #135118 the runtime reports a disabled or untrusted harness plugin as 'Agent harness runtime "codex" is unavailable. (reason=..., ownerPluginId=codex)' with a doctor hint instead of "plugin registration is missing from this prepared run". The copied-session e2e still asserted the retired text. Assert the current diagnostic and its reason per case. Proof: gateway-copied-codex-session-resume.e2e.test.ts 4/4 after; the two rejection cases failed before. (cherry picked from commit cb47cf8)
…ill resource argv, Codex diagnostic) (#137358) * fix(test): keep Control UI browser suites out of the Gateway E2E project The Gateway E2E vitest project globbed extensions/qa-lab's control-ui-media-transcript.real-gateway.e2e.test.ts, a browser suite that depends on the Control UI project's global setup (inject("controlUiE2eChromium")). Collected under the Gateway project it fails at suite load with "Cannot destructure property 'executablePath' of 'inject(...)'". Exclude the UI real-gateway suite list from the Gateway project and assert the two projects never collect the same browser file. Owner: test/vitest/vitest.e2e.config.ts (Gateway E2E project). Proof: new sharding test "collects browser suites only in their Control UI projects" fails before and passes after; Full Release Validation Gateway 3/4 shard (run 33757831055) reproduced the load failure. * fix(gateway): carry skill resource operations over stdin, not workspace argv transferSkillResources passed the receiver's temp root, identity, resource name, offsets and hash as argv to `node -e`. The paired-node workspace guard (node-worker-workspace.ts) realpaths every argv element and rejects paths outside the workspace, so the absolute tmpdir root failed every skill transfer with "INVALID_REQUEST: workspace command argv resolves outside its workspace" and Codex turns on paired nodes died before replying. Move the whole operation into a validated stdin JSON envelope: the receiver derives its temp root from a caller-supplied hex id, checks the exact key set, identity, hash and chunk bounds, and size-budgets each chunk against the stdin limit including the envelope. argv is now only `node -e <script>`. Owner: src/gateway/worker-environments/skill-resource-transfer.ts. Proof: unit tests drive a real NodeWorkerWorkspaceRuntime carrier (transfer despite a project path collision, rejected mutated requests); e2e codex-node-exec-server.e2e.test.ts fails before and passes after. * test(gateway): expect the harness-unavailable diagnostic for disabled Codex plugins Since #135118 the runtime reports a disabled or untrusted harness plugin as 'Agent harness runtime "codex" is unavailable. (reason=..., ownerPluginId=codex)' with a doctor hint instead of "plugin registration is missing from this prepared run". The copied-session e2e still asserted the retired text. Assert the current diagnostic and its reason per case. Proof: gateway-copied-codex-session-resume.e2e.test.ts 4/4 after; the two rejection cases failed before.
…ill resource argv, Codex diagnostic) (openclaw#137358) * fix(test): keep Control UI browser suites out of the Gateway E2E project The Gateway E2E vitest project globbed extensions/qa-lab's control-ui-media-transcript.real-gateway.e2e.test.ts, a browser suite that depends on the Control UI project's global setup (inject("controlUiE2eChromium")). Collected under the Gateway project it fails at suite load with "Cannot destructure property 'executablePath' of 'inject(...)'". Exclude the UI real-gateway suite list from the Gateway project and assert the two projects never collect the same browser file. Owner: test/vitest/vitest.e2e.config.ts (Gateway E2E project). Proof: new sharding test "collects browser suites only in their Control UI projects" fails before and passes after; Full Release Validation Gateway 3/4 shard (run 33757831055) reproduced the load failure. * fix(gateway): carry skill resource operations over stdin, not workspace argv transferSkillResources passed the receiver's temp root, identity, resource name, offsets and hash as argv to `node -e`. The paired-node workspace guard (node-worker-workspace.ts) realpaths every argv element and rejects paths outside the workspace, so the absolute tmpdir root failed every skill transfer with "INVALID_REQUEST: workspace command argv resolves outside its workspace" and Codex turns on paired nodes died before replying. Move the whole operation into a validated stdin JSON envelope: the receiver derives its temp root from a caller-supplied hex id, checks the exact key set, identity, hash and chunk bounds, and size-budgets each chunk against the stdin limit including the envelope. argv is now only `node -e <script>`. Owner: src/gateway/worker-environments/skill-resource-transfer.ts. Proof: unit tests drive a real NodeWorkerWorkspaceRuntime carrier (transfer despite a project path collision, rejected mutated requests); e2e codex-node-exec-server.e2e.test.ts fails before and passes after. * test(gateway): expect the harness-unavailable diagnostic for disabled Codex plugins Since openclaw#135118 the runtime reports a disabled or untrusted harness plugin as 'Agent harness runtime "codex" is unavailable. (reason=..., ownerPluginId=codex)' with a doctor hint instead of "plugin registration is missing from this prepared run". The copied-session e2e still asserted the retired text. Assert the current diagnostic and its reason per case. Proof: gateway-copied-codex-session-resume.e2e.test.ts 4/4 after; the two rejection cases failed before.
Related: #134304. Credited replacement for #134468 by @fuller-stack-dev (Json); original report by @goslingmanagment.
What Problem This Solves
Fixes an issue where users sending turns to an existing model-dependent session receive a generic missing-registration failure when its required agent harness is unavailable, while Gateway health and readiness remain green. The error does not explain which plugin owns the runtime or whether it is disabled, denied, absent, or degraded.
Why This Change Was Made
The turn guard now diagnoses missing registration from the exact prepared registry's activation context and manifest ownership. Explicit-config library calls retain their policy even without a bound context. Direct hosts resolve one activation context, reuse it for memory adoption, and bind it to their scoped registry; provider usage uses that same owner path. Borrowed Gateway registries do not import direct-host context dependencies.
Owner classification checks the complete owner set before bounding displayed details, respects bundled/platform default enablement, and treats mixed blocked/activatable owners as degraded rather than wholly disabled. Existing registry failures take precedence without echoing raw plugin error text. No configuration, storage, protocol, health, readiness, or model-selection contract changes. Already-landed #134837 is not replayed.
User Impact
Unavailable turns now report the owner when known, the blocking state, and an actionable doctor/inspection/restart path. Model/auth discovery and process health remain independent of whether a particular turn's required harness can run. The documented recovery applies to existing sessions as well as direct hosts and provider usage.
Evidence
Verified on the final committed tree:
node scripts/run-vitest.mjs src/cli/run-main.cleanup.test.ts src/agents/runtime-plugins.test.ts src/agents/runtime-plugins.memory-corpus.integration.test.ts src/agents/prepared-model-runtime.plugin-context.test.ts src/agents/harness/runtime-plugin.test.ts src/plugins/provider-runtime.usage-harness.test.ts: 87/87 passed.node scripts/run-vitest.mjs src/gateway/server.sessions.agent-model-catalog.test.ts src/gateway/server-methods/sessions-mutations.sticky-model.test.ts: ordered 54/54 passed after the final fixture correction.node scripts/run-vitest.mjs test/scripts/vitest-worker-artifacts.test.ts: 34/34 passed after the CI fixture repair.pnpm buildpassed, including runtime postbuild, plugin exports, and Control UI budgets. Changed-file checks passed for the original eight paths and separately for the worker-artifact test repair (types, lint, dead exports, architecture, storage, and security guards).Regression proof includes explicit-config plugin disablement, mixed ownership (including a fourth owner beyond the display cap), bundled/platform defaults, and Json's borrowed-registry lifecycle case. Each newly corrected behavior failed before its fix. The ordered Gateway catalog/sticky suite joins pending config mutations before fixture teardown; activation checks are unchanged.
Direct Codex dependency inspection:
openai/codexat0ae94fdd49b05ee7faa4d984d06a68492cb32b54,codex-rs/app-server/src/request_processors/catalog_processor.rs:168,242,turn_processor.rs:166,499, andaccount_processor.rs:1034. Catalog/auth and turn-start processing are separate boundaries; this repair does not reinterpret a successful probe as turn executability.Built Gateway live-proof transcript
Fresh isolated HOME and state directory, synthetic token, loopback port 50912 (not 18789), no provider credentials or inference. The driver waits for the documented startup admission probe.
An initial fresh driver attempt connected on liveness before startup completed and received the expected startup-sidecars rejection. The corrected driver waits on /startupz; no production retry, timeout increase, or health change was added.
Hosted CI follow-up
The first exact-head CI run failed only
checks-node-compact-small-29: the worker-artifact provider-hook case bundled a compiled build and four cold subprocesses under one 120-second deadline. Its log records source/scoped, source/prepared, and compiled/scoped success before the last subprocess was cut off. The original full file passed locally, so this was not a reproduced hook-behavior failure.The fixture now has separate source and compiled cases. Both still execute scoped and prepared probes with the same assertions and timeout; only the compiled case builds artifacts, so there is still exactly one compiled build total. The full file passes 34/34. This bounded test-owner repair adds one net test line and no production code; fresh hosted CI is required on the updated head.
Scope and production LOC
Both requested refactors are included: direct-registry activation-context reuse and shared registry-load options remove 38 production lines from the inherited patch. Against the integrated main baseline, production is +177/-102 (net +75), tests are +626/-91 (net +535), and docs are +7/-0. The remaining production growth is justified: visible, state-specific recovery is the missing capability for turns that fail while health remains green. It cannot be supplied by removing the guard, changing service health, or weakening plugin activation. The diagnostic stays at the turn/registry owner boundary, using existing policy helpers rather than a second activation policy.
NO-FOLLOW-UP: both rent-paying refactors are included here; a wider readiness or selection redesign is a separate product decision, with existing follow-ups, not part of this repair.
Co-authored-by: Json [email protected]