← Back to Pull requests

fix(transport): refuse ordinary sends at adopted Pi confirmations #2015

Closed
unknown closed this pull request without merging on Oct 25, 2026 15:01 UTC
View on GitHub
unknown unknown commented on Oct 25, 2026 12:08 UTC
Author

An adopted Pi TUI can retain an unknown runtime and has no managed-runner hook. Its extension selector was not recognized by the shared pane classifier, so an ordinary message could choose the highlighted answer.

Recognize the current Pi selector by its option block with exactly one arrow-selected row, navigation/select/cancel help and adjoining closing border. Footer metadata is optional: unnamed sessions, absent usage counters, extension status and below-editor widgets do not decide recognition. Rebound select/cancel labels and other option names are supported. A later editor border or closing Markdown fence keeps historical/quoted output from reading as a current selector.

The existing target_needs_input refusal then explains the stop and writes neither text nor Enter. The same pane fallback supplies attention evidence. Normal unknown-runtime sends and audited deliberate interaction retain their behavior. The cost applies only to this positive selector signature: ordinary messages wait until the person handles that selector. No runtime discovery, backend, setting or admission rule was added.

The bounded match covers a selector with up to six nonblank rows below its closing border and a selected option within the existing prompt scan window. It is not universal recognition of every Pi extension editor or layout.

Validation:

  • Round 1 RED: 27 missed send cases failed at the prior head; its three original named-session cases passed.

  • GREEN: 425 source checks passed: prompt guard 132, session transport 272, and 21 reused independently authored controls. One worker; daemon tsc --noEmit and diff check passed.

  • Cases cover adopted null/unknown/Pi runtimes, unnamed sessions inside/outside git, extension status/widgets, missing counters, alternate/extra/described choices, rebound keys, selected No, ordinary sends, override audit, history and quoted output.
  • Delivery is an artery: messages and wakes share this classifier. A stub agent does not draw Pi's native widget, so these checks use real SessionTransport and SQLite adoption registration/binding with mocked pane capture and write spies. The original fixture is reconstructed from a retained filtered capture, not a byte-exact raw pane; added layout variants follow Pi v1.4.0 extension-selector.ts, footer.ts and interactive-mode.ts. No native session, provider or real approval dialog was exercised by these source checks. Native acceptance must include a default unnamed Pi session, selected No, extension status, a narrow pane and an ordinary send after the selector closes.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

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

    Summary by CodeRabbit

    Bug Fixes
    Prompt sending now detects Pi confirmation selectors and prevents ordinary sends from typing or submitting while a selection prompt is active.
    These prompts are marked as requiring attention, including when “No” is selected. Deliberate, audited input remains available.
    Historical text and unrelated content are not treated as active selection prompts; sending to a quiet adopted seat continues to work normally.

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

    Diff: 403 lines (+302 / -101) across 5 files Reviewer: openrig-review Review duration: 173m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 403 lines diff across 5 files
    0.45
    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.359
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2015"
    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: 44.8% (MEDIUM) · Higher = larger blast radius
    44.8%
    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: 17.7% · Safe to merge
    17.7%