Skip to content

test: end-to-end coverage for the #694/#695 triage fixes, and fix a pre-existing red test - #702

Open
1jehuang wants to merge 6 commits into
masterfrom
agent/triage-verification-tests
Open

test: end-to-end coverage for the #694/#695 triage fixes, and fix a pre-existing red test#702
1jehuang wants to merge 6 commits into
masterfrom
agent/triage-verification-tests

Conversation

@1jehuang

@1jehuang 1jehuang commented Aug 1, 2026

Copy link
Copy Markdown
Owner

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

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_todos asserted a lowercase requirement-to-check against schema text that starts the sentence with Requirement-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 --lib serially (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

@greptile-apps

greptile-apps Bot commented Aug 1, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds tests and a redraw scheduler fix for recent triage regressions. The main changes are:

  • End-to-end todo tests for replacing completed task state with the next task.
  • Custom provider route tests to keep openai-compatible profiles from being offered as Copilot routes.
  • Remote Ctrl+D tests for delete-vs-quit behavior.
  • Deep-idle scheduling now considers recent user interaction as well as stream activity.
  • Size-budget baselines are updated for the added code and tests.

Confidence Score: 5/5

Safe 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.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the regression suites and confirmed both todo-tool-regression and catalog-routes-regression completed with exit code 0 and all tests passing.
  • Checked the Git repository state and observed a modified Cargo.lock file and untracked internal directories after dependency resolution.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

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
Loading

Reviews (3): Last reviewed commit: "fix(tui): stop treating a just-touched n..." | Re-trigger Greptile

Comment thread crates/jcode-base/src/provider/catalog_routes.rs
@1jehuang

1jehuang commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

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:

  • Input hello, cursor at end, Ctrl+D: input stays hello, process does not exit.
  • Cursor moved left twice, Ctrl+D: input becomes helo with the cursor held at position 3.
  • Empty input, two rapid Ctrl+D presses: the client exits, so the intentional quit path is preserved.

Also extended coverage since the first push: the remote key handler (the path the normal jcode TUI actually uses, since it runs as a client with is_remote = true), both model-route sources for #694, and the stale ungrouped goal that the todos panel renders unconditionally for #695.

--- — 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.
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.

1 participant