* feat: Add setting to use Claude subscription when API key is detected This commit adds a new optional setting `use_claude_subscription` to the ClaudeCode executor configuration. When enabled, this setting removes the ANTHROPIC_API_KEY environment variable before spawning the Claude Code agent, ensuring that users with Claude Pro/Team subscriptions can opt to use their subscription instead of being charged API fees. ## Changes - Added `use_claude_subscription` optional field to the `ClaudeCode` struct - Implemented logic in `spawn_internal` to conditionally remove `ANTHROPIC_API_KEY` from the environment when the setting is enabled - Added tracing log when API key is removed for better debugging ## Implementation Details - The field is optional (`Option<bool>`) and defaults to `false` when not set, maintaining backward compatibility - Uses `#[serde(skip_serializing_if = "Option::is_none")]` to keep JSON clean - The setting is automatically exposed in the frontend via the JSON Schema auto-generation from Rust structs - TypeScript bindings are auto-generated via the `#[derive(TS)]` macro ## Benefits - Prevents unexpected API charges for users with Claude subscriptions - Gives users explicit control over authentication method - Backward compatible - existing configurations continue to work unchanged - No frontend changes needed - the setting appears automatically in the ExecutorConfigForm ## Related - Addresses feature request in discussion #1228 - Design document: https://github.com/potable-anarchy/vibe-kanban-launcher/blob/main/DESIGN_PROPOSAL.md * cleanups rename the config parameter to `disable_api_key`. regenerate type bindings. * suggest using the setting in the api-key warning --------- Co-authored-by: Solomon <abcpro11051@disroot.org>
71 lines
1.3 KiB
JSON
71 lines
1.3 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"properties": {
|
|
"append_prompt": {
|
|
"title": "Append Prompt",
|
|
"description": "Extra text appended to the prompt",
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
],
|
|
"format": "textarea",
|
|
"default": null
|
|
},
|
|
"claude_code_router": {
|
|
"type": [
|
|
"boolean",
|
|
"null"
|
|
]
|
|
},
|
|
"plan": {
|
|
"type": [
|
|
"boolean",
|
|
"null"
|
|
]
|
|
},
|
|
"approvals": {
|
|
"type": [
|
|
"boolean",
|
|
"null"
|
|
]
|
|
},
|
|
"model": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"dangerously_skip_permissions": {
|
|
"type": [
|
|
"boolean",
|
|
"null"
|
|
]
|
|
},
|
|
"disable_api_key": {
|
|
"type": [
|
|
"boolean",
|
|
"null"
|
|
]
|
|
},
|
|
"base_command_override": {
|
|
"title": "Base Command Override",
|
|
"description": "Override the base command with a custom command",
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"additional_params": {
|
|
"title": "Additional Parameters",
|
|
"description": "Additional parameters to append to the base command",
|
|
"type": [
|
|
"array",
|
|
"null"
|
|
],
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"type": "object"
|
|
} |