Skip to content

fix(deeplink): preserve custom env fields when importing Claude providers#266

Draft
thedavidweng wants to merge 1 commit into
SaladDay:mainfrom
thedavidweng:fix/261-deeplink-preserve-custom-env-fields
Draft

fix(deeplink): preserve custom env fields when importing Claude providers#266
thedavidweng wants to merge 1 commit into
SaladDay:mainfrom
thedavidweng:fix/261-deeplink-preserve-custom-env-fields

Conversation

@thedavidweng

Copy link
Copy Markdown
Contributor

Summary

When importing Claude providers through deeplinks (ccswitch://v1/import?...), custom environment variables were silently dropped. build_claude_settings constructed env from scratch with only known keys (ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, model keys), discarding any user-defined variables like ANTHROPIC_CUSTOM_HEADERS or proxy settings.

The CLI/TUI provider creation path already preserved these fields by cloning existing settings — this fix brings the deeplink import path to parity.

Changes

src-tauri/src/deeplink/mod.rs

  • Add custom_env: Option<Map<String, Value>> field to DeepLinkImportRequest

src-tauri/src/deeplink/provider.rs

  • In merge_claude_config: collect non-standard env keys into custom_env
  • In build_claude_settings: merge custom_env entries into the output env

Closes #261

…ders

When importing Claude providers through deeplinks, custom environment
variables (e.g. ANTHROPIC_CUSTOM_HEADERS, proxy settings) were silently
dropped because build_claude_settings constructed env from scratch with
only known keys.

- Add custom_env field to DeepLinkImportRequest to carry unknown env keys
- In merge_claude_config, collect non-standard env keys into custom_env
- In build_claude_settings, merge custom_env into the output env object

Closes SaladDay#261
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.

fix(deeplink): custom env fields lost when importing Claude providers

1 participant