test: end-to-end coverage for the #694/#695 triage fixes, and fix a pre-existing red test - #702
test: end-to-end coverage for the #694/#695 triage fixes, and fix a pre-existing red test#7021jehuang wants to merge 6 commits into
Conversation
Greptile SummaryThis PR adds tests and a redraw scheduler fix for recent triage regressions. The main changes are:
Confidence Score: 5/5Safe to merge with minimal risk. The changes are mostly tests plus a focused redraw scheduling helper that preserves deep-idle behavior once both activity and user interaction are dormant. No new actionable correctness or security issues were found. Files Needing Attention: No files require special attention.
What T-Rex did
|
| Filename | Overview |
|---|---|
| crates/jcode-app-core/src/tool/todo.rs | Adds end-to-end todo panel tests and makes a schema assertion case-insensitive. |
| crates/jcode-base/src/provider/catalog_routes.rs | Adds custom openai-compatible profile routing tests for profile routes and Copilot exclusion. |
| crates/jcode-tui/src/tui/app/tests/issue_699_ctrl_d_delete.rs | Adds remote Ctrl+D tests for character deletion and empty-input quit behavior. |
| crates/jcode-tui/src/tui/redraw_schedule.rs | Updates deep-idle detection to require both stream dormancy and user-interaction dormancy. |
| crates/jcode-tui/src/tui/ui_tests/basic/redraw_cadence.rs | Adds redraw cadence tests for recently touched and dormant notice screens. |
| scripts/code_size_budget.json | Rebaselines code size limits for touched files. |
| scripts/test_size_budget.json | Rebaselines the TUI test size limit. |
Sequence Diagram
sequenceDiagram
participant User
participant TUI as TUI event loop
participant Scheduler as redraw_schedule
participant Todo as TodoTool tests
participant Provider as Catalog route tests
User->>TUI: Recent key/input activity
TUI->>Scheduler: time_since_activity + time_since_user_interaction
Scheduler-->>TUI: Not deep idle until both exceed threshold
Todo->>Todo: Write task one, then task two
Todo-->>Todo: Assert stored todos/goals only describe task two
Provider->>Provider: Load custom config profile
Provider-->>Provider: Assert openai-compatible route and no copilot route
Reviews (3): Last reviewed commit: "fix(tui): stop treating a just-touched n..." | Re-trigger Greptile
|
Added live verification against a real running binary (not just unit tests), using the debug socket to inject keys into an actual TUI client on this branch's build:
Also extended coverage since the first push: the remote key handler (the path the normal --- — Jcode agent (automated triage), on behalf of @1jehuang |
The deep-idle gates (donut activation, tick cadence, and the periodic-redraw short-circuit) keyed solely off time_since_activity(), which reports 'already past the deep-idle threshold' for any non-empty transcript that has never streamed in this process. That is intended for restored dormant sessions, but it also matched a brand-new session the moment onboarding left its 'here are a few things you can try' notice: the client parked at the 5s crawl and the decorative idle animation never ran on the exact screen it was designed for, even with idle_animation enabled. Deep idle now additionally requires no user interaction for the same 30s window (deep_idle_dormant). A session with no interaction recorded behaves exactly as before, so restored dormant tabs still crawl. The live verifier had a matching blind spot: it only checked animation health when the donut was already active, so 'donut never activates' passed as OK, and its temp home got the new default-off config. It now opts in via JCODE_IDLE_ANIMATION=1 and fails when the donut is inactive on the welcome screen. Verified live with scripts/verify_donut_still_animates.py: donut active, 33ms cadence, 14 moving rows, 31 partial repaints/s on the welcome screen; /resume overlay still static at 250ms.
Follow-up to #701, which merged while these were still being written.
The three fixes in #701 landed with unit tests. This adds the end-to-end coverage that exercises the real user-visible paths, plus a fix for one pre-existing red test.
End-to-end regression guards
TodoToolthrough the reporter's scenario. Complete task one, start task two, then assert the stored todos and goals describe task two only. This is what the todos panel renders, so it covers the reported symptom rather than just the helper.openai-compatiblemodels incorrectly tagged withcopilot:prefix in model picker #694: writes a real config.toml containing the reporter'somlxprofile, then asserts the full picker route set (remote_model_routes_fallback) contains theopenai-compatible:omlxroute and no copilot route at all.Both tests were confirmed to fail when their fix is temporarily reverted, so they are real regression guards rather than tests shaped to match the implementation.
Pre-existing red test
schema_advertises_intent_and_todosasserted a lowercaserequirement-to-checkagainst schema text that starts the sentence withRequirement-to-check, so it failed on master independently of any of this work. Now compared case-insensitively.Verification
cargo test -p jcode-base --lib(1214 passed),-p jcode-app-core --lib tool::todo(38 passed),-p jcode-tui --libserially (2117 passed), clippy clean for the touched crates. Size ratchets rebaselined only for the lines this branch adds.--- — Jcode agent (automated triage), on behalf of @1jehuang