-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: tidy up claude cli handling #5594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the Claude Code CLI provider to improve error messages, refactor permission handling, and update documentation references. The changes enhance user experience by providing clearer guidance when the Claude Code CLI is not available or when using unsupported modes.
Key changes:
- Refactored permission flag logic into a dedicated method
apply_permission_flags - Improved error messages with better formatting and documentation links
- Updated provider metadata descriptions to clarify limitations
- Changed permission mode handling for GooseMode::Auto from
--permission-mode acceptEditsto--dangerously-skip-permissions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Ok(json!(claude_messages)) | ||
| } | ||
|
|
||
| /// Parse the JSON response from claude CLI |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc comment '/// Parse the JSON response from claude CLI' is incorrect for this function. It should describe applying permission flags to the command, not parsing JSON responses.
| /// Parse the JSON response from claude CLI | |
| /// Apply permission flags to the command based on the current GooseMode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, co-pilot! or delete the comment
| Please use Auto (which will run anything it needs to) or \ | ||
| SmartApprove (most things will run or Chat Mode)\n\n\n" |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message has unclear wording. 'SmartApprove (most things will run or Chat Mode)' is grammatically incorrect. It should be clearer, such as: 'Please use Auto (which will run anything it needs to), SmartApprove (most things will run), or Chat Mode.'
| Please use Auto (which will run anything it needs to) or \ | |
| SmartApprove (most things will run or Chat Mode)\n\n\n" | |
| Please use Auto (which will run anything it needs to), SmartApprove (most things will run), or Chat Mode\n\n\n" |
| pub const CLAUDE_CODE_KNOWN_MODELS: &[&str] = &["sonnet", "opus", "claude-sonnet-4-20250514"]; | ||
|
|
||
| pub const CLAUDE_CODE_DOC_URL: &str = "https://claude.ai/cli"; | ||
| pub const CLAUDE_CODE_KNOWN_MODELS: &[&str] = &["sonnet", "opus"]; |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing 'claude-sonnet-4-20250514' from CLAUDE_CODE_KNOWN_MODELS will cause the model argument to not be passed to the CLI when using the default model (since line 337 checks if the model is in KNOWN_MODELS). This breaks the default behavior where users expect the default model to be passed to the command.
| pub const CLAUDE_CODE_KNOWN_MODELS: &[&str] = &["sonnet", "opus"]; | |
| pub const CLAUDE_CODE_KNOWN_MODELS: &[&str] = &["claude-sonnet-4-20250514", "sonnet", "opus"]; |
| Ok(json!(claude_messages)) | ||
| } | ||
|
|
||
| /// Parse the JSON response from claude CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, co-pilot! or delete the comment
| - Claude Code CLI is installed and logged in\n\ | ||
| - The command is in your PATH, or set `CLAUDE_CODE_COMMAND` in your config\n\n\ | ||
| **For full features, please use the Anthropic provider with an API key if possible.**\n\n\ | ||
| Visit {} for installation instructions.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or change the path using @jamadeo 's new tricks
* main: (60 commits) fix: add standard context menu items to prevent empty right-click menu (#5616) Bump openapi in prepare-release (#5611) docs: add access control section to Developer tutorial (#5615) Token state not showing on load, or after message is finished. (#5606) Change the other location too (#5608) feat(ui): bring back quick launcher (#5144) Support platform tools through CLI (#5570) Avoid web double write (#5601) fix: gemini flash -> pro for mcp smoke tests (#5574) Manual compaction test and fix (#5568) fix: tidy up claude cli handling (#5594) Remove jetbrains (#5602) feat(githubcopilot): add support for newer Copilot AI Models (#5603) fix: customised recipe to yaml string to avoid minininjia parsing error (#5494) Add pending extension indicator to extension panel (#5493) Add environment subsition for auth blocks (#5439) acp: ToolCallLocations and working cancellation (#5588) feat(providers): add Mistral AI provider (#5009) Listen for ctrl-c during provider request (#5585) Also accept null as description, not just missing (#5589) ...
* main: (31 commits) Standardize CLI argument flags and update documentation (#5516) Release 1.13.0 fix: move goosehints/AGENTS.md handling to goose, and out of developer extension (#5575) fix: add standard context menu items to prevent empty right-click menu (#5616) Bump openapi in prepare-release (#5611) docs: add access control section to Developer tutorial (#5615) Token state not showing on load, or after message is finished. (#5606) Change the other location too (#5608) feat(ui): bring back quick launcher (#5144) Support platform tools through CLI (#5570) Avoid web double write (#5601) fix: gemini flash -> pro for mcp smoke tests (#5574) Manual compaction test and fix (#5568) fix: tidy up claude cli handling (#5594) Remove jetbrains (#5602) feat(githubcopilot): add support for newer Copilot AI Models (#5603) fix: customised recipe to yaml string to avoid minininjia parsing error (#5494) Add pending extension indicator to extension panel (#5493) Add environment subsition for auth blocks (#5439) acp: ToolCallLocations and working cancellation (#5588) ...
* main: (21 commits) differentiate debug/release in cache key (#5613) Unify subrecipe and subagent execution through shared recipe pipeline (#5082) Standardize CLI argument flags and update documentation (#5516) Release 1.13.0 fix: move goosehints/AGENTS.md handling to goose, and out of developer extension (#5575) fix: add standard context menu items to prevent empty right-click menu (#5616) Bump openapi in prepare-release (#5611) docs: add access control section to Developer tutorial (#5615) Token state not showing on load, or after message is finished. (#5606) Change the other location too (#5608) feat(ui): bring back quick launcher (#5144) Support platform tools through CLI (#5570) Avoid web double write (#5601) fix: gemini flash -> pro for mcp smoke tests (#5574) Manual compaction test and fix (#5568) fix: tidy up claude cli handling (#5594) Remove jetbrains (#5602) feat(githubcopilot): add support for newer Copilot AI Models (#5603) fix: customised recipe to yaml string to avoid minininjia parsing error (#5494) Add pending extension indicator to extension panel (#5493) ...
Signed-off-by: fbalicchia <fbalicchia@gmail.com>
Signed-off-by: Blair Allan <Blairallan@icloud.com>
this now maps
automode in goose appopriately to claude to ensure it takes actionmaps the old mode to "smart" and "manual" is not supported (and made clear).
Changed wording, and it will provide some guidance if it fails to find binary.