← Back to Pull requests

Make terminal renderer tests independent of TERM #933

Merged
akaszhu merged 1 files (5 lines) on Dec 02, 2026 21:08 UTC
View on GitHub
akaszhu akaszhu commented on Nov 30, 2026 16:05 UTC
Author

Fixes #926.

When the test console is given only a width, Rich ignores it on TERM=dumb and uses 80 columns instead. So test_interrupted_assistant_line_is_rewritten_to_the_heard_text sees the 50-character line as a single row, emits \x1b[1F where the test expects \x1b[2F, and fails.

This gives the shared _terminal_renderer() console, and the one other test console that sets only a width, both dimensions (height=25). Then the 40-column setting holds no matter what TERM is. Only tests change.

Checked locally on Linux, Python 3.12:

  • TERM=dumb pytest tests/openai_realtime/test_audio_client.py: 145 passed (on main, the interrupted-line test fails).

  • TERM=xterm-256color pytest tests/openai_realtime/test_audio_client.py: 145 passed.

  • ruff check and ruff format --check are clean.
  • I used AI assistance to prepare this change. I reviewed and tested it myself.

    Diff: 5 lines (+3 / -2) across 1 files Reviewer: andimarafioti Review duration: 3182m
    All Vouch review confidence checks passed
    Residual risk 0.06 = Change Risk (0.19) × (1 − Review Confidence (0.68)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.19 · 5 lines diff across 1 files
    0.19
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.35 · 1 substantive comment(s)
    0.35
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    67%
    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
    Diff Size diff_size
    0.107
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    2 items
    andimarafioti andimarafioti approved these changes on Dec 02, 2026 21:07 UTC
    Approved Reviewer
    Reviewers
    Assignees
    akaszhu akaszhu
    Labels
    risk: low confidence: 67.5% 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: 18.7% (LOW) · Higher = larger blast radius
    18.7%
    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: 67.5% · Lower = rushed or shallow review
    67.5%
    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: 6.1% · Safe to merge
    6.1%