Repository navigation
Fix scrollback CLI tests waiting past visible composer output - #1958
Conversation
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Approved. This synchronizes three scrollback CLI tests with the frame order the composer paints, so each wait now looks for text that is still ahead of the harness cursor.
The reorders match the failing CI transcript (run 44733342762): the repick close frame writes test / model · high before Ask anything..., the goal resume writes test / model before the ⏵⏵ Workspace write footer, and the save notice border is written before the root picker redraw. Terminal::until advances the cursor, so the old order consumed past the string each test then waited for.
The new wait in tui_models_picker_edits_only_the_subagent_model_policy observes the state the later assertion needs. Its cursor is already past the save notice and the root redraw, and while the notice is active every composer border carries it on the left; the next border with only dashes before the place label is therefore the notice clearing, which NOTICE_TTL guarantees (crates/dim-cli/src/ui/tui.rs:174, cleared by tick_at at :2180). That keeps the later Subagent model policy saved wait at crates/dimcode/tests/cli_flow.rs:12132 from matching a re-emitted first notice. HANG_GUARD stays the harness failure bound; the wait is not a step budget, and a notice that never clears still fails with the transcript.
No assertion was removed or weakened: both waits in the goal and repick tests remain, and the first save notice, the root footer rows, and the final saves array are unchanged. Locally on macOS the three tests pass, cargo fmt --check and adr-check pass, xtask check passes, and git merge-tree against ffd3e11 is clean. CI verify (linux) and macos-native were still pending at review time.
Merge-order note, not a defect in this diff: #1951 moves repicking_the_current_model_keeps_the_effort and tui_models_picker_edits_only_the_subagent_model_policy to crates/dimcode/tests/cli_tui_flow.rs (lines 1885 and 7121 on head 76059f7) and keeps the pre-fix order. If #1951 lands first, port both changes there; merge-tree against #1951 currently conflicts in crates/dimcode/tests/cli_flow.rs, so landing this PR first avoids losing the fix in the move.
zerob13
left a comment
There was a problem hiding this comment.
The three changes align the forward-only terminal cursor with the composer’s paint order without weakening the behavior assertions. All three targeted tests passed in local review. The third hosted attempt also passed Linux (including the staged-update test), macOS native, and the aggregate gate. That run tested merge bc858b27 against ffd3e116; subsequent main changes touch the scheduler and documentation, not these fixtures. Please carry the corrected wait order into the moved tests in #1951.
Fixes #1957
The scrollback Goal and model-reselection tests read the model label in the upper composer border before checking the prompt and footer. The subagent policy test observes the first save before the picker redraw and waits for its notice to clear before testing the second save.
Verified all three original timeout failures locally. The adjusted Goal, model-reselection and subagent-policy flows pass with the existing timeout and server request assertions.