← Back to Pull requests

fix(queue): a dead seat's recovery reaches the operator agent before the person approvals use #2021

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

What this changes

A dead seat's stuck-sweep finding goes to a live recovery seat when one is available. Otherwise it stays with the missing session and says so.

The recovery seats, in order:
1. the operator agent (agents.operator_session), when one is configured;
2. the operator seat (workspace.operator_seat_name);
3. the stuck row's creator.

A candidate is skipped if it's unset, if its own session is confirmed missing, or if it's the dead seat itself.

If none qualifies:

  • the finding is still created, because it's owed work;

  • it stays addressed to the missing session;

  • its "why" says no live recovery seat was available.
  • A finding that can't be created is reported by the sweep as a failed pass, as before.

    Why

    workspace.operator_seat_name is the person approvals reach. The workflow human resolver uses it to select a registered human, and Mission Control reads it as the default my-queue identity, so it can't be repointed at an agent.

    As #2011 stands, a dead seat's finding therefore goes to that person:

  • The row: a human-required row.

  • The alert: it can post one, whenever a person is configured there.
  • agents.operator_session already names the operator agent's canonical session. The UI's operator chat uses it, and nothing in the queue read it. Reading it first lets recovery reach an agent while approvals stay with the person.

    Unchanged, and what does change with the setting unset

  • Approvals still use workspace.operator_seat_name.

  • The wake ladder isn't changed:

  • - its prompt-blocked alert and its operator rung stay human by design;
    - whether its no-orchestrator floor should also prefer the operator agent is a separate policy question.
  • A person's address never counts as the operator agent, whether an @external address or a human seat ref such as human@kernel.

  • With agents.operator_session unset, routing matches #2011 whenever #2011's fallback is eligible. This change also skips an operator seat or creator that is itself confirmed missing, or is the dead seat. #2011 would have used it.
  • Tests

    queue-stuck-sweep.test.ts:

  • with an operator agent configured, a dead claimant's finding goes to it before the operator seat;

  • an operator agent whose own session is confirmed missing is passed over for the operator seat;

  • with no live recovery seat, the finding stays with the missing session and says so. That's tested two ways: a seat's own row with nothing configured, and every candidate confirmed missing.

  • how the setting resolves: a canonical agent session (trimmed) counts; empty, @external, human@kernel and malformed values don't.
  • The suite's sweep helper injects "no operator agent", so tests don't read the machine's settings.

    🤖 Generated with Claude Code

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

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

    Summary by CodeRabbit

    Bug Fixes
    Findings routed to a confirmed unavailable session can now be reassigned to an available recovery seat, using a consistent fallback order. Unavailable seats are skipped, and active routes are left unchanged.
    * When no suitable recovery seat is available, the finding remains assigned to its original route and includes an explanation that no live recovery seat was found.

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

    Diff: 431 lines (+323 / -108) across 5 files Reviewer: openrig-review Review duration: 139m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 431 lines diff across 5 files
    0.50
    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.363
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #2021"
    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: 50.2% (MEDIUM) · Higher = larger blast radius
    50.2%
    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: 19.8% · Safe to merge
    19.8%