Skip to content

fix(claude-code): Permission routing for smart-approve#7501

Merged
jamadeo merged 1 commit intoblock:mainfrom
rabi:claude_code_smart_approve
Feb 28, 2026
Merged

fix(claude-code): Permission routing for smart-approve#7501
jamadeo merged 1 commit intoblock:mainfrom
rabi:claude_code_smart_approve

Conversation

@rabi
Copy link
Copy Markdown
Contributor

@rabi rabi commented Feb 25, 2026

Summary

SmartApprove was passing --permission-mode acceptEdits without enabling the control protocol (--permission-prompt-tool stdio), causing non-edit permission requests to silently fail.

Removed --permission-mode acceptEdits to align with goose's own smart-approve semantics rather than Claude Code's (auto-approve edits). Both SmartApprove and Approve now route all permissions through goose via the control protocol.

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

Testing

Tested locally.

SmartApprove was passing --permission-mode acceptEdits without enabling
the control protocol (--permission-prompt-tool stdio), causing non-edit
permission requests to silently fail.

Removed --permission-mode acceptEdits to align with goose's own
smart-approve semantics rather than Claude Code's (auto-approve edits).
Both SmartApprove and Approve now route all permissions through goose
via the control protocol.

Change-Id: I152fa83deaef7eb8ca078633c7a916ed1aee89aa
Signed-off-by: rabi <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 867d25622a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +357 to 358
GooseMode::SmartApprove | GooseMode::Approve => {
cmd.arg("--permission-prompt-tool").arg("stdio");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Handle action-required permissions in SmartApprove web sessions

Routing GooseMode::SmartApprove through --permission-prompt-tool stdio makes Claude Code emit ActionRequired tool confirmations and then wait for a confirmation reply (rx.await in crates/goose/src/providers/claude_code.rs), but the web command path only handles MessageContent::ToolConfirmationRequest and drops ActionRequired messages (crates/goose-cli/src/commands/web.rs). In SmartApprove + goose web, any tool call that triggers a permission check will therefore stall indefinitely on the first confirmation request.

Useful? React with 👍 / 👎.

Comment on lines +357 to 358
GooseMode::SmartApprove | GooseMode::Approve => {
cmd.arg("--permission-prompt-tool").arg("stdio");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Persist AlwaysAllow decisions for SmartApprove control prompts

This change routes SmartApprove into the action-required confirmation path, where Permission::AlwaysAllow is treated the same as AllowOnce and no permission-manager update is performed; persistence currently only happens in the non-action-required tool approval flow (crates/goose/src/agents/tool_execution.rs). As a result, SmartApprove users who choose “Always Allow” on Claude Code control prompts will be asked again on subsequent tool calls instead of having that decision stick.

Useful? React with 👍 / 👎.

@rabi
Copy link
Copy Markdown
Contributor Author

rabi commented Feb 25, 2026

The ActionRequired flow issues (web.rs handling, AlwaysAllow persistence) raised by
chatgpt-codex-connector, affect both Approve and SmartApprove equally and are separate issues from what this fix addresses.

@rabi rabi changed the title fixi(claude-code): Permission routing for smart-approve fix(claude-code): Permission routing for smart-approve Feb 26, 2026
@jamadeo jamadeo added this pull request to the merge queue Feb 28, 2026
Merged via the queue into block:main with commit 53c9812 Feb 28, 2026
19 checks passed
lifeizhou-ap added a commit that referenced this pull request Mar 2, 2026
* main: (46 commits)
  chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498)
  chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368)
  Better network failure error & antrhopic retry (#7595)
  feat: make the text bar persistent and add a queue for messages (#7560)
  fix: outdated clippy command in goosehints (#7590)
  chore(deps): bump hono from 4.11.7 to 4.12.1 in /evals/open-model-gym/mcp-harness (#7417)
  chore(deps-dev): bump ajv from 6.12.6 to 6.14.0 in /ui/desktop (#7437)
  chore(deps): bump ajv from 8.17.1 to 8.18.0 in /evals/open-model-gym/mcp-harness (#7491)
  chore(deps): bump hono from 4.12.0 to 4.12.2 in /ui/desktop (#7515)
  chore(deps-dev): bump rollup from 4.57.1 to 4.59.0 in /ui/desktop (#7522)
  chore(deps): bump minimatch in /ui/desktop (#7572)
  fix: validate configure probe for streaming providers (#7564)
  Dockerfile: add missing build/runtime dependencies (#7546)
  fix(claude-code): Permission routing for smart-approve (#7501)
  Add base_path field to custom provider config (#7558)
  fix(cli): avoid debug logging by default in CLI (#7569)
  fix: panic on corrupted permission.yaml instead of silently allowing all (#7432) (#7458)
  fix(openai): handle null reasoning effort in Responses API (#7469)
  Allow GOOSE_NODE_DIR override in batch file (#7422)
  feat: add analyze platform extension with tree-sitter AST parsing (#7542)
  ...
wpfleger96 added a commit that referenced this pull request Mar 3, 2026
* origin/main: (27 commits)
  feat: return structured {stdout, stderr} from shell tool with output schema (#7604)
  Improve custom provider creation experience (#7541)
  fix(scheduler): schedules added via CLI showing up in UI (#7594)
  chore: openai reasoning model cleanup (#7529)
  chore(deps): bump hono from 4.12.1 to 4.12.3 in /evals/open-model-gym/mcp-harness (#7585)
  chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498)
  chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368)
  Better network failure error & antrhopic retry (#7595)
  feat: make the text bar persistent and add a queue for messages (#7560)
  fix: outdated clippy command in goosehints (#7590)
  chore(deps): bump hono from 4.11.7 to 4.12.1 in /evals/open-model-gym/mcp-harness (#7417)
  chore(deps-dev): bump ajv from 6.12.6 to 6.14.0 in /ui/desktop (#7437)
  chore(deps): bump ajv from 8.17.1 to 8.18.0 in /evals/open-model-gym/mcp-harness (#7491)
  chore(deps): bump hono from 4.12.0 to 4.12.2 in /ui/desktop (#7515)
  chore(deps-dev): bump rollup from 4.57.1 to 4.59.0 in /ui/desktop (#7522)
  chore(deps): bump minimatch in /ui/desktop (#7572)
  fix: validate configure probe for streaming providers (#7564)
  Dockerfile: add missing build/runtime dependencies (#7546)
  fix(claude-code): Permission routing for smart-approve (#7501)
  Add base_path field to custom provider config (#7558)
  ...
lifeizhou-ap added a commit that referenced this pull request Mar 3, 2026
* main: (74 commits)
  feat: return structured {stdout, stderr} from shell tool with output schema (#7604)
  Improve custom provider creation experience (#7541)
  fix(scheduler): schedules added via CLI showing up in UI (#7594)
  chore: openai reasoning model cleanup (#7529)
  chore(deps): bump hono from 4.12.1 to 4.12.3 in /evals/open-model-gym/mcp-harness (#7585)
  chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498)
  chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368)
  Better network failure error & antrhopic retry (#7595)
  feat: make the text bar persistent and add a queue for messages (#7560)
  fix: outdated clippy command in goosehints (#7590)
  chore(deps): bump hono from 4.11.7 to 4.12.1 in /evals/open-model-gym/mcp-harness (#7417)
  chore(deps-dev): bump ajv from 6.12.6 to 6.14.0 in /ui/desktop (#7437)
  chore(deps): bump ajv from 8.17.1 to 8.18.0 in /evals/open-model-gym/mcp-harness (#7491)
  chore(deps): bump hono from 4.12.0 to 4.12.2 in /ui/desktop (#7515)
  chore(deps-dev): bump rollup from 4.57.1 to 4.59.0 in /ui/desktop (#7522)
  chore(deps): bump minimatch in /ui/desktop (#7572)
  fix: validate configure probe for streaming providers (#7564)
  Dockerfile: add missing build/runtime dependencies (#7546)
  fix(claude-code): Permission routing for smart-approve (#7501)
  Add base_path field to custom provider config (#7558)
  ...
craigwalkeruk pushed a commit to craigwalkeruk/custom-goose that referenced this pull request Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants