Skip to content

fix: agent exec loads installed harnesses locally - #119855

Merged
steipete merged 2 commits into
mainfrom
codex/autoqa-agent-exec-install-index-v2-20260806
Aug 6, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/autoqa-agent-exec-install-index-v2-20260806

Conversation

@steipete

@steipete steipete commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #119852

What Problem This Solves

Fixes an issue where users running openclaw agent exec with a configured plugin-owned native harness would receive Agent harness runtime ... is not present in the prepared registry before the harness could start.

Why This Change Was Made

Direct local agent commands now bind one bounded plugin-registry generation around preparation and execution when no Gateway-owned registry is already in scope. The local scope loads only configured runtime owners, while Gateway and embedded hosts keep their existing authoritative registry. The regression fixture now represents a real installed plugin by seeding the canonical SQLite install index.

The local admission/scoping flow moved into a focused module so agent-command.ts remains below the repository's max-lines gate instead of adding a suppression.

Production LOC: +102/-44 (net +58) | Tests: +88/-24 (net +64)

The positive production delta establishes the missing local registry ownership boundary and extracts the existing local admission flow from an oversized orchestrator.

User Impact

Operators can use installed native harness plugins through openclaw agent exec again. Normal runs inherit the configured harness; --isolated still cannot access it, and one-shot run state remains ephemeral.

Evidence

An exploratory broad test:changed fallback did not complete: https://github.com/openclaw/openclaw/actions/runs/31071327908 ended with Vitest Worker exited unexpectedly after its preceding shards passed. The exact failed bins, full build, repository-native changed gate, and exact-head hosted CI above are green.

AI-assisted: yes. I reviewed the complete affected command, plugin-registry, prepared-runtime, and test paths and understand the ownership change.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Aug 6, 2026
@steipete
steipete marked this pull request as ready for review August 6, 2026 06:04
@steipete

steipete commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head ad56b2ceb8efcfb9866469c63fdb176775eaa7c3.

Root cause: the scoped-registry refactor removed the implicit process-global owner, but direct local agent commands still reached model/harness selection without a request-owned plugin registry. requireActivePluginRegistry() therefore synthesized an empty registry and rejected an installed configured harness before its turn could start.

Architectural owner and fix: local agent-command ingress now owns one lifecycle/request/recovery/plugin-registry generation. It loads only configured runtime owners when no Gateway registry exists; an existing Gateway scope remains authoritative. The old inline local admission block was removed from agent-command.ts and extracted with the new ownership boundary, keeping that orchestrator below the max-lines ratchet.

Production LOC: +102/-44 (net +58). Tests/test support: +88/-24 (net +64). No config, environment, protocol, plugin SDK, dependency, or schema surface changed.

Proof:

Best-fix verdict: this is the clean bounded owner-boundary repair. Loading a process-global registry would reintroduce the retired ownership model; adding a downstream harness guard would preserve the empty-registry failure; broad-loading all plugins would add startup work and violate the scoped plan.

Known gap: ClawSweeper's later batch publication job hit its GitHub App installation quota, so its exact-head placeholder was not edited. The immutable shard artifact itself completed and was read directly. The earlier exploratory broad test:changed run also ended in a Vitest worker infrastructure exit after preceding shards passed; exact failed bins, build, changed gate, and hosted CI are green.

@steipete
steipete merged commit 245dbac into main Aug 6, 2026
126 checks passed
@steipete
steipete deleted the codex/autoqa-agent-exec-install-index-v2-20260806 branch August 6, 2026 07:26
@steipete

steipete commented Aug 6, 2026

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

agents Agent runtime and tooling commands Command implementations maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: agent exec rejects installed harnesses before local runtime scope

1 participant