Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #501.
Problem and Behavior
DeepSeek Harness is unavailable in CC-Switch, so its providers cannot be managed alongside Claude Code, Codex, and Gemini. This adds
--app dsh(aliasesdeepseekanddeepseek-harness) and complete provider management through the existing CLI and TUI: add, edit, copy, delete saved entries, import native configuration, switch, set a default model, discover models, check endpoints, query custom usage scripts, and export private JSON for reimport.Providers select an initialized DSH profile and configure API key, Base URL, protocol, model catalog, default model, reasoning effort, and native advanced options. The supported protocols are
deepseek,openai-completions,openai-responses, andanthropic-messages. All four DSH protocols query the provider API for model discovery. DeepSeek uses Bearer authentication against the OpenAI-compatible models endpoint, stripping a trailing/anthropic. The TUI displays the returned model list and imports selected models individually; CLIprovider fetch-modelsuses the same discovery behavior. DSH has a distinct blue accent in dark/light and truecolor/ANSI256 themes.Native Configuration and Safety
--config-file.Proxy takeover, failover, MCP, prompts, skills, sessions, and common snippets remain outside DSH provider management. Catalog-backed Pi AI routes require explicit protocol, credential reference, Base URL, and models before import. Remove conflicting launch
--patchoverrides before management. Dynamic provider expressions use the native DSH editor. Manual app visibility supports enabling the DSH tab in Settings.Validation
All tests that read or write application state used isolated homes/configuration directories.
NO_COLORremoved. Coverage includes DSH Models JSON editor Ctrl+S through the runtime dispatcher, reopen persistence, default-model replacement/preservation, invalid edits, complete API list presentation, single-model selection and duplicate prevention. Model discovery regressions verify protocol routing, Bearer authentication, all returned IDs, and/modelsto/v1/modelsfallback using local HTTP fixtures. Pagination accumulates and deduplicates all pages usinghas_more/last_idor GemininextPageToken, rejects missing/repeated cursors, and fails without partial results if a later page fails (41 model-fetch tests passed).cargo check --locked --lib --no-default-features), and release build passed.674b7bea.Existing Test/Lint Limitations
The full suite and standard Clippy are not reported as passing.
cargo test --no-fail-fastexecuted every test target. A clean serial run passed 4555 library tests with two ignored and the previously reproduced upstream foreground-migrator failure. DSH additions after that run passed focused verification.Previously reproduced baseline failures remain unchanged: the foreground migrator, two Codex synchronization tests, three Usage Query official-provider fixtures, and Clippy's
reversed_empty_rangesatcli/tui/ui/home_chart.rs:806. Clippy with that single existing lint allowed also completed.Other environment-sensitive integration failures include two prompt creation tests requiring a configured editor and a daemon lifecycle test timing out waiting for its socket; both also appeared in the earlier pre-expansion run. An inherited test-home override caused a completion failure that passed when removed. Parallel library runs expose shared environment/settings races; clean serial execution removed those failures.
Windows/macOS runtime behavior has not been exercised locally. Shared full-snapshot persistence still permits concurrent commands for different apps to overwrite state; this was reproduced on unchanged upstream paths. This PR serializes DSH operations with one another and does not redesign cross-app persistence.