test: add golden e2e tests for agent TUI launch and shell recovery - #14258
test: add golden e2e tests for agent TUI launch and shell recovery#14258AmethystLiang wants to merge 1 commit into
Conversation
Add test fixtures and E2E tests to verify agent TUI functionality: - Stub agent implementation supports cross-platform execution (Unix/Windows) - Test verifies multiline composer with Shift+Enter support in agent TUI - Test verifies clean shell resumes after agent exit without state leakage
📝 WalkthroughWalkthroughAdds cross-platform wrappers for the golden stub agent. Implements a raw-mode terminal UI with multiline input, submission, exit handling, signal cleanup, and terminal restoration. Adds shared helpers for agent configuration, launch, environment setup, and readiness checks. Adds end-to-end tests for agent-tab launch, multiline composition, clean agent exit, new shell creation, command execution, and tab-count validation. Mergeability Score: 🟡 Moderate · up to The shell-recovery test may pass without proving that the shell executed the command after the agent exits, reducing confidence in the behavior it is intended to protect. The assertion should be corrected before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 93f1bfc2-4c43-4136-85b0-691a5363acfa
📒 Files selected for processing (8)
tests/e2e/fixtures/golden-stub-agent/codextests/e2e/fixtures/golden-stub-agent/codex.cmdtests/e2e/fixtures/golden-stub-agent/golden-stub-agenttests/e2e/fixtures/golden-stub-agent/golden-stub-agent.cmdtests/e2e/fixtures/golden-stub-agent/golden-stub-agent.jstests/e2e/golden-agent-tui-launch.spec.tstests/e2e/golden-shell-after-agent-exit.spec.tstests/e2e/helpers/golden-stub-agent.ts
Problem
No e2e tests exist to verify agent TUI launch, multiline input handling, or shell recovery after agent exit.
Solution
Add e2e tests using a cross-platform stub agent that simulates the TUI interface.
ELI5
Adds tests that verify: (1) an agent TUI launches correctly with a multiline composer, and (2) the user returns to a working shell after the agent exits.
What Changed
tests/e2e/fixtures/golden-stub-agent/golden-agent-tui-launch.spec.tsandgolden-shell-after-agent-exit.spec.tshelpers/golden-stub-agent.tsto configure and launch the stub agentWhy
E2E tests ensure the agent TUI flow and shell recovery work reliably—critical for UX and stability.
Visual Proof
N/A—test-only changes
Testing
Added two comprehensive e2e test scenarios covering agent launch (multiline input) and shell recovery after exit.
Review
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)