← Back to Pull requests

fix(daemon): read a native install's version label as claude with an OS executable witness #1345

Closed
unknown closed this pull request without merging on Oct 21, 2026 17:07 UTC
View on GitHub
unknown unknown commented on Oct 16, 2026 02:14 UTC
Author

What a user gets

A Claude seat installed with Claude's native installer on macOS, whose process is named by its version (for example 2.1.300), is no longer marked as needing attention after a restore that resumed it, and rig reconcile-session no longer reports that its pane command doesn't confirm claude-code.

Refs #86

What changed

The native installer makes ~/.local/bin/claude a symlink into ~/.local/share/claude/versions/<version>. macOS names a process after the file it ran, so tmux's pane label is the version, never claude. A claude label reads as Claude by name. A version label had to prove the exact conversation instead, which also needs Claude's prompt on screen and every command-line argument parsed.

A version label now stands for claude only when all of these hold:

  • the pane's one foreground Claude is that version-named process, the same in two samples;

  • the OS reports its executable path (/proc/<pid>/exe on Linux; proc_pidpath on macOS, read as #724 already does) inside the installer's versions folder, with a basename equal to its process name, and its command line names claude as the program;

  • the pane's process is unchanged afterwards.
  • The label alone never counts. A path read that fails or times out is no witness. What the witness shows is that the pane's one foreground process runs from a file in the installer's versions layout and was started as claude; it doesn't prove the file is Anthropic's Claude or who owns that home directory. That's the same name-level trust a claude label already gets, plus the OS path.

    It applies in three places:

  • the launch wait and every readiness check, for unmanaged seats only;

  • the legacy restore resume, for unmanaged launches only;

  • reconcile-session's runtime drift line.
  • The changed result: a native-installer Claude seat whose process is named by its version is treated as resumed on the same evidence a claude-named seat already gets by name, plus the OS executable witness. Like that name check, it claims nothing about which conversation is running.

    Which seats are unmanaged: a launch binding carries the seat's permission mode, but readiness checks that build their own binding (the context monitor's recovery, the transport's startup readiness, continue-fresh) don't. So the adapter reads the seat's saved permission selection through NativePermissionStore.resolve, the source the launch uses. A seat is unmanaged only when its binding and that selection both say so; a missing or unreadable selection counts as managed.

    What stays the same: managed seats keep their exact launch proof at every readiness check. Exact conversation proof and its argument parser, strict restore lineage, and the attention reconciler's token rule are unchanged. A shell label, aliases and functions, and the launch command are unchanged.

    Where it takes effect: where the pane reports the launched process. That's a direct launch, an unmanaged launch once its staging subshell runs the executable in place (#1200), or a user's own exec. While a pane reports the staging shell, nothing here changes.

    Timing

    The witness runs at most once per observation, only when the pane label is a version and reading it as claude would change the result, and only for unmanaged seats. Each run takes two process samples. Each sample is one ps and, when a version-named process is present, one OS path read (on macOS a bounded osascript call with a 2 s timeout).

  • A witnessed seat resolves on the first observation after Claude has started. The launch wait takes 16 observations 200 ms apart, then a final one.

  • A path read that fails leaves the path unset, so the process isn't accepted, and the wait goes on as before.

  • A path read that actually times out ends the witness for the rest of that wait, which carries on with the probe exactly as on main. The reader reports only its own timeout kill (Node kills osascript with the kill signal); a denied, overflowing or unparsable read is not a timeout and changes nothing. So one wait pays for at most one timed-out sample pair, not one per observation: in the tests, the launch wait reads once instead of 17 times and the legacy restore once instead of 27. The next wait, a separate launch or restore, tries the witness again; nothing is cached between waits.

  • Not a hard cap: ps and the tmux reads have no timeout of their own, as on main. Linux reads /proc/<pid>/exe with no timeout and reports none. The managed launch's exact proof is unchanged and keeps its own reads once Claude's prompt is visible.
  • Tests (claude-version-label-witness.test.ts)

    These are stubbed pane labels and process rows, through the existing adapter, resume and reconcile entry points, so the same file runs on main.

  • Witnessed native version label:

  • - the unmanaged launch wait resumes, both with OpenRig's own resume arguments and with an argument from the user's own claude that exact proof can't parse;
    - the readiness check is ready;
    - the legacy restore resume is verified;
    - reconcile-session reports no runtime drift, and continuity stays unverified.
  • Refusals that stay refused:

  • - a path outside the installer layout;
    - a basename that isn't the process name;
    - a program name that isn't claude;
    - a version as the program name;
    - two candidates;
    - a failed or timed-out path read;
    - the native path as the program name, with no OS path read;
    - the native path as the program name, with an unrelated OS path;
    - a background process;
    - a label naming a different version;
    - a pane process change after the samples;
    - a process that changes between samples;
    - an unwitnessed label in the resume and in reconcile.
  • Unchanged: a managed seat and a managed resume (the witness isn't consulted), a shell label, and a claude label (no process read).

  • Managed through a binding without a permission mode: a saved managed selection, an unreadable selection and a missing selection reader leave the witness unconsulted.

  • A path-read timeout within one wait: a first- or second-sample timeout ends the witness for the rest of the launch wait (1 or 2 reads instead of 17 or 18) and the legacy restore wait (1 instead of 27), each ending with main's result. A missing path without a timeout still lets every observation try. A later, independent wait uses a healthy witness. The path reader reports only an actual timeout, and the process listing forwards it only to a caller that asks.

  • At the recovery consumer (ContextMonitor.pollOnce, real SQLite and NativePermissionStore): a managed seat with a version label and the wrong conversation, or with no OS path, stays attention_required; the ordinary claude label still reads ready, as does an unmanaged witnessed label.
  • The tests were also run without the fix on a separate branch; that run is linked below.

    Not yet run on a real Mac. These tests stub the pane labels and process rows. A run on macOS with Claude's native installer is still pending, so this doesn't yet show a native-installer restore working on a real machine.

    🤖 Generated with Claude Code

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

    Summary by CodeRabbit

    Bug Fixes
    Improved recognition of unmanaged Claude sessions when a pane displays a version label instead of the usual command name. Recognition requires confirmation that the running Claude executable matches the label.
    Prevented incorrect runtime-drift warnings when that version label is confirmed; other mismatches retain existing behavior.
    Unmanaged resumes can be recognized under the same verified conditions. Managed resumes and cases without matching executable evidence retain their existing behavior.
    * Improved reliability when executable verification times out by preventing repeated checks during the same readiness or resume attempt.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: mvschwarz Review duration: 8093m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.57) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.57 · 650 lines diff across 8 files
    0.57
    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%
    56%
    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.388
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #1345"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 57% (MEDIUM) · Higher = larger blast radius
    57%
    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: 56.8% · Lower = rushed or shallow review
    56.8%
    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: 24.7% · Safe to merge
    24.7%