← Back to Pull requests

perf(tui): count duplicate names once during resource completion #4191

Closed
unknown closed this pull request without merging on Nov 29, 2026 23:07 UTC
View on GitHub
unknown unknown commented on Nov 29, 2026 19:58 UTC
Author

What a user gets

Pressing Tab after agent scanned the entire fleet once per name to decide which names needed a host/rig/pod qualifier. Count the names in one pass and reuse the counts when building the choices.

How you verified it

On Node 22, completing agent seat- against a demo snapshot with 5,000 generated seats took 85 ms on main and 1.8 ms with this change (median of seven calls after a warmup). The duplicate-seat test now mixes a shared name and a unique name and dispatches the returned choices.

At 45fdb9aa1, vitest run --project @openrig/tui: 1407 passed, 9 skipped. The workspace build and typecheck passed with the five changes together. I did not run the full npm test locally.

Anything you were unsure about

The timings are for the named operation on a local fixture.

  • One concern per PR; no version bump; no CHANGELOG.md edit

  • Tests added or updated where the change is testable

  • I listed the checks I ran, their results, and any checks I could not run
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

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

    Summary by CodeRabbit

    Bug Fixes
    Resource completion now distinguishes duplicate names across hosts while keeping unique names concise.
    * Improved coverage for completion results when hosts contain matching rigs and pods.

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

    Diff: 179 lines (+134 / -45) across 2 files Reviewer: openrig-review Review duration: 188m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 179 lines diff across 2 files
    0.36
    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.311
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4191"
    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: 35.5% (MEDIUM) · Higher = larger blast radius
    35.5%
    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: 14% · Safe to merge
    14%