← Back to Pull requests

test: make route idle-wait expiry independent of runner speed #2027

Closed
unknown closed this pull request without merging on Oct 25, 2026 15:19 UTC
View on GitHub
unknown unknown commented on Oct 25, 2026 13:33 UTC
Author

What a user gets

Required CI no longer depends on a mocked pane observation completing within one millisecond. The transport route test now freezes the deadline clock and timeout timer, advancing them only at the injected poll. It still requires HTTP 409, wait_for_idle_timeout, confirmed running activity, the one-millisecond budget, and no input write.

The route case covers both zero and five milliseconds of real capture CPU cost, following the existing domain-test pattern. Production code is unchanged.

How you verified it

  • RED: both route cases failed with real deadline timing, including the controlled five-millisecond capture, returning target_activity_unknown instead of the expected busy timeout.

  • GREEN: all 60 transport-route checks passed; six selected domain sibling/unknown controls passed, one worker. git diff --check passed. No install, build, native or provider run.

  • Text search and TypeScript property inspection found four literal waitForIdleMs: 1 call sites on base 54bd48511. The three in session-transport.test.ts already freeze the deadline clock and race timer: running-pane and Claude-thinking cases also cover 0/5ms capture costs; the UserPromptSubmit case advances only at the poll. They remain unchanged and their five cases passed. The sixth selected check preserves the separate perpetual-unknown outcome. Other waitForIdlePollMs: 1 uses set a polling interval, not a one-millisecond overall deadline, and were left alone.
  • Anything you were unsure about

    This tests route mapping after an observed busy sample. A sample that genuinely misses the production deadline must still report unknown; no assertions were weakened and no production deadline was extended. Fake timers are restored in finally, and the full route file passed with its other tests afterward.

  • Test-only change

  • Failure demonstrated before controlling the clock

  • Focused checks and remaining cases stated
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Tests
    Expanded timeout test coverage for zero and nonzero capture costs, including response details, polling behavior, and confirmation that no text is sent.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 292 lines (+219 / -73) across 3 files Reviewer: openrig-review Review duration: 106m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 292 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.340
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2027"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.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: 39.9% (MEDIUM) · Higher = larger blast radius
    39.9%
    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: 60.5% · Lower = rushed or shallow review
    60.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: 15.8% · Safe to merge
    15.8%