Skip to content

test(tui): wait for operation ownership before steering in queue order test - #430

Merged
Lokesh7025 merged 1 commit into
RCfrom
fix/tui-queue-order-flake
Sep 25, 2026
Merged

Lokesh7025 merged 1 commit into
RCfrom
fix/tui-queue-order-flake

Conversation

@Lokesh7025

Copy link
Copy Markdown
Contributor

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 with timed 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 the session.send reply and has projected the active operation. A failing run logged this state at the moment of typing:

{"working":true,"sending":true,"awaiting":true,"activeRequest":"turn"}   // no activeOperationId

With no active operation, submit() skips queueDuringTurn and uses session.queue.enqueue. The screen showed · queued · follow A and so on, pendingTurnInputs stayed 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 condition submit() checks. The assertions are unchanged.

Verification

  • Before the fix: 8 of 10 isolated runs passed
  • After the fix: 30 of 30 isolated runs passed
  • Full test/app.test.ts: 55/55. tsc --noEmit, biome format and biome lint are clean

…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>
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: bdc00494-bf62-405b-ad9e-87dfc56dc759

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@Lokesh7025
Lokesh7025 merged commit ab0c365 into RC Sep 25, 2026
34 checks passed
@Lokesh7025
Lokesh7025 deleted the fix/tui-queue-order-flake branch September 25, 2026 05:50
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