fix: add DeepSeek 1M context limit + fix opencode setup_url#102
Open
angziii wants to merge 1 commit into
Open
Conversation
- 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
This was referenced May 21, 2026
Closed
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
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.
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_urlfor these profiles pointed toopencode.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 contextcrates/jcode-provider-metadata/src/lib.rs: 2 lines, updated setup_url stringsTest plan
opencode.aiNeed help on this PR? Tag
@codesmithwith what you need.