Skip to content

Fix shell_and_cli command backstack test: clear history with @clear, keeping prior-session commands in the up-arrow back stack#2455

Merged
robgruen merged 4 commits into
dev/robgruen/ui_tweaksfrom
copilot/fix-github-actions-job-shell-and-cli
Jun 7, 2026
Merged

Fix shell_and_cli command backstack test: clear history with @clear, keeping prior-session commands in the up-arrow back stack#2455
robgruen merged 4 commits into
dev/robgruen/ui_tweaksfrom
copilot/fix-github-actions-job-shell-and-cli

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 6, 2026

The shell_and_cli (windows-latest, 22) job failed on the command backstack shell test — ArrowUp past the startup greeting surfaced @shell setWindowZoomLevel 100 (a command persisted by an earlier serial test) instead of clamping at the expected command.

Error: Wrong back stack command found!
Expected: "@greeting --mock"
Received: "@shell setWindowZoomLevel 100"

Root cause — the serial shell tests share one session, so the dispatcher's persisted display history (every prior run's commands) is replayed into the ArrowUp back stack on startup via ChatPanel.replayHistory(). The command backstack test was asserting against a clean stack and tripped over the leaked prior-session commands.

Per review feedback, prior-session commands should remain in the back stack — replaying them is the intended behavior. So instead of excluding them, the affected test starts from a clean slate by issuing @clear.

Changes

  • chatPanel.tsclear(): also reset the up-arrow back stack (commandHistory / historyIndex). @clear ("reset the chat") now clears the command recall history as well, so it can be used to start from an empty stack.
  • hostWindow.spec.tscommand backstack test: issue @clear at the start of the test so the shared-session back stack begins empty, then assert against this test's current-session commands (@history, @help, @config agent). The startup-greeting expectation was removed since @clear clears it along with the prior-session history.

The earlier exclusion-based commits on this branch (skipping replayed entries, @exit filtering, ArrowUp/ArrowDown delta swap) were reverted back to the base branch behavior, which keeps prior-session commands in the back stack.

Net effect: prior-session commands stay recallable in normal use, and the test deterministically walks [@config agent, @help, @history], clamping at @history.

Copy link
Copy Markdown
Collaborator

@robgruen robgruen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previous session commands should be in the back-stack of commands

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 7, 2026

previous session commands should be in the back-stack of commands

Agreed — reverted the change that excluded prior-session commands from the back stack, so replayed history is seeded into the up-arrow stack again (the base branch already does this). To keep the shared-session command backstack test deterministic I now issue @clear at the start of that test, and made ChatPanel.clear() also reset the back stack so @clear clears the recall history. (3d331ef, latest)

Copilot AI changed the title Fix shell_and_cli command backstack test: exclude prior-session history from the up-arrow back stack Fix shell_and_cli command backstack test: clear history with @clear, keeping prior-session commands in the up-arrow back stack Jun 7, 2026
Copilot AI requested a review from robgruen June 7, 2026 02:47
@robgruen robgruen marked this pull request as ready for review June 7, 2026 02:48
@robgruen robgruen merged commit 92cae45 into dev/robgruen/ui_tweaks Jun 7, 2026
1 check passed
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.

2 participants