Skip to content

feat: select and manage installed agents from Models - #150224

Merged
obviyus merged 17 commits into
mainfrom
codex/acp-native-picker
Sep 20, 2026
Merged

obviyus merged 17 commits into
mainfrom
codex/acp-native-picker

Conversation

@obviyus

@obviyus obviyus commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Connects supported installed OpenCode, Qwen Code, Pi, and Kilo Code agents to Models settings, setup, the shared model picker, and chat. Each CLI owns its sign-in; this does not discover every arbitrary ACP-compatible executable.

User Impact

  • Enabling an installed agent finishes at the configuration acknowledgement, without waiting for model discovery.
  • Native model choices survive reload. Disabling an agent stops new discovery and turns without interrupting admitted work or deleting history.
  • When optional chat restrictions cannot be enforced, an administrator can explicitly choose Continue for this chat to use the native app's permissions. Required sandboxing and other mandatory boundaries remain enforced; agent and global defaults do not change.
  • Continue retries the original refused message and attachments once. A newer draft is preserved rather than sent under an earlier confirmation. Native assistant output streams before the final response.
  • Explicit permission and sandbox preferences survive same-chat resets and expiry. Native consent remains incarnation-bound and is retired on reset, fork, runtime change, or stronger settings.
  • Empty native discovery does not remove unrelated API models or trigger false model-fact changes, including repeated empty reads.

Why This Change Was Made

OpenClaw owns model selection, consent, transcripts, session lifecycle, and run authority. ACPX owns transport, model inspection, session-scoped client permissions, and final prompt admission. This consumes upstream ACPX #622, #623, and #624, rather than maintaining private enforcement wrappers in OpenClaw.

Both dependencies now use published acpx 0.17.1. The temporary Git-source pin and source-build approval are removed. Exact, dated dependency cooldown exclusions remain; installer integrity checks and script-disabled managed installation are unchanged.

The final reconciliation keeps catalog requests with the existing catalog schema owner, removes an unused type facade, and preserves native observation identity at the merge producer. Native policy calculation lives in the existing execution-policy module instead of importing the full agent runner during preflight. Runtime availability, implicit fallback, and explicit native pins stay with the execution selector; chat preflight checks only the known host-only runtime's permission restrictions. Tests exercise real catalog invalidation rather than retired UI wording or private metadata.

Evidence

  • Published-driver upgrade: the actual npm [email protected] updater installed the standard candidate package. Staging, migration rehearsal/continuation, canary, swap, and Doctor succeeded. The existing session retained its ID, model, runtime, workspace, label, and permissions. Restart was explicit after update --no-restart; automatic OS-service restart is not claimed.
  • Managed plugin and native continuity: the unchanged candidate plugin archive installed through the repository's canonical local prepublish npm registry fixture with normal official-package provenance. Its ACPX dependency matched public npm 0.17.1, and its SDK resolved the installed candidate core—not the source checkout. A native conversation continued across a real Gateway process restart. Reset cleared consent; a stale lifecycle grant was rejected without peer effects; fresh explicit consent restored execution. The peer was a deterministic ACP subprocess, not paid-provider inference. The candidate OpenClaw plugin itself is not publicly released.
  • Telegram Test Server: six real-user sends and two callback selections produced native-runtime confirmation edits. Four persisted snapshots verified native provider/model/runtime selection, /reset retention, restart retention, and unchanged agent defaults. Zero inference requests. The unchanged QA runner used Bun after a host Node/Undici error; the product Gateway used Node and the built candidate. Leases, credentials, processes, and listeners were cleaned up.
  • Real provider: OpenCode through ACPX 0.17.1 returned the requested exact smoke response using opencode/big-pickle, an isolated HOME, and no API-key environment variables.
  • Real UI/Gateway: a synthetic ACP subprocess refused the first message under Read Only, automatically retried it after confirmation, and streamed assistant chunks while its final response was still held. The recording contains one session creation and one automatic chat.send. Inspected before/after screenshots are embedded in the PR discussion and originating chat; earlier consent/retry captures remain available.
  • Regression proof: repeated empty native discovery failed before the producer fix: captured API rows disappeared, and configured API rows emitted false invalidations. Both cases pass after repair. A successful empty provider refresh still removes its own obsolete rows; native cancellation, final-prompt authority, and API/native route separation remain covered.
  • Lightweight preflight: the existing lazy-handler regression reproduced a speech-runtime import during basic chat.send validation. Moving the shared policy implementation fixed it without changing policy decisions: all nine moved function bodies and denial-prompt initializers have identical tokens. The registered consent-refusal test, 25 native-process cases, 18 model-ownership cases, 168 harness-selection cases, and seven relocated pure policy cases passed. The seven policy cases were moved, not added; the oversized selection module no longer needs its old size exception.
  • Single availability owner: hosted creation/recovery regressions exposed a duplicate availability check in chat preflight. Removing it restores inherited and recovered native selections without inventing fixture runtimes or changing stored pins. Four title/initial-send selection paths, tombstone recovery, and refusal before message persistence passed unchanged. Temporary core-runtime fixture pins were removed; execution still rejects unavailable explicit native ownership rather than silently switching to an API provider.
  • Focused checks: more than 700 cases passed across the repair rounds, including registered native-process execution, Gateway creation/recovery/admission/compaction/queued Stop, protocol exports, plugin boundaries, catalog ownership, Telegram callbacks, and 12 browser scenarios. The policy-cutover tree passed a full build and core production/UI/core-test typechecks; the subsequent availability-owner correction passed focused execution, production types, and lint. Protocol generation/Swift/Kotlin checks, assertion safety, and runtime import-cycle checks passed. Startup JS measured 364,119 bytes gzip against the 364,774-byte limit. The complete protocol schema's serialized bytes stayed identical through its module relocation. Size exceptions were pruned, not relaxed.

