← Back to Pull requests

fix(queue): a self-routed conversation reads as a conversation in its wake record and destination status #4171

Closed
unknown closed this pull request without merging on Nov 29, 2026 20:16 UTC
View on GitHub
unknown unknown commented on Nov 29, 2026 14:06 UTC
Author

Stacked on #4163; this PR's base is that branch. #4163 stops the stuck sweep from sending a recovery task to the seat that asked a conversation a question, when that conversation named itself as its work's return route (for example rig mcp serve --front-door under OPENRIG_SESSION_NAME). Two other surfaces still read such an address as broken:

  • The wake record a create or handoff stores: "unroutable: '<address>' has no terminal transport … Fix the address, or register the human with rig gateway human add." That tells the asking agent to fix something that isn't broken.

  • The destination status a create, handoff or send prints: "No live seat by this name". An OpenRig-issued address already reads conversation there.
  • The change

  • The destination classifier gains one rule, after the stopped seat and before the catch-all. An address isSelfRoutedConversation accepts gets the issued address's kind of teaching: "awaiting-pickup: '<address>' is a conversation that named itself as its work's return route … The work waits there until that conversation reads its own queue."

  • - The stuck sweep's no-route reading (recordsNoWakeRoute) and the reachable-seat retry read awaiting-pickup: exactly as they read unroutable:.
  • The destination status reads conversation for such an address, with that teaching. A known seat returns earlier in that function, so a seat never reaches it.

  • isSelfRoutedConversation also excludes a person's address. That classification belongs to the gateway.
  • Unchanged

  • an address that hasn't handed work over as itself, or whose route someone else named, or that was carried from another host;

  • a stopped seat, a hosted member, an attached seat, or any other topology seat (#4163);

  • every pane-bound destination.
  • Tests

    On Linux (Node 22) on a test machine, at #4163's head 3f627756.

    New file: self-routed-conversation-surfaces.test.ts (5 cases):

  • the in-process daemon's create advisory and direct-send status;

  • the classifier's teaching before and after the address routes to itself;

  • a named route, a person's address and a stopped seat, which read as before.
  • Updated: #4163's front-door case now expects the new wake text.

    Results:

  • At 3f627756, the four behaviour cases fail. With the change, all 15 cases in the two files pass.

  • Related: 60 files (stuck sweep, route-lookup index, destinations, issued and conversation addresses, return routes, transport, hosted, attach, create, handoff, migrations), 1854 tests, green.

  • tsc is clean.
  • A registered person's alias (c6d8da3a)

    The destination status checked for a self-routed conversation before the human registry. A person's name at a rig that routed work to itself before the person was registered (sam@client3, then sam@external with a binding) read as a conversation that gets no wake, while the classifier sends it to the gateway. The status now reads the registry before both conversation readings, as the classifier does (it already checks a registered alias before every conversation rule).

  • New case in self-routed-conversation-surfaces.test.ts: the alias routes work to itself, then is registered. The classifier returns gateway-routable sam@external, and the status returns none.

  • Results: at 8ba364d3 the case fails on the status, and with the change all 6 cases in the file pass. The other 9 related files (destination status, issued conversations, routes, cross-host handoff, startup) pass with the change (503 tests, 5 todo), and tsc is clean.
  • 🤖 Generated with Claude Code

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

    Summary by CodeRabbit

    Bug Fixes
    Local conversations routed back to their own queue are now identified as conversations, with guidance on where to pick them up, rather than being reported as generally unroutable.
    Registered human addresses are recognized before conversation guidance, and human-seat references are not mistaken for self-routed conversations.
    Unreadable human records or unavailable rosters continue to produce an unknown status when the destination cannot be confirmed. Stopped seats and unrelated destinations retain their appropriate status.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 549 lines (+411 / -138) across 6 files Reviewer: mvschwarz Review duration: 370m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.53) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.53 · 549 lines diff across 6 files
    0.53
    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.378
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #4171"
    general weight: 0.35
    Reviewers
    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: 53.1% (MEDIUM) · Higher = larger blast radius
    53.1%
    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: 21.0% · Safe to merge
    21.0%