Integration testing and edge case handling #8323

Closed
opened 2026-02-16 18:09:41 -05:00 by yindo · 1 comment
Owner

Originally created by @randomm on GitHub (Feb 2, 2026).

Originally assigned to: @thdxr on GitHub.

Parent Epic

Part of #11762 (Ink-based TUI Rewrite)

Objective

Comprehensive testing of the Ink implementation, especially edge cases that caused issues in the previous implementation.

Critical Test Scenarios

1. Concurrent Updates (The Main Problem)

  • Prose streaming + tool status updates simultaneously
  • Multiple tools running in parallel
  • Task with child tool + prose streaming
  • Rapid state changes don't cause flicker

2. Child Session Events

  • Events arrive before task metadata (buffering)
  • Events arrive after task completes (ignored)
  • Child session ID mapping works correctly
  • Multiple tasks with children simultaneously

3. Message Lifecycle

  • User input → streaming → completion → Static
  • Cancel during streaming
  • Error during streaming
  • Empty response handling

4. Session Management

  • Create new session
  • Switch between sessions
  • Session state preserved on switch
  • Agent/model changes persist

5. Input Handling

  • Long input lines
  • Multi-line input (if supported)
  • Special characters
  • History navigation
  • Rapid typing during streaming

6. Terminal Edge Cases

  • Very narrow terminal (< 40 cols)
  • Very wide terminal (> 200 cols)
  • Terminal resize during operation
  • Non-TTY environment (piped input)

Test Structure

// test/cli/ink/integration.test.tsx
import { render } from 'ink-testing-library'
import App from '../src/cli/ink/App'

describe('Ink TUI Integration', () => {
  describe('Concurrent Updates', () => {
    it('handles prose + tool updates without crash', async () => {
      const { lastFrame } = render(<App />)
      // Simulate concurrent events
      // Assert no crash, correct display
    })
  })
  
  describe('Child Session Events', () => {
    it('buffers events arriving before mapping', async () => {
      // ...
    })
  })
})

Tasks

  • Set up ink-testing-library
  • Create test fixtures for SDK events
  • Write concurrent update tests
  • Write child session event tests
  • Write message lifecycle tests
  • Write session management tests
  • Write input handling tests
  • Write terminal edge case tests
  • Manual testing checklist

Manual Testing Checklist

  • Fresh install and run
  • /start command with real agent
  • Multiple message exchanges
  • Task spawning (e.g., ask PM to research something)
  • Cancel mid-stream
  • Session switching
  • Agent cycling
  • Long-running operations

Acceptance Criteria

  • All automated tests pass
  • Manual testing checklist complete
  • No crashes in normal usage
  • No crashes in edge cases
  • Performance acceptable (no visible lag)

Estimated Effort

3.5 days

Risk

Medium - Testing concurrent behavior is inherently complex

Dependencies

  • All other implementation issues complete
Originally created by @randomm on GitHub (Feb 2, 2026). Originally assigned to: @thdxr on GitHub. ## Parent Epic Part of #11762 (Ink-based TUI Rewrite) ## Objective Comprehensive testing of the Ink implementation, especially edge cases that caused issues in the previous implementation. ## Critical Test Scenarios ### 1. Concurrent Updates (The Main Problem) - [ ] Prose streaming + tool status updates simultaneously - [ ] Multiple tools running in parallel - [ ] Task with child tool + prose streaming - [ ] Rapid state changes don't cause flicker ### 2. Child Session Events - [ ] Events arrive before task metadata (buffering) - [ ] Events arrive after task completes (ignored) - [ ] Child session ID mapping works correctly - [ ] Multiple tasks with children simultaneously ### 3. Message Lifecycle - [ ] User input → streaming → completion → Static - [ ] Cancel during streaming - [ ] Error during streaming - [ ] Empty response handling ### 4. Session Management - [ ] Create new session - [ ] Switch between sessions - [ ] Session state preserved on switch - [ ] Agent/model changes persist ### 5. Input Handling - [ ] Long input lines - [ ] Multi-line input (if supported) - [ ] Special characters - [ ] History navigation - [ ] Rapid typing during streaming ### 6. Terminal Edge Cases - [ ] Very narrow terminal (< 40 cols) - [ ] Very wide terminal (> 200 cols) - [ ] Terminal resize during operation - [ ] Non-TTY environment (piped input) ## Test Structure ```typescript // test/cli/ink/integration.test.tsx import { render } from 'ink-testing-library' import App from '../src/cli/ink/App' describe('Ink TUI Integration', () => { describe('Concurrent Updates', () => { it('handles prose + tool updates without crash', async () => { const { lastFrame } = render(<App />) // Simulate concurrent events // Assert no crash, correct display }) }) describe('Child Session Events', () => { it('buffers events arriving before mapping', async () => { // ... }) }) }) ``` ## Tasks - [ ] Set up ink-testing-library - [ ] Create test fixtures for SDK events - [ ] Write concurrent update tests - [ ] Write child session event tests - [ ] Write message lifecycle tests - [ ] Write session management tests - [ ] Write input handling tests - [ ] Write terminal edge case tests - [ ] Manual testing checklist ## Manual Testing Checklist - [ ] Fresh install and run - [ ] `/start` command with real agent - [ ] Multiple message exchanges - [ ] Task spawning (e.g., ask PM to research something) - [ ] Cancel mid-stream - [ ] Session switching - [ ] Agent cycling - [ ] Long-running operations ## Acceptance Criteria - [ ] All automated tests pass - [ ] Manual testing checklist complete - [ ] No crashes in normal usage - [ ] No crashes in edge cases - [ ] Performance acceptable (no visible lag) ## Estimated Effort 3.5 days ## Risk Medium - Testing concurrent behavior is inherently complex ## Dependencies - All other implementation issues complete
yindo added the opentui label 2026-02-16 18:09:41 -05:00
yindo closed this issue 2026-02-16 18:09:41 -05:00
Author
Owner

@randomm commented on GitHub (Feb 3, 2026):

Reopening - Phase 1 & 2 components merged successfully. Proceeding with integration testing.

@randomm commented on GitHub (Feb 3, 2026): Reopening - Phase 1 & 2 components merged successfully. Proceeding with integration testing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8323