Upgrade, Telegram, and UI recordings bind the compiled 99ecb40e5d0 artifact. Later ACP changes affect empty catalog observations, schema placement, metadata-only policy loading, and test fixtures. Consent decisions and denial prompts are unchanged; native execution and pre-admission refusal were rechecked after the policy move. The final main merge also carries upstream update-service planning changes; retained upgrade proof still exercises the unchanged published 2026.9.4 driver with explicit no-restart, not a new automatic-service-restart claim. Historical observations are not relabeled as reruns of a later commit. Final exact-head review and hosted checks remain separate gates.

Disclosed limits

  • Direct local npm-pack installation imported successfully but correctly lacked official-plugin storage trust for native execution. The normal npm installation through the canonical prepublish registry fixture closed that execution gap without trust overrides.
  • An optional custom --bundle-plugin acpx distribution failed Darwin staging in [email protected] (binding.gyp missing). No flags or packaging code were weakened; the standard candidate installation remained intact. That custom-distribution route is not claimed green.
  • Matching-backup restoration and a post-upgrade external MCP tool call were not exercised.

Compatibility and intended permission contract

The maintainer-requested behavior is explicit administrator-only, per-chat delegation to the native app when optional restrictions cannot be enforced—not silent global relaxation or a second OpenClaw enforcement system. Mandatory boundaries, live run authority, and consent retirement remain required. The accompanying SDK additions use the existing harness, transcript, and turn-stream owners; existing silent transcript-write defaults remain unchanged.

The candidate plugin declares compat.pluginApi: >=2026.9.5; supported installation uses that SDK floor rather than relying on the older general install hint. The package proof upgraded the host before installing the candidate plugin.

Existing API-key setup and explicit ACP commands remain available. No database schema migration is introduced. No package release, operator Gateway redeployment, or OpenClaw merge is included in this preparation.

Contributor context

Sandbox recovery and upstream-first integration requested by @obviyus. Discussion, implementation and verification.

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram app: web-ui App: web-ui gateway Gateway runtime commands Command implementations agents Agent runtime and tooling extensions: acpx size: XL maintainer Maintainer-authored PR labels Sep 16, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 20, 2026, 8:12 AM ET / 12:12 UTC (Revision 39).

ClawSweeper review

What this changes

Adds installed-agent controls and model selection to Models settings, setup, and chat, with streamed replies and administrator-confirmed per-chat permission recovery.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open for normal landing. This maintainer-sponsored integration remains distinct from current main, retained behavior proof is sufficient, and no blocking defect was found in the reviewed paths.

Priority: P2
Reviewed head: 2cd52365fb6e8640be5bacff934a1eea4e1a71ac

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong retained behavior evidence supports a sound integration with documented compatibility tradeoffs and no established blocking defect.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Retained Gateway/native-process observations cover consent-gated retry, streaming, cancellation, and stale-authority rejection; inspected screenshots corroborate the visible flow. Published-driver upgrade, managed-plugin restart, Telegram Test Server, and OpenCode observations cover the principal integration boundaries, with historical artifact identities and limits preserved.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Retained Gateway/native-process observations cover consent-gated retry, streaming, cancellation, and stale-authority rejection; inspected screenshots corroborate the visible flow. Published-driver upgrade, managed-plugin restart, Telegram Test Server, and OpenCode observations cover the principal integration boundaries, with historical artifact identities and limits preserved.
Evidence reviewed 11 items Pinned introduction and clean checkout: Reviewed the local base-to-head delta using the supplied merge base. Raw head parentage matches the recorded original head. The stale test merge was not used to infer removals. git diff --check passed, and final git status remained clean.
Still distinct from main: Fetched main registers the existing ACP service and reply hook but lacks this branch’s four native chat harness registrations and installed-agent listing method. The new harness and installed-agent controller paths are also absent from the supplied latest release tag.
Native capability owner: The plugin registers the four supported native harnesses, reads current enablement flags, and exposes installation information through a read-scoped Gateway method. Vendor discovery stays in ACPX rather than a competing core implementation.
Findings None None.
Security None None.

How this fits together

The model catalog connects installed native agents to OpenClaw’s shared model picker. The Gateway owns session selection, consent, transcripts, and run authority; ACPX handles communication with the selected native application.

flowchart TD
  A[Installed native agents] --> B[ACPX discovery]
  B --> C[Shared model catalog]
  C --> D[Models settings and chat picker]
  D --> E[Gateway session and permission checks]
  E --> F[Authorized native turn]
  F --> G[Streamed reply and transcript]
Loading

Before merge

  • Resolve merge risk (P1) - Existing explicit CLI selections now stop when the executable is unavailable instead of silently using an API route; affected users must restore the CLI or explicitly select an API model, and deployment prevalence is unmeasured.
  • Resolve merge risk (P1) - The expanded SDK requires coordinated core/plugin delivery. Standard core-first upgrade evidence is present, but the disclosed custom bundled-Darwin route remains unqualified.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test growth Production/tooling +3,137 net lines; tests/support −1,100 net lines Excluding docs and manifests, production growth supports four native runtimes and their selection, consent, and lifecycle integration.
New configuration 4 optional native-agent enable flags Missing flags enable the supported agents; disabling a flag prevents new discovery and turns while preserving admitted work.

Stored data model

Persistent data-model change detected: serialized state: ui/src/pages/new-session/rejected-initial-turn.ts, unknown-truncated-pull-files. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Retain the documented rollout contract (recommended)
    Accept explicit native-runtime ownership and coordinated core-first plugin delivery, keeping custom bundled-Darwin packaging outside the demonstrated installation path.

Technical review

Best possible solution:

Preserve explicit runtime and billing choices, visible per-chat recovery, and the demonstrated core-first plugin upgrade path.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a single bug reproduction: this is a feature integration, with retained observations covering selection, consent, streaming, cancellation, and persistence.

Is this the best way to solve the issue?

Yes. The implementation reuses ACPX for native transport and existing core owners for selection, session authority, and transcripts; the permission tradeoff is explicitly documented and maintainer-sponsored.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 02c89f1b07ca.

Labels

Label justifications:

  • P2: This is a bounded user-facing integration improvement without evidence of an urgent production outage.
  • merge-risk: 🚨 compatibility: The branch changes explicit CLI fallback behavior and expands the SDK consumed by the separately installable ACPX plugin.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Retained Gateway/native-process observations cover consent-gated retry, streaming, cancellation, and stale-authority rejection; inspected screenshots corroborate the visible flow. Published-driver upgrade, managed-plugin restart, Telegram Test Server, and OpenCode observations cover the principal integration boundaries, with historical artifact identities and limits preserved.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained Gateway/native-process observations cover consent-gated retry, streaming, cancellation, and stale-authority rejection; inspected screenshots corroborate the visible flow. Published-driver upgrade, managed-plugin restart, Telegram Test Server, and OpenCode observations cover the principal integration boundaries, with historical artifact identities and limits preserved.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Native model callbacks change visible Telegram confirmation text and persisted selection; the retained Test Server evidence addresses that surface.

Evidence

What I checked:

  • Pinned introduction and clean checkout: Reviewed the local base-to-head delta using the supplied merge base. Raw head parentage matches the recorded original head. The stale test merge was not used to infer removals. git diff --check passed, and final git status remained clean. (2cd52365fb6e)
  • Still distinct from main: Fetched main registers the existing ACP service and reply hook but lacks this branch’s four native chat harness registrations and installed-agent listing method. The new harness and installed-agent controller paths are also absent from the supplied latest release tag. (extensions/acpx/index.ts:14, 02c89f1b07ca)
  • Native capability owner: The plugin registers the four supported native harnesses, reads current enablement flags, and exposes installation information through a read-scoped Gateway method. Vendor discovery stays in ACPX rather than a competing core implementation. (extensions/acpx/index.ts:32, 2cd52365fb6e)
  • Consent and final-effect safeguards: Session mutations enforce administrator scope, exact incarnation/settings expectations, mandatory containment, and idle execution, with guards repeated at commit. The native attempt carries live authority into model controls, approval decisions, prompt dispatch, and transcript writes. Inspected tests assert rejection without mutation and absence of native file effects after denial or cancellation. (src/gateway/server-methods/sessions-patch-sandbox.runtime.ts, 2cd52365fb6e)
  • Retained real behavior evidence: The captured body and discussion report a real isolated Gateway/native subprocess flow, published-driver upgrade, managed-plugin installation, Telegram Test Server selection/persistence, and real OpenCode response. The later before/after images were fetched read-only and inspected: the consent dialog explains delegation, and the after image shows an assistant chunk with Stop available. Authority evidence additionally records cancellation and stale-grant rejection without peer effects. These remain observations of their stated historical artifacts, not reviewer reruns. (99ecb40e5d0b)
  • Review continuity: The previous completed review contained no findings or published rank-up moves. The selected native attempt, consent validator, execution-policy module, UI recovery owner, and CLI selection owner are unchanged from that reviewed head. Its documented CLI fallback warning is retained as compatibility context, not converted into a new proof request. (src/auto-reply/reply/model-selection.ts, 2cd52365fb6e)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (38 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-20T06:58:57.411Z sha 99ecb40 :: blocked before merge. :: none
  • reviewed 2026-09-20T07:35:46.923Z sha 9f1be0a :: blocked before merge. :: none
  • reviewed 2026-09-20T08:07:05.863Z sha d7ff441 :: blocked before merge. :: none
  • reviewed 2026-09-20T08:46:42.628Z sha 394c0bd :: blocked before merge. :: none
  • reviewed 2026-09-20T09:03:54.525Z sha 7721501 :: blocked before merge. :: none
  • reviewed 2026-09-20T09:31:02.838Z sha da6208c :: blocked before merge. :: none
  • reviewed 2026-09-20T09:46:31.272Z sha f4a0d26 :: blocked before merge. :: none
  • reviewed 2026-09-20T10:38:57.885Z sha e3c78e3 :: blocked before merge. :: none

@obviyus

obviyus commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator Author

Provider-group UI proof from a synthetic fixture of the real chat model picker.

Provider groups before collapse controls
Provider groups collapsed by default

@obviyus

obviyus commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator Author

Tool-policy refusals now use the same public explanation in the chat reply and error banner. These captures use the installed OpenCode agent and the messaging tool profile through the Control UI; the refused turn made no model request.

Previous policy message
Actionable policy message

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 17, 2026
@clawsweeper clawsweeper Bot removed the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 17, 2026
Base automatically changed from codex/acp-runtime-consolidation to main September 17, 2026 08:31
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 17, 2026
@obviyus

obviyus commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator Author

Prepared local build using the merged ACPX #616 source. The published draft still waits for the official package.

The installed OpenCode agent returned one visible reply from a local model fixture in five seconds. The messaging tool profile showed the recovery message below without a new model request or workspace change. These captures do not establish paid-provider inference.

OpenCode reply from the local model fixture
Tool-policy recovery message

@obviyus
obviyus force-pushed the codex/acp-native-picker branch from 86e05e9 to ed54742 Compare September 17, 2026 11:12
@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Sep 17, 2026
@obviyus

obviyus commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-admin-merge
pr: 150224
head: b9a4159
scope: owner-review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: telegram Channel integration: telegram commands Command implementations dependencies-changed PR changes dependency-related files docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: acpx extensions: anthropic gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: workboard proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants