Repository navigation
refactor(agents): unify tool availability and plugin work ownership - #152073
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 18, 2026, 3:33 PM ET / 19:33 UTC (Revision 3). ClawSweeper reviewWhat this changesCentralizes GitHub tool availability in the agent host, retains plugin work throughout model preparation, and replaces production test hooks with scoped test fixtures. Merge readiness⛔ Blocked before merge - 1 item remains The PR remains useful: current main lacks these availability and lifecycle fixes. No blocking defect was found, and the PR body explicitly resolves the earlier compatibility decision. Priority: P2 Review scores
Verification
How this fits togetherThe agent host prepares tools and plugin resources before handing an attempt to the built-in, Codex, or Copilot harness. Tool policy controls the visible catalog, while live Gateway authority controls execution. flowchart TD
A[Admitted agent attempt] --> B[Prepare GitHub availability]
B --> C[Host constructs tools]
C --> D[Tool policy filters catalog]
D --> E[Selected agent harness]
E --> F[Live authority checks and execution]
G[Plugin registry build and run claims] --> E
G --> H[Release work before replacement]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -2, Tests +392, Docs +8. Total +398 across 42 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one host-owned availability decision and batch-owned plugin work lifetime, with the documented SDK precedence change accepted and existing tool-policy controls preserved. Do we have a high-confidence way to reproduce the issue? Yes, from source: Copilot omits the publication flag while current main forwards only harness options, and registry work claims can end before later catalog projection. The focused regressions cover these triggers; this review did not execute them. Is this the best way to solve the issue? Yes. Centralizing the prepared fact and extending the existing resource owner removes competing ownership without adding configuration or changing publication authorization. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 47b6eb550cb4. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Related plugin-construction contract landed in #150295: contextVersion: 2 tool factories receive a required assertInvocationCurrent guard, composed with the admitted invocation and plugin lifetime, and only explicitly opted-in factories can receive continued owner identity after the exact parent yields. Legacy direct-turn behavior is retained without granting legacy factories continuation authority. This does not implement this PR's host-owned GitHub publication availability or active construction/run work ownership changes. Keeping this PR open. When integrating the shared tool-construction paths, preserve the V2 opt-in boundary and final-effect guard rather than treating owner availability as invocation authority. |
|
Merged via squash.
|
…/current-conversation-binding-row * commit 'f5276e5a54c088dd23475f08479acd9738d959bd': (46 commits) perf(plugins): combine runtime and tool call scopes (#152101) test(memory): seed restart fixtures with the Gateway stopped (#152038) perf(gateway): avoid session list stalls on broad updates (#152074) fix: preserve model failure causes and worker fallback runtime (#152028) perf(logging): reduce Gateway hot-path info log volume (#152080) improve(gateway): reduce duplicate worker data fetched from SQLite (#151878) improve: format messages with many links faster (#152112) perf(cron): avoid unused SQL binding in config projections (#152029) fix: explain cloud worker startup failures (#152043) refactor(discord): share Markdown edit projection (#149214) refactor(media): remove unreachable geometry metadata backfills (#149272) chore(autoreview): sync mirror to agent-skills a7e91e1 (#152039) fix(ui): restore sidebar and chat test collection (#152099) fix(clickclack): finish SQLite cleanup between persistence tests (#152061) fix(workboard): isolate board deletion from unrelated subscriptions (#152102) refactor(agents): unify tool availability and plugin work ownership (#152073) fix: session group moves lag while requests are pending (#151689) fix(agents): preserve active cleanup during requester settlement (#151907) perf(sessions): keep deletion responsive under disk pressure (#152092) fix: preserve successful direct replies without serializing bookkeeping keys (#151870) ...
…pr-149282-proof-20260918 * refs/remotes/origin/main: fix(clickclack): finish SQLite cleanup between persistence tests (#152061) fix(workboard): isolate board deletion from unrelated subscriptions (#152102) refactor(agents): unify tool availability and plugin work ownership (#152073) fix: session group moves lag while requests are pending (#151689) fix(agents): preserve active cleanup during requester settlement (#151907) perf(sessions): keep deletion responsive under disk pressure (#152092) fix: preserve successful direct replies without serializing bookkeeping keys (#151870) fix(gateway): keep the previous plugin generation serving when a replacement stalls on admitted work (#151273) fix(agents): resume parent tasks after provider retries (#151879) perf(skills): silence identical collisions across workspaces (#152062) fix: reduce Doctor preparation time for large fleets (#151366) perf(ui): reuse session snapshots for roster updates (#152067) perf(tasks): skip SQLite admission for transient agent events (#152088) fix: await initial task persistence before Gateway activation (#151634) test: keep Vitest prototype ownership on execFile mocks (#152064) fix(pr): recover interrupted checkouts and isolate allocation state (#152069) fix(test): keep quota observer armed during Codex prewarm (#152090) fix(cron): keep scheduled jobs alive after their creating request ends (#152051) refactor(shared): reduce immutable graph traversal allocations (#152077)
…penclaw#152073) * refactor(agents): unify tool and plugin work ownership * test(agents): align migrated fixtures with host contracts * test(codex): avoid shadowing side-question options
|
Related follow-up: #141865 is now merged. It keeps this PR's host-owned GitHub availability and plugin-work ownership implementation; it does not restore the older duplicate availability helper. Its separate production change preserves the existing |
Related: #151651
What Problem This Solves
Copilot could lose managed GitHub publication tools despite successful host preparation, and plugin replacement could begin while model preparation still used the selected registry.
User Impact
Built-in, Codex, and Copilot harnesses receive the host-prepared publication tools allowed by their tool profile. Plugin replacement waits for active construction and run work while idle cached publications remain replaceable.
SDK behavior note: the host now takes precedence over a harness-supplied
githubPublicationAvailableoption. Existing method and option types remain accepted; tool profiles and allow/deny policy remain the visibility controls. This documented ownership decision addresses ClawSweeper's compatibility concern. No configuration, schema, protocol, or permission change is required.Why This Change Was Made
One host owns publication availability, and one construction scope retains registry work through the complete build. Active work is independent of physical plugin-resource custody. Codex's production test-factory bypass is removed; fixtures preserve real host identity where authority is exercised.
Pure attempt-context mapping no longer imports Gateway startup. A single Gateway test-listener dispatcher replaces overlapping spies that could recurse or restore prematurely.
Production code: 40 fewer lines. Tests/support: 430 additional lines. Documentation: 8 additional lines.
Evidence
check:changedpassed, including all four typecheck lanes, lint, dead exports, SDK budgets, and boundary/storage/import-cycle guards.a693772edd9460b9e75dbff7371dc3c41eb753ec: https://github.com/openclaw/openclaw/actions/runs/35385992419 (zero pending checks).Gateway flow evidence uses isolated synthetic fixtures; no live provider call or production deployment is claimed. Direct upstream Codex source inspection confirmed dynamic tools initialize at thread start and are copied from session configuration; this change preserves that protocol contract.