← Back to Pull requests

fix(tui): ignore terminal status responses as input #2445

Open
unknown opened this pull request with 175 lines diff across 2 files
View on GitHub
unknown unknown commented on Jul 31, 2026 03:51 UTC
Author

Related issue

Resolves #2181.

Problem

Terminal query replies such as cell-size, device-attribute, DCS, APC, and OSC reports could reach keyboard input handling and interrupt an active turn.

Change

  • Add a default-off terminal-status filter in the vendored pi-tui library; Kimi opts in for its normal and fullscreen TUI.

  • Consume known non-OSC replies before application input listeners. Let OSC reach protocol listeners, then stop unhandled OSC before focused keyboard input.

  • Preserve ordinary keys, SGR mouse and Kitty keyboard input, and the library's default behavior for other hosts.

  • Record the fork's intent in packages/pi-tui/UPSTREAM.md; add regression tests including a mixed raw stdin chunk and default-off behavior.
  • Verification on current main

  • RED on the unpatched path: terminal replies reached app/focused input handlers.

  • GREEN: pi-tui 1,147 passed, 2 skipped, 0 failed (1,149 tests); pi-tui and kimi-code typechecks pass; pre-commit oxlint passes.

  • Independent Codex high review found the default-off and intent-card omissions; both fixed. A second independent review found secondary DA replies (ESC[>…c) were missed; filtered and covered by a passing regression test.
  • AI assistance disclosure

    This patch and PR text were AI-assisted using OpenAI Codex. The contributor remains responsible for reviewing and understanding the submitted changes.

    Diff: 175 lines (+131 / -44) across 2 files Reviewer: ousamabenyounes Review duration: 176858m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.42) × (1 − Review Confidence (0.41)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 175 lines diff across 2 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    40%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.309
    Real PR Conversation Timeline
    1 comments
    "Review active on #2445"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 40.9% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.4% (MEDIUM) · Higher = larger blast radius
    42.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 40.9% · Lower = rushed or shallow review
    40.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 25% · Safe to merge
    25%