Skip to content

Integration testing and edge case handling #11777

Closed as not planned
Closed as not planned

Description

@randomm

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Feb 2, 2026
  2. randomm commented on Feb 3, 2026

    @randomm
    Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions