Repository navigation
fix(custom-model): context limits, Codex model override, context discovery and picker filter - #752
Conversation
|
Thank you for this, Devvyn, and for the careful issue write-ups behind it. This PR passes known context limits to OpenCode, Codex and DeepSeek, makes Codex launch on the selected custom model, reads context sizes from 1. Boot recovery skips 2. A listed figure overwrites a 3. DeepSeek transcripts end up in a directory that gets deleted ( 4. The 5. Docs. 6. Codex and Smaller things, fine to fold in: On scope: CONTRIBUTING asks for one change per PR. The Anthropic endpoint type and the DeepSeek rewrite have no issue behind them, and the endpoint type has an open design question: Once those are addressed, this is ready for another review. |
… default context length Fixes Ark0N#754
… injection - share one context-length resolution (discovered figure, endpoint default fallback) across the routes and boot recovery, with a recovery test - record listed per-slot context figures with a slot count of 1 and force the slot-count fallback once per rediscovery - open up the codex model launch token for qwen3-style ids (model-plain-colon), pinned by a spawn-golden case - pass the full discovered window to opencode as limit.context - translate the picker search strings and document the discovery precedence
36f620c to
1b8ac40
Compare
|
Pushed 1b8ac40, and split the PR as asked.
Each branch is based on master and stands alone. #752 and #755 touch the same recipe lines in |
|
Thank you, Devvyn, for the quick turnaround and for splitting this so cleanly. This PR now carries the core of the work: discovered context limits for OpenCode and Codex, Codex launching on the selected model (colon ids included), context discovery from A few small things remain:
Smaller, fine to fold in:
None of this changes the direction. Items 1, 2, 4 and 5 are the changes to make; the docs ones are small enough that they can also be applied at merge time. Beyond those, what remains is the question in item 3 and which of this PR and #755 merges first, both still open. |
|
Thank you, Devvyn, for the follow-up push. This PR passes discovered context limits to OpenCode and Codex, launches Codex on the selected custom model (colon ids included), reads context sizes from The latest commit (5211f38) adds the "In use by a session" promotion, but none of the round-two items made it in. What still needs to change:
Docs that can also be applied at merge time if they are not in your next push (round-two items 1 and 5):
Fine to fold in: Still open on my side, not a change request: whether Codex and OpenCode should receive the per-slot window rather than the whole KV pool (round-two item 3), and which of this PR and #755 merges first. Once the Codex test, the id-shape note, the changeset and the split are in, what remains before merge is those two open questions. |
|
Pushed 39d211f, thanks.
Item 3 (whole pool or one slot for Codex and OpenCode) I left alone as the open question; my own view is that the per-slot window is the safer figure for both, since it does not change with the sweep timing, but that is your call and I will do it here or later as you prefer. I rebased onto 5211f38 (the picker change that landed on this branch). Full |
|
Thank you, Devvyn, for the quick follow-up push. This PR passes discovered context limits to OpenCode and Codex, launches Codex on the selected custom model (colon ids included), reads context sizes from Every round-two item is in at this head: the
Smaller, fine to fold in (otherwise I will apply them at merge time):
For a later PR, not this one: the quick-start path writes the launch model into the stored Two questions are still open on my side, not change requests:
Once items 1 to 4 are in, what remains before merge is those two questions. |
…rite Round-four review item 3: the swap route wrote the new config.toml into the very dir a live codex session uses as CODEX_HOME before checking the pattern, and its refusal then deleted that dir. buildCustomModelInjection is pure, so the check runs on its result and a refused id never touches the filesystem. Pinned by a two-apply codex route test.
Round-four review item 4: focusing the search input on every picker open raises the OS keyboard over the list on phones; guard it the way readmymind-ui.js does.
…r routes and schema Round-four review smaller item: the discovery comment claimed a shared ceiling while schemas.ts restated the literal twice; the constant now lives in schemas.ts (routes already import from it, no cycle) and both bounds reference it.
…ed figure wins Round-four review smaller items: api-reference now states the opposite-of-apiKey behaviour for an omitted defaultContextLength, and the wiki sentence follows the code, modelContextLengths[id] ?? defaultContextLength: any stored figure beats the default.
Round-four review smaller item: one getCustomModelForPersist().launchModel expectation, like the pi/grok/omp tests beside it, pins Ark0N#750 on the one-shot path.
39d211f to
884e67d
Compare
|
Pushed 884e67d, thanks. Your round-three and my push did cross; here it is in one place.
Smaller ones: The two open questions stay with you; for the first, my view is unchanged (the per-slot window is the safer figure for Codex and OpenCode). Full |
|
Thank you, Devvyn, for the round-four push. This PR passes the endpoint's context window to OpenCode and Codex, launches Codex on the selected custom model (colon ids included), reads context sizes from Every round-three item is in at this head: the in-use work moved to #757, this PR has its own changeset, the swap route checks the forced launch id before any write (and the new test proves the config dir survives a refused id), and the search box no longer takes focus on touch devices. Typecheck, lint, format, the frontend syntax check, the public-asset check, the CLI catalogue check and the touched test files are green here. Three small things I will tidy at merge time unless you get to them first:
Two questions are still open on my side, not change requests:
Nothing else is needed from you on this PR. |
Replace the deepseek env redirect with a deepseek-patch-json recipe: a per-session DSH_HOME holding a generated cordis.patch.yml that declares a codeman-custom openai-completions provider over the installed profile. Ported from PR #752 commits 941df57 and 4bb1bfe, minus the core context-limit changes.
The launch-id check is pure, so it now runs before the context warning and the swap confirmation: nobody agrees to evict a model only to get the 400. Also the search-box and in-use comments, the model-plain-colon wording, and the wiki's order of the picker's marks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a model (#752) The dedicated route got this order at merge and quick-start kept the old one, so a user could agree to a swap only to get the 400. It also runs on the pure build now, so a refused id writes no config dir to clean up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you, Devvyn, this is in the 1.48.0 release. The launch-id check now runs before the context warning and the swap confirmation on both the swap route and quick-start, and the tidies from round four are in. The per-slot window question for Codex and OpenCode is still open on my side. |
Fixes #749, #750 and #754.
Split from the original version of this PR at the maintainer's request, so these fixes no longer wait on two separate decisions. The Anthropic endpoint type and the DeepSeek rewrite now have their own PRs (linked below once opened).
Changes
limit.context(the full window) andlimit.outputfrom the discovered context length.:after a leading alphanumeric, soqwen3:32blaunches), andmodel_context_windowis set.context_length, elsecontext_window, from each/v1/modelsentry, so gateways such as Bifrost in front of llama-swap get real sizes. The llama-swap/runninglaunch command and/propsstill win for a loaded model. A listed figure is a per-slot window, so it is stored with one slot and can no longer pair with a slot count from an earlier loaded round. A per-endpointdefaultContextLengthcovers models whose size cannot be discovered, and discovery never overwrites it.docs/api-reference.md,docs/custom-model-endpoints.md,docs/architecture-invariants.md.Review items from the first round
Items 1, 2, 5 (core docs), 6 and the smaller ones are in. Items 3 and 4 (DeepSeek) moved with the DeepSeek rewrite.
Verification
npm run typecheck,lintandformat:checkare clean.npm teston this branch: 666 files passed, 13,530 tests passed, 12 skipped, 0 failed.