Repository navigation
fix: triage batch (#699 Ctrl+D, #694 custom provider labels, #695 stale todo goals) - #701
Merged
Merged
Conversation
… profile, not Copilot (fixes #694)
A trial that never reached the model measures nothing, so retry it with linear backoff rather than letting a transient rate limit shrink the sample. The comparison runner now takes a trial count and honors PROVIDER, since free-tier providers throttle and budgeted ones run out mid-run.
This was referenced Aug 1, 2026
…2k Ollama over-report it found Adds tests/context_window_matrix.rs as a companion to provider_matrix.rs. The provider matrix sweeps auth/endpoint state; this one sweeps how a context window gets *resolved*, because that is where a specific recurring class of bug lives (#403, #447, #541, #577, #578, and the Ollama truncation just fixed). These bugs are all the same shape and all silent: one resolution source disagrees with another, the wrong one wins, jcode over-budgets the request, and the endpoint truncates without erroring. The user sees a model that "forgot" the conversation while the context gauge still looks healthy. Per-provider unit tests each covered their own case after the fact; this states the cross-cutting invariants once so newly added providers inherit the guardrail: - resolved windows are always plausible (never zero/absurd) - configured/cached windows beat generic family fallbacks (#541 shape) - resolution is deterministic (gauge and compaction budget cannot drift, #441) - provider hints never silently *widen* a window (narrowing is legitimate) - unknown models land on the declared default rather than something enormous - a cache entry for an unrelated model id cannot leak into resolution (#403) Each invariant was mutation-tested: reverting the corresponding fix makes the matching test fail, so these are load-bearing rather than decorative. That mutation testing exposed a real gap in the previous commit. Deleting the cold-cache Ollama clamp still passed every test, and writing the missing regression test revealed the clamp was ordered *below* the static open-weight family table. That table is what actually reported 262144 for `qwen3:*` on Ollama while the server served 4096, which is precisely the number the bug report described. The clamp now outranks the static family table while still losing to the live catalog and to an explicit per-model `context_window`, so a user who raises OLLAMA_CONTEXT_LENGTH and declares the window is still believed. Both directions are covered by tests. Ollama context tests move to their own file so the already-oversized openrouter_tests.rs does not keep growing. Verified end to end: cold server reports 4096, and after a model loads with OLLAMA_CONTEXT_LENGTH=16384 the catalog self-corrects to 16384.
Contributor
Greptile SummaryThis PR fixes several low-risk behavior issues and adds tests around them. The main changes are:
Confidence Score: 5/5Safe to merge with minimal risk. The changes are targeted and covered by focused tests. Reviewed control paths preserve the intended precedence and fallback behavior. No correctness or security issues were identified. Files Needing Attention: No files require special attention.
What T-Rex did
|
| Filename | Overview |
|---|---|
| crates/jcode-tui/src/tui/app/input.rs | Implements readline-style Ctrl+D forward-delete semantics for local input handling. |
| crates/jcode-tui/src/tui/app/remote/key_handling.rs | Applies the same Ctrl+D forward-delete behavior to remote key handling before interrupt/quit fallback. |
| crates/jcode-base/src/provider/catalog_routes.rs | Extends bare-model route resolution to user-defined OpenAI-compatible provider profiles. |
| crates/jcode-app-core/src/tool/todo.rs | Adds pruning for retained todo goals whose groups no longer exist. |
| crates/jcode-provider-openrouter-runtime/src/openrouter_provider_impl.rs | Reorders context-window resolution so Ollama defaults outrank static family heuristics while live and explicit limits still win. |
| tests/context_window_matrix.rs | Adds a hermetic context-window resolution suite covering precedence, determinism, defaults, and cache lookup behavior. |
| scripts/benchmark_discovery_rate.py | Adds retry and backoff handling for invalid benchmark trials. |
| scripts/verify_donut_still_animates.py | Forces idle animation on during verification and fails when the expected donut state is inactive. |
Sequence Diagram
sequenceDiagram
participant User
participant TUI as Local/Remote TUI
participant Todo as TodoTool
participant Routes as Catalog routes
participant OR as OpenRouterProvider
User->>TUI: Ctrl+D
alt input has text and app is idle
TUI->>TUI: forward-delete char under cursor
else empty input or processing
TUI->>TUI: existing quit/interrupt behavior
end
User->>Todo: write todos/goals
Todo->>Todo: merge stored + incoming goals
Todo->>Todo: prune goals without live todo groups
User->>Routes: select bare custom model id
Routes->>Routes: check built-in OpenAI-compatible profiles
Routes->>Routes: "fallback to named [providers.<name>] models/default"
Routes-->>User: "openai-compatible:<name> route"
User->>OR: request context window
OR->>OR: live in-memory/disk catalog
OR->>OR: explicit static_context_limits
OR->>OR: Ollama conservative serving default
OR-->>User: resolved context budget
Reviews (1): Last reviewed commit: "test(context): add a context-window reso..." | Re-trigger Greptile
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.
Autonomous triage batch: three low-risk fixes from newly reported issues.
#699 Ctrl+D should delete a character, not exit the session
Ctrl+Dwas aliased toCtrl+Cin both the local and remote key handlers, so it quit whenever the app was idle. It now follows readline convention: forward-delete while the input line has text, interrupt/quit only on an empty line. Covered bytests/issue_699_ctrl_d_delete.rs(4 tests, including a multibyte case).#694 Custom openai-compatible models tagged with a copilot prefix
Route resolution for bare model ids only consulted the built-in OpenAI-compatible profiles, never user-defined
[providers.<name>]entries from config.toml. Custom models therefore matched no known provider and fell through to the Copilot heuristic, which labelled them Copilot and built an unresolvablecopilot:<model>id.remote_openai_compatible_route_for_modelnow falls back to named config profiles, which also suppresses the bogus Copilot route (remote_model_should_offer_copilot_routereads through the same function).Three tests, including one that writes a real config.toml with the reporter's
omlxprofile and asserts the full picker route set contains the profile route and no copilot route.#695 Stale todos panel across tasks
merge_goalsintentionally retains goals a write does not mention, but nothing pruned goals whose todo group had disappeared, so assessments from a finished task lingered in the panel. Orphaned goals are now dropped when the todo list no longer contains their group; goals-only writes and flat (ungrouped) lists are unaffected.Four tests, including one that drives the real
TodoToolend to end: complete task one, start task two, then assert the stored todos and goals describe task two only.Verification
cargo test -p jcode-base --lib(1214 passed),-p jcode-app-core --lib(todo suite green),-p jcode-tui --libserially (2117 passed).cargo clippyand guardrail ratchets clean for the touched files; size baselines rebaselined only for the lines this branch adds.schema_advertises_intent_and_todos, which asserted a lowercaserequirement-to-checkagainst schema text that capitalises it.--- — Jcode agent (automated triage), on behalf of @1jehuang