Conversation
There was a problem hiding this comment.
Pull request overview
This PR restores SmartApprove behavior by reintroducing read-only tool auto-approval, using MCP read_only_hint annotations and an LLM-based fallback for unannotated tools, with caching to avoid repeated prompts.
Changes:
- Extend
ToolInspector/ToolInspectionManagerinterfaces to acceptsession_id, and plumb it through agent + tests. - Populate and consult a read-only annotation set (
read_only_hint) and SmartApprove permission cache to skip prompts in SmartApprove mode. - Add/extend integration tests to cover SmartApprove read-only auto-approval and LLM-based detection.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/goose/src/tool_inspection.rs | Adds session_id to inspector API and passes it to inspectors. |
| crates/goose/src/agents/agent.rs | Wires shared provider into the permission inspector and applies tool annotations in SmartApprove. |
| crates/goose/src/permission/permission_inspector.rs | Implements SmartApprove annotation/cache checks and LLM-based read-only detection with caching. |
| crates/goose/src/config/permission.rs | Tracks read-only annotated tools and applies MCP tool annotations into permission state. |
| crates/goose/src/permission/permission_judge.rs | Removes the old permission-check entrypoint; keeps detect_read_only_tools for LLM judging. |
| crates/goose/src/security/security_inspector.rs | Updates inspector signature for session_id. |
| crates/goose/src/tool_monitor.rs | Updates inspector signature for session_id. |
| crates/goose/tests/tool_inspection_manager_tests.rs | Updates mocks and calls for new inspect_tools(session_id, ...) signature. |
| crates/goose/tests/providers.rs | Adds SmartApprove integration tests for annotated and LLM-detected read-only tools. |
| crates/goose-test-support/src/mcp.rs | Annotates get_code fixture tool as read-only via read_only_hint. |
| crates/goose/src/permission/mod.rs | Removes re-export of detect_read_only_tools. |
Signed-off-by: Adrian Cole <[email protected]>
0f487df to
cd0e873
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd0e8738e9
ℹ️ 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".
DOsinga
left a comment
There was a problem hiding this comment.
we could probably do a better job on the GooseMode <-> string conversion, but good fix
* origin/main: (59 commits) fix: restore smart-approve mode (#7690) fix: make TLS configurable in goosed agent via GOOSE_TLS env var (#7686) Update to rmcp 1.1.0 (#7619) Fix max turns configuration (#7612) feat: add base path field to custom provider configuration (#7614) fix: compare extension configs before skipping add_extension (#7650) chore(release): release version 1.27.0 (minor) (#7611) feat: better private channel detection, bot version debugging (#7680) chore(deps): bump svgo from 3.3.2 to 3.3.3 in /documentation (#7667) fix: only add viewable channels to bot context (#7678) chore: added a recipe to help identify high risk change prs for testing (#7651) fix: make sure platform binary exists (#7676) fix(shell): replace global static output buffer with per-instance TempDir (#7632) opt: remove timestamped config file backup (#7618) chore(deps): bump @hono/node-server from 1.19.9 to 1.19.10 in /ui/desktop (#7662) chore(deps): bump hono from 4.12.3 to 4.12.5 in /evals/open-model-gym/mcp-harness (#7661) chore(deps): bump hono from 4.12.2 to 4.12.5 in /ui/desktop (#7660) fix: resolve parameters in initial message with autosubmit (#7659) fix: this should not be blocked (#7656) Relax the assertion for the model list ACP test (#7653) ...
…e-issue * origin/main: feat: combine TUI UX from alexhancock/tui-goodness with publishing config from jackamadeo/package-tui (#7683) chore: cleanup old sandbox (#7700) Correct windows artifact (#7699) gh fall back (#7695) fix: restore smart-approve mode (#7690) fix: make TLS configurable in goosed agent via GOOSE_TLS env var (#7686) Update to rmcp 1.1.0 (#7619)
…deps * origin/main: (34 commits) fix: reduce server log verbosity — skip session in instrument, defaul… (#7729) fix: provider test infrastructure (#7738) fix: sanitize streamable HTTP extension names derived from URLs (#7740) refactor: derive GooseMode string conversions with strum (#7706) docs: Add Spraay Batch Payments MCP Extension Tutorial (#7525) fix: flake.nix (#7224) delete goose web (#7696) Add @angiejones as CODEOWNER for documentation (#7711) Add MLflow integration guide (#7563) docs: LM Studio availability (#7698) feat: add Avian as an LLM provider (#7561) Adds `linux-mcp-server` to the goose registry (#6979) fix: add #[serde(default)] to description field on 4 ExtensionConfig variants (#7708) feat: combine TUI UX from alexhancock/tui-goodness with publishing config from jackamadeo/package-tui (#7683) chore: cleanup old sandbox (#7700) Correct windows artifact (#7699) gh fall back (#7695) fix: restore smart-approve mode (#7690) fix: make TLS configurable in goosed agent via GOOSE_TLS env var (#7686) Update to rmcp 1.1.0 (#7619) ... # Conflicts: # Cargo.lock
Summary
Users who pick SmartApprove get prompted for every tool call, same as Approve since #4237. This is due to features supporting SmartApprove being orphaned.
PermissionManager.is_readonly_annotated_tool()and the smart_approve permission cache before prompting, gated to SmartApprove mode.readonly_annotated_toolsonPermissionManagerfromread_only_hintannotations when tools load.detect_read_only_tools. Results are cached in the smart_approve permission store.Type of Change
AI Assistance
Testing
SmartApprove auto-approves read-only tools
SmartApprove LLM detection auto-approves unannotated read-only tools
SmartApprove still prompts for non-read-only tools
$ GOOSE_MODE=smart_approve target/release/goose session --with-builtin developer __( O)> ● new session · tetrate gpt-5-nano \____) 20260306_9 · /Users/codefromthecrypt/oss/goose-2 L L goose is ready ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ 0% 0/400k 🪿 Run the shell command: echo hello ▸ shell command: cd /Users/codefromthecrypt/oss/goose-2 && echo hello ◆ Goose would like to call the above tool, do you allow? │ ● Allow (Allow the tool call once) │ ○ Always Allow │ ○ Deny │ ○ Cancel └Related Issues
Regression from #4237
Original feature: #1371