Skip to content

fix: add DeepSeek 1M context limit + fix opencode setup_url#102

Open
angziii wants to merge 1 commit into
1jehuang:masterfrom
angziii:fix/issue-87-89-deepseek-setup-url
Open

fix: add DeepSeek 1M context limit + fix opencode setup_url#102
angziii wants to merge 1 commit into
1jehuang:masterfrom
angziii:fix/issue-87-89-deepseek-setup-url

Conversation

@angziii
Copy link
Copy Markdown

@angziii angziii commented May 2, 2026

Summary

Two small fixes:

1. Add DeepSeek to context limit fallback (fixes #87)

DeepSeek V4 models support a 1M token context window, but fallback_context_limit_for_model() had no entry for them. Direct DeepSeek API users were capped at the 200k default instead of getting the full 1M context.

2. Fix opencode-zen / opencode-go setup_url (fixes #89)

The setup_url for these profiles pointed to opencode.ai/docs/providers, which was confusing for jcode users who saw opencode documentation links in jcode's UI. Changed to point to the jcode installation docs.

Changes

  • src/provider/models.rs: +4 lines for deepseek 1M context
  • crates/jcode-provider-metadata/src/lib.rs: 2 lines, updated setup_url strings

Test plan

  • DeepSeek models now resolve to 1,000,000 context limit instead of 200,000
  • opencode-zen and opencode-go setup_url no longer contains opencode.ai

View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

- Add deepseek model to fallback_context_limit_for_model() with 1M
  token context window to match DeepSeek V4's supported limits
- Change opencode-zen and opencode-go setup_url from opencode.ai
  to jcode GitHub docs, since users are running jcode not opencode

Closes 1jehuang#87
Closes 1jehuang#89
zombi3butt pushed a commit to zombi3butt/jcode that referenced this pull request May 22, 2026
DeepSeek's current generation (deepseek-v4 / deepseek-v4-flash and the
deepseek-coder variants) advertises a 1M-token context window via its
published rate-limit metadata, but `context_limit_for_model_with_provider_and_cache`
in jcode-provider-core had no DeepSeek branch. Returning `None` made
the usage overlay and compaction heuristics fall back to a smaller
generic default until the dynamic /models cache happened to fill in.

Add an explicit branch returning `Some(1_000_000)` for any model id
starting with "deepseek". Cached/online catalog hits continue to take
precedence (see the cached_context_limit hook just above).

Test `context_limit_falls_back_to_1m_for_deepseek_models` covers
deepseek-v4, deepseek-v4-flash, deepseek-chat, and the cache-precedence
case.

Ports the `src/provider/models.rs` portion of upstream PR
1jehuang#102 (the opencode setup_url
hunk in the same upstream PR is NOT applied here — it conflicts with
issue quangdang46#80 / upstream PR quangdang46#91 and will be ported there with the right
fork-specific URL).
Closes quangdang46#87
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: point opencode-zen and opencode-go setup_url to jcode docs Add deepseek to fallback_context_limit_for_model with 1M context

1 participant