microsoft / microsoft/intelligent-terminal
Autofix card not dismissed by Esc (intermittent; E2E-discovered)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2k
- Forks
- 159
- Avg merge
- 21h 42m
- Merged PRs (30d)
- 120
Description
Discovered by the ItE2E end-to-end suite (
test/e2e/), running against the Store packageMicrosoft.IntelligentTerminal_8wekyb3d8bbwe(v0.1.1681.0) with thecopilotagent. Filing for triage — it is unclear yet whether this is a product bug or an E2E assertion weakness; both hypotheses are below.
Summary
The autofix suggestion card ("[ Run command ] / Insert in Terminal") sometimes fails to disappear after the user presses Esc. The E2E "reject/dismiss" check pressed Esc up to 5 times (800 ms apart) and the card text was still present, so the assertion that the card is gone failed.
This is intermittent: the same test has passed in prior runs (it is counted among the green feature cases in test/e2e/README.md), and failed in this session's run — i.e. it is flaky, which on its own is worth fixing because a release-gating E2E should be deterministic.
Failing test
- File:
test/e2e/tests/Feature.AutofixPane.Tests.ps1:41-43 - Checklist item:
doc/release-check-list.md§3 "Reject/dismiss works" (tagged[UT✓] [E2E]).
It 'Reject/dismiss works (Esc closes the card)' {
for ($i = 0; $i -lt 5 -and (& $script:CardShown); $i++) { Send-AgentKey -App $script:app -Key Escape | Out-Null; Start-Sleep -Milliseconds 800 }
(& $script:CardShown) | Should -BeFalse
}
# $script:CardShown = { (Get-AgentPaneText -App $app -MaxLines 60) -match 'Run command|Insert in Terminal' }
Observed vs expected
| Expected | After Esc (at most twice), the autofix card is dismissed and no longer rendered in the agent pane. |
| Observed | After 5× Esc (4 s total), the pane buffer still matches Run command|Insert in Terminal. Assertion failed: Expected $false, but got $true at line 43. |
Run evidence (this session): Tests Passed: 9, Failed: 1 for Feature.AutofixPane.Tests.ps1; the only failure was this case. All other autofix cases (render, insert, run, stashed, split, cleanup) passed.
Reproduction
pwsh -File test/e2e/Invoke-ItE2EReport.ps1 -Path test/e2e/tests/Feature.AutofixPane.Tests.ps1
# (requires the Store/Dev IT package installed + an authenticated `copilot` on PATH)
Because autofix de-dupes identical failures and a displayed card suppresses the next autofix, reproduction is timing-sensitive; re-run a few times.
Code pointers / hypotheses
The agent pane (wta-helper ratatui TUI) handles Esc as an ordered match with guards in App::handle_key (tools/wta/src/app.rs). The relevant arms, in evaluation order:
KeyCode::Esc if self.show_notification_banner→dismiss_notifications()— app.rs:6567KeyCode::Esc if recommendations().is_some() || (autofix.pane_id.is_some() && !turn.is_idle())→turn_cancel()(dismisses the armed fix card) — app.rs:6570KeyCode::Esc if autofix.suggested_pane_id.is_some()→ clearssuggested_pane_id— app.rs:6606KeyCode::Esc =>→clear_input()— app.rs:6611
Because arm (1) precedes the card-dismiss arm (2), the first Esc only dismisses the notification banner; the card needs a second Esc. That matches the known "Esc needs up to 2 presses" behavior. But 5 presses still not clearing the card points to one of:
- Hypothesis A — product bug: the bottom-bar notification banner (
show_notification_banner) is re-raised every frame while the card is armed, so everyEscis consumed by arm (1) and arm (2) is never reached → the card is undismissable byEsc. If so, fix the arm ordering / guard so a singleEscthat has an armed card routes toturn_cancel(or don't re-arm the banner while the card owns dismissal). - Hypothesis B — E2E false positive:
Escdoes dismiss the active card, but the dismissed card leaves its text ("Run command" / "Insert in Terminal") in the chat transcript / scrollback, so theCardShownregex over the last 60 lines still matches stale text. If so, the test should assert on the active card region (e.g. the bordered card / button row) rather than a substring of the whole buffer — and the product is fine.
Triage should determine which. A quick check: after pressing Esc, capture the pane and see whether the matched text is inside the live card border or in the scrolled-back transcript.
Suggested labels
Issue-Bug, Area-AutoFix, Area-AgentPane
Notes for whoever picks this up
- Related UT (logic half is unit-covered):
trigger_echo_pane_clears_when_state_returns_to_idleandturn_cancelintools/wta/src/app.rs. The gap is specifically the interactiveEsc→ dismiss path end-to-end. - If Hypothesis B is confirmed, please also update
test/e2e/tests/Feature.AutofixPane.Tests.ps1:41-43to scopeCardShownto the active card so the E2E stops flaking.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tools/wta/src/app.rs:6567-6611 and the Esc handling order, then run test/e2e/Invoke-ItE2EReport.ps1 -Path test/e2e/tests/Feature.AutofixPane.Tests.ps1. Capture the pane after Esc to determine whether the active card remains or only stale transcript text matches. Done means identifying whether the product or Feature.AutofixPane.Tests.ps1:41-43 needs correction and making the reject/dismiss check deterministic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, rust
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100