Skip to content

Epic: Ink-based TUI Rewrite for oclite #11762

Closed as not planned
Closed as not planned

Description

@randomm

Overview

Replace the current log-update based lite UI with Ink (React for terminals) to solve fundamental rendering issues with concurrent state updates.

Background

The current oclite lite implementation (17 files, ~2,500 lines) has persistent issues:

  • pausedForProse hack prevents live block updates during text streaming to avoid crashes
  • Child session mapping requires complex buffering for out-of-order events
  • State synchronization between SDK events and UI is fragile
  • log-update wasn't designed for this level of complexity

Why Ink?

  1. <Static> component — Renders completed items permanently above dynamic content (exactly what we need)
  2. React reconciler — Multiple state updates batch properly, no need for pausedForProse hacks
  3. useStdout().write() — Can output text without interfering with render cycle
  4. Battle-tested — Claude Code, Gemini CLI, Cloudflare Wrangler all use Ink

Package Versions

Package Version
ink latest stable
react latest stable (required by Ink)
ink-spinner latest stable
ink-text-input latest stable
@types/react latest stable

Scope

In Scope

  • Replace all rendering logic with Ink components
  • Maintain feature parity with current lite functionality
  • SDK event stream integration via React hooks
  • Child session status display (the feature that keeps breaking)

Out of Scope

  • Full opencode TUI feature parity (panels, scrolling, etc.)
  • Web UI
  • Desktop app

Child Issues (Implementation Order)

Phase 1: Setup

Phase 2: Core Architecture

Phase 3: Components

Phase 4: Integration

Phase 5: Polish & Ship

Success Criteria

  • No crashes during prose streaming + tool updates
  • Child task status updates display correctly
  • Binary size < 15MB
  • All current working features preserved
  • Tests for critical rendering paths

Estimated Total Effort

~20 days (4 weeks of focused work)

Risk Assessment

Risk Severity Mitigation
SDK event handling complexity HIGH Same logic needed regardless of UI - React may make it cleaner
Bundle size increase Medium Tree-shaking, measure early
Bun compatibility Low Claude Code already uses Ink+Bun

Branch

feature/oclite-ink-rewrite (clean branch from dev)

Backup

Previous experimental work saved in: backup/oclite-lite-experiments-2026-02-02

Activity

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

    @github-actions
    Contributor

    Related Issues Found

    This epic addresses multiple interconnected rendering and state management issues across the codebase. Here are the most critical related issues that the Ink-based TUI rewrite should resolve:

    Critical Rendering Issues

    Child Session Display Issues (Major problem mentioned in epic)

    Performance Issues (Solved by Ink batching)

    TUI Stability Issues

    Streaming Issues (Related to pausedForProse hack)

    These issues collectively demonstrate the limitations of the current log-update based approach and validate the need for the Ink-based rewrite.

  3. randomm commented on Feb 3, 2026

    @randomm
    Author

    Reopening epic - Phase 1 & 2 merged, proceeding with Phase 3.

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