test(tui): wait for operation ownership before steering in queue order test - #430
Conversation
…r test The injection-order test typed steering and follow-up input as soon as the fake model was called. The daemon reaches the model before the TUI has the session.send reply and has projected the active operation, so input typed in that gap took the pre-ownership path and was enqueued as plain prompts. The pending list never appeared and the test timed out waiting for "4. Follow-up: follow B" (about 1 run in 5). Wait for the TUI's projected activeOperationId, the same condition submit() checks before steering, before typing. The assertions are unchanged. Signed-off-by: Lokesh <lokeshselvam7025@gmail.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Problem
pending steering and follow-ups display their actual injection order above the editor(packages/tui/test/app.test.ts) failed about 1 run in 5 withtimed out waiting for ordered queue.Cause
The race is in the test's sync point, not in the queue rendering. The test starts typing once
calls === 1, but the daemon calls the model before the TUI has thesession.sendreply and has projected the active operation. A failing run logged this state at the moment of typing:With no active operation,
submit()skipsqueueDuringTurnand usessession.queue.enqueue. The screen showed· queued · follow Aand so on,pendingTurnInputsstayed empty, and the "Pending from this terminal" list was never drawn.Fix
Before typing, wait for the TUI's
sessionSubscription.projector.overview.activeOperationId, the same conditionsubmit()checks. The assertions are unchanged.Verification
test/app.test.ts: 55/55.tsc --noEmit,biome formatandbiome lintare clean