Skip to content

Standardize on ~/.deepseek config and add explicit HTTP gateway support#1341

Closed
hhhaiai wants to merge 10 commits into
Hmbown:mainfrom
openChatGpts:feat/user-config-http-sync
Closed

Standardize on ~/.deepseek config and add explicit HTTP gateway support#1341
hhhaiai wants to merge 10 commits into
Hmbown:mainfrom
openChatGpts:feat/user-config-http-sync

Conversation

@hhhaiai
Copy link
Copy Markdown
Contributor

@hhhaiai hhhaiai commented May 10, 2026

Summary

  • make runtime use ~/.deepseek/config.toml as the default config source instead of auto-loading workspace-local .deepseek/config.toml
  • keep legacy root aliases (baseurl, model) working and add allow_insecure_http = true for trusted non-local http://... gateways
  • add a fork-only workflow that fast-forwards openChatGpts/DeepSeek-TUI from upstream main every 3 hours when the fork has not diverged
  • include the already-verified skills prompt precedence fix so the branch stays green against the current upstream test baseline

Why

The target workflow here is:

  1. put base_url / default_text_model / key defaults in ~/.deepseek/config.toml
  2. support trusted self-hosted HTTP gateways without silently allowing all remote HTTP endpoints
  3. keep the fork's main branch synced from upstream automatically on a 3-hour cadence

The 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-features
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features

Notes

  • No manual TUI UI flow changes were required
  • The sync workflow is guarded so it only runs in openChatGpts/DeepSeek-TUI

hhhaiai added 7 commits May 10, 2026 00:56
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
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@Hmbown
Copy link
Copy Markdown
Owner

Hmbown commented May 10, 2026

Thanks for the comprehensive PR, @hhhaiai.

This bundles two distinct changes that I'd like to handle separately:

  1. Standardize on ~/.deepseek/ as the default config source instead of auto-loading workspace-local .deepseek/config.toml. This is a behavior change to a path users depend on. It needs an explicit deprecation note + a fallback period where workspace-local still works with a warning, before we flip the default. Substantial enough to deserve its own focused PR + discussion thread.

  2. Explicit HTTP gateway support — a clean addition that probably wants to land alongside the existing *_BASE_URL env-var work (the v0.8.27 fix for set base_url for ollama & vllm #1308 from @reidliu41). Could be a smaller scoped PR on its own.

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.

@hhhaiai hhhaiai force-pushed the feat/user-config-http-sync branch from 306c167 to fd725e7 Compare May 12, 2026 09:46
hhhaiai added 2 commits May 12, 2026 18:16
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
@Hmbown
Copy link
Copy Markdown
Owner

Hmbown commented May 23, 2026

This PR was opened before the v0.8.41 rebrand and is now stale. Feel free to rebase onto current main and reopen. 鲸鱼兄弟们等你 🐋

@Hmbown Hmbown closed this May 23, 2026
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.

2 participants