Skip to content

test: add golden e2e tests for agent TUI launch and shell recovery - #14258

Open
AmethystLiang wants to merge 1 commit into
mainfrom
golden-agent-tui
Open

test: add golden e2e tests for agent TUI launch and shell recovery#14258
AmethystLiang wants to merge 1 commit into
mainfrom
golden-agent-tui

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

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

  • Added stub agent fixtures (shell/batch wrappers + Node.js implementation) at tests/e2e/fixtures/golden-stub-agent/
  • Added e2e tests: golden-agent-tui-launch.spec.ts and golden-shell-after-agent-exit.spec.ts
  • Added test helper helpers/golden-stub-agent.ts to configure and launch the stub agent

Why

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

  • Automated tests added/updated, or explained why not below

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

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

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

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds 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 d50f9

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)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem, solution, scope, and testing, but it omits the required linked issue and several required checklist details. Add a linked issue, complete the testing and platform details, address cross-platform considerations, and confirm the required validation commands or CI coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the two main changes: golden E2E coverage for agent TUI launch and shell recovery after agent exit.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3ab8b6a and d50f90e.

📒 Files selected for processing (8)
  • tests/e2e/fixtures/golden-stub-agent/codex
  • tests/e2e/fixtures/golden-stub-agent/codex.cmd
  • tests/e2e/fixtures/golden-stub-agent/golden-stub-agent
  • tests/e2e/fixtures/golden-stub-agent/golden-stub-agent.cmd
  • tests/e2e/fixtures/golden-stub-agent/golden-stub-agent.js
  • tests/e2e/golden-agent-tui-launch.spec.ts
  • tests/e2e/golden-shell-after-agent-exit.spec.ts
  • tests/e2e/helpers/golden-stub-agent.ts

Comment thread tests/e2e/golden-shell-after-agent-exit.spec.ts
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