Skip to content

fix(tui-e2e): Make E2E snapshot tests more resilient to scroll timing#64

Merged
CSRessel merged 6 commits into
devfrom
feat-acp-cli-integration
Dec 3, 2025
Merged

fix(tui-e2e): Make E2E snapshot tests more resilient to scroll timing#64
CSRessel merged 6 commits into
devfrom
feat-acp-cli-integration

Conversation

@CSRessel
Copy link
Copy Markdown
Collaborator

@CSRessel CSRessel commented Dec 2, 2025

Summary

  • Add normalize_for_input_snapshot() function that strips the startup header block for consistent snapshots regardless of terminal scroll state
  • Update all E2E tests to use the new normalization function
  • Regenerate all snapshots without header content for determinism

Problem

The TUI E2E tests were flaky due to terminal viewport scroll timing causing the startup header to sometimes be present and sometimes not in snapshots. This made tests non-deterministic and caused intermittent CI failures.

Solution

The header can appear in two forms:

  1. Boxed header with ╭── border
  2. Plain text "To get started, describe a task..."

The new normalize_for_input_snapshot() function detects either form and strips everything up to and including the /review command line. The original normalize_for_snapshot() is kept for cases where header content needs to be tested explicitly.

Test plan

  • All tui-pty-e2e tests pass
  • Ran tests multiple times to verify stability
  • Snapshots regenerated with consistent content

Implements the minimal-footprint approval bridging between ACP permission
requests and Codex approval system:

- Add ApprovalRequest type bundling translated event with response channel
- Translate ACP RequestPermissionRequest to Codex ExecApprovalRequestEvent
- Translate Codex ReviewDecision back to ACP RequestPermissionOutcome
- Expose approval receiver via AcpConnection::take_approval_receiver()
- Fall back to auto-approve if channel closed, deny if response dropped
- Add placeholder comments for future: history persistence, export, resume

This enables the TUI to receive approval requests and respond to them
without modifying codex-core.
The TUI E2E tests were flaky due to terminal viewport scroll timing
causing the startup header to sometimes be present and sometimes not
in snapshots. This made tests non-deterministic.

Changes:
- Add normalize_for_input_snapshot() function that strips the startup
  header block (both boxed and plain text forms) for consistent snapshots
- Update all E2E tests to use the new normalization function
- Regenerate all snapshots without header content for determinism
- Keep original normalize_for_snapshot() for cases where header
  content needs to be tested explicitly

The header is detected by looking for box characters, To get started,
or Welcome to Codex, then stripping everything up to and including
the /review command line.
@CSRessel CSRessel force-pushed the feat-acp-cli-integration branch from e721d3d to cb54732 Compare December 2, 2025 22:19
CSRessel and others added 4 commits December 2, 2025 22:40
Remove ACP-specific types and event handling from protocol and UI layers
as part of the ongoing effort to rebuild ACP integration without tight
coupling to codex-core's HTTP model handling.

Changes:
- Remove WireApi::Acp variant (only Chat and Responses remain)
- Remove AcpEventMsg, AcpToolCallEventMsg, and related types from protocol
- Remove ACP event handling from TUI, exec, and MCP server
- Remove codex-acp dependency from codex-core
- Update docs.md files to reflect the decoupled architecture
🤖 Generated with [Nori](https://nori.ai)

Co-Authored-By: Nori <contact@tilework.tech>
@CSRessel CSRessel merged commit 3f4cfd4 into dev Dec 3, 2025
2 checks passed
@CSRessel CSRessel deleted the feat-acp-cli-integration branch December 3, 2025 06:42
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