Repository navigation
feat(agents): relay Claude native tool requests as Gateway approvals - #112918
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
July 23, 2026 05:22
Contributor
Author
|
Landing note: ClawSweeper's review worker died twice on this PR (both leases expired 2026-07-23T06:05Z/06:09Z with only placeholder comments; no retry after the next hourly cycle). There are no rank-up moves to apply because no review completed. Proceeding on the pre-merge gates that did run: hosted CI green on 58f3f4d (run 29982152237), validated scripts/pr review artifacts (READY FOR /prepare-pr), and four rounds of Codex autoreview (gpt-5.6-sol, xhigh) ending clean. A post-merge sweeper review is welcome; follow-ups will be filed for anything it surfaces. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 24, 2026
…penclaw#112918) * feat(agents): relay Claude native tool requests as Gateway approvals * fix(agents): keep approval relay types local and refresh docs map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
OpenClaw drives Claude Code with
--permission-prompt-tool stdio, but thecan_use_toolhandler was binary: allow everything under YOLO exec policy, silently deny everything otherwise. Under a restrictive policy there was no human in the loop, so Claude's native and extension tools (its own Bash, WebFetch, and the Claude in Chrome browser tools, including the new 1Password for Claude credential autofill) were unusable.Why This Change Was Made
Requested by the maintainer after researching the 1Password-for-Claude launch (2026-07-16): the missing piece for consuming that feature through the
claude-clibackend is an interactive approval relay. The fix reuses the existing Gatewayplugin.approval.request/waitDecisiontwo-phase flow (same machinery the plugin approval broker uses), so no new approval transport, config surface, or persistence is introduced.src/agents/cli-runner/claude-live-tool-approval.ts(new): plan resolution from the effective exec policy, gateway request/wait with abort propagation, fail-closed outcome mapping.handleClaudeLiveControlRequestnow prompts instead of denying when the policy asks for approvals;allow-alwaysgrants are per tool name, in-memory, live-process-scoped only.ask: "off"never prompts (exec modeallowliststays deny-without-prompt);ask: "always"prompts every time and never mints or reuses grants;security: "deny"keeps the old immediate deny; YOLO keeps the old immediate allow. Bash never getsallow-always(a tool-name grant there is unrestricted execution), and oversized Bash input fails closed with a split-and-retry message. Truncated approval descriptions show head and tail with a quantified hidden-size marker and offer one-shot decisions only.docs/gateway/cli-backends.md(approval relay +--chromeseam),docs/gateway/1password.md(browser sign-in requirements incl. direct-Anthropic-plan and admin-policy prerequisites), and the bundled1passwordskill gains browser sign-in rules (never relay OTPs/passwords through chat).extensions/anthropic/cli-shared.test.tspins the--chromepassthrough contract for normal runs (restricted runs keep forcing--no-chrome).User Impact
Under a restrictive exec policy, Claude CLI sessions now deliver approval prompts (Allow once / Allow always / Deny) to the session's channel instead of silently failing tool calls. Timeouts, gateway outages, aborted runs, and unreachable approval routes all deny fail-closed. No behavior change for YOLO or deny policies; no config changes required.
Evidence
node scripts/run-vitest.mjs src/agents/cli-runner/claude-live-tool-approval.test.ts— 21 passednode scripts/run-vitest.mjs src/agents/cli-runner.spawn.test.ts— 101 passed (incl. new allow-once relay, allow-always grant reuse, ask-always double-prompt, oversized-Bash fail-closed, approval-unavailable cases)node scripts/run-vitest.mjs extensions/anthropic/cli-shared.test.ts— 46 passedtsgocore, core-test, and extensions-test lanes clean;scripts/run-oxlint.mjsclean;oxfmtclean;git diff --checkcleanbackend.blacksmith.shtimeouts), so gate proof ran locally per the trusted-source fallback; hosted CI on this PR is the authoritative gate.