Standardize on ~/.deepseek config and add explicit HTTP gateway support#1341
Standardize on ~/.deepseek config and add explicit HTTP gateway support#1341hhhaiai wants to merge 10 commits into
Conversation
Runtime now ignores workspace-local .deepseek overlays and only resolves config from ~/.deepseek/config.toml unless an explicit config path/env override is provided. The runtime URL validator also accepts configured http:// gateways by default so self-hosted endpoints work without an extra env flag. Constraint: Keep the patch minimal to reduce conflicts when syncing upstream Rejected: Touching wider config-store plumbing | the runtime merge/validation points are the narrowest fix Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep repo-local .deepseek config disabled unless the single-source config policy intentionally changes Tested: cargo build --release; cargo clippy -p deepseek-tui --all-targets --all-features -- -D warnings; temp-workspace doctor --json checks for user-config-only resolution Not-tested: Full workspace cargo test --workspace --all-features
Add a scheduled workflow that fetches Hmbown/DeepSeek-TUI main and fast- forwards openChatGpts/DeepSeek-TUI main when the fork has not diverged. This keeps the mirror current without overwriting fork-only history. Constraint: Sync cadence requested is every 3 hours on the fork main branch Rejected: Force-pushing upstream over fork main | could silently destroy fork-only commits Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep custom development off main if this auto-sync workflow should remain conflict-free Tested: YAML parse check; gh repo view openChatGpts/DeepSeek-TUI --json defaultBranchRef; gh repo view Hmbown/DeepSeek-TUI --json defaultBranchRef Not-tested: Live GitHub Actions execution in the fork repository
The scheduled sync workflow should operate only in openChatGpts/DeepSeek-TUI. Adding a job-level repository guard prevents accidental runs in upstream or other forks while keeping the rest of the sync logic unchanged. Constraint: The sync automation is intended only for openChatGpts/DeepSeek-TUI Rejected: Broad not-upstream guard | targeting the exact fork is safer and avoids surprising other forks Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep the repository guard aligned with the intended fork if ownership ever changes Tested: ruby -e 'require yaml; YAML.load_file(.github/workflows/sync-upstream.yml)' Not-tested: Live GitHub Actions run after push
Add an inline note explaining that the sync workflow's concurrency group is intentionally single-lane: one run may execute while at most one additional run waits in the queue. Constraint: Keep the workflow behavior unchanged while making the queue policy explicit Rejected: Reworking the workflow logic | the existing concurrency settings already satisfy the requirement Confidence: high Scope-risk: narrow Reversibility: clean Directive: Preserve cancel-in-progress=false unless the queueing policy intentionally changes Tested: ruby -e 'require yaml; YAML.load_file(.github/workflows/sync-upstream.yml)' Not-tested: Live workflow execution after push
Users can already point provider-scoped configs at OpenAI-compatible gateways, but root-level compatibility fields were stricter than the legacy DeepSeek TUI format. This keeps old root configs working by accepting baseurl/model aliases, documents the canonical keys, and locks the behavior with focused tests in both config loaders.\n\nConstraint: Must stay backward compatible with existing ~/.deepseek/config.toml files and self-hosted http:// endpoints\nRejected: Support aliases only in docs | existing user configs would still fail at runtime\nConfidence: high\nScope-risk: narrow\nReversibility: clean\nDirective: Keep root compatibility aliases aligned between crates/config and crates/tui loaders\nTested: cargo fmt --all --check; cargo clippy --workspace --all-targets --all-features; cargo test -p deepseek-config tests::root_baseurl_alias_and_model_field_resolve_for_deepseek -- --exact; cargo test -p deepseek-tui config::tests::root_baseurl_and_model_aliases_load_from_config_file -- --exact\nNot-tested: Full cargo test --workspace --all-features remains blocked by pre-existing skills::tests::render_available_skills_context_for_workspace_picks_up_cross_tool_dirs failure
This workspace writes orchestration state under .omx during normal agent runs. Ignoring that directory avoids accidental status noise and keeps runtime checkpoints from being mistaken for source changes.\n\nConstraint: OMX writes ephemeral local state into .omx/ during normal development flows\nRejected: Leave .omx unignored | local runtime files would keep polluting git status\nConfidence: high\nScope-risk: narrow\nReversibility: clean\nDirective: Do not track generated .omx state unless a future feature intentionally versions a stable artifact under a different path\nTested: git status --short reflects only source changes before commit split\nNot-tested: None
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Thanks for the comprehensive PR, @hhhaiai. This bundles two distinct changes that I'd like to handle separately:
If you're open to splitting this in two — the gateway-support part is likely a near-term landing candidate, while the path-standardization needs the longer roadmap discussion. Either way, leaving this open and tagged v0.9.x while we work out the split. |
306c167 to
fd725e7
Compare
The earlier self-hosted gateway work needed two follow-ups to be upstreamable: remote plain HTTP still had to be an explicit trust decision, and the runtime needed to match the user-facing contract that configuration comes from `~/.deepseek/config.toml` rather than workspace-local overlays. This keeps legacy root aliases (`baseurl`, `model`) working, adds `allow_insecure_http = true` as an explicit config-level opt-in for trusted non-local HTTP gateways, preserves the one-off env override, and updates the runtime/docs so provider, base URL, model, and key are taken from the user config unless the user explicitly overrides them via CLI or env. Constraint: Must support trusted non-local http:// gateways without silently widening the default credential exposure boundary Constraint: The runtime should treat ~/.deepseek/config.toml as the default source of provider, key, base URL, and model Rejected: Allow every remote http:// base URL by default | would reintroduce a credential-exposure regression Rejected: Keep workspace-local .deepseek overlays active | conflicts with the requested single-source user config model Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep remote HTTP support behind an explicit trust signal and keep user-config docs aligned with runtime behavior Tested: cargo test --all-features; cargo fmt --all -- --check; cargo clippy --all-targets --all-features Not-tested: Live GitHub Actions execution of the fork sync workflow
4671b90 to
9ee55e1
Compare
|
This PR was opened before the v0.8.41 rebrand and is now stale. Feel free to rebase onto current |
Summary
~/.deepseek/config.tomlas the default config source instead of auto-loading workspace-local.deepseek/config.tomlbaseurl,model) working and addallow_insecure_http = truefor trusted non-localhttp://...gatewaysopenChatGpts/DeepSeek-TUIfrom upstreammainevery 3 hours when the fork has not divergedWhy
The target workflow here is:
base_url/default_text_model/ key defaults in~/.deepseek/config.tomlmainbranch synced from upstream automatically on a 3-hour cadenceThe previous attempt widened remote HTTP too far and left the docs out of sync with the runtime config behavior. This version keeps HTTP support explicit, updates the docs, and preserves the requested single-source user config model.
Testing
cargo test --all-featurescargo fmt --all -- --checkcargo clippy --all-targets --all-featuresNotes
openChatGpts/DeepSeek-TUI