Skip to content

Two identities per session: MCP server vs SessionStart-hook WIRE_HOME bind to different DIDs → CLI monitor/pull/tail blind to MCP-paired peers #351

Description

@WILLARDKLEIN

Summary

In a single Claude Code session on Windows, two different wire identities coexist and the CLI vs MCP halves of the same session bind to different ones. A peer paired via the MCP server is therefore invisible to every CLI command (monitor, pull, tail) — including the persistent wire monitor --json stream-watcher the MCP instructions tell you to arm on session start. The watcher silently tails the wrong inbox forever.

This is adjacent to #284 item 4 ("CLI commands hang when WIRE_HOME is not inherited"), but worse: it is not just a different home pointer, it is a different identity (different DID, different keypair, different inbox).

Environment:

  • OS: Windows 10 Pro (19045)
  • Binary: C:\Users\Willard\.local\bin\wire.exe, wire 0.16.0 (clean)
  • Host: Claude Code MCP integration, session-keyed WIRE_HOME under ...\sessions\by-key\<id>

Repro / evidence

Same session, two whoami:

  • wire_whoami via MCP serverdid:wire:outback-kingfisher-91a7a643, session_source: claude-code, home ...\by-key\ed93d6bd22575a99
  • wire whoami via SessionStart hook / env WIRE_HOMEdid:wire:cedar-cricket-a3d9db39, session_source: env:WIRE_HOME, home ...\by-key\86ffbec7235beba7

Consequence chain:

  1. Operator accepts an inbound pair from peer velvet-ember via MCP → it pins under outback-kingfisher (...\ed93d6bd...\state\wire\inbox\velvet-ember.jsonl).
  2. The armed wire monitor --json (a Bash tool process) inherits the hook WIRE_HOME = cedar-cricket → it tails the wrong inbox and never emits velvet-ember's replies.
  3. wire pull / wire tail from the shell likewise return cedar-cricket's history (old peers), not the MCP-paired peer. Looks like "peer went silent" when the messages are sitting in the other identity's inbox.

Workaround that fixed it: locate the MCP identity's home by grepping by-key/*/config/wire/agent-card.json for the handle, then re-arm the monitor with WIRE_HOME explicitly pointed at it.

Contributing factor: session→identity proliferation

ls ...\sessions\by-key\ shows hundreds of keyed homes — each session/resume appears to mint a new keyed identity rather than reuse a stable one. So the MCP identity and the hook identity drift apart, and old identities accumulate (each a distinct DID a peer might have paired with historically).

Expectation

  • A session should resolve to one identity across MCP and CLI/hook, OR
  • WIRE_HOME resolution must be deterministic and shared (the SessionStart hook and the MCP server must agree on the same by-key home), and
  • wire monitor / pull / tail should warn loudly when the active identity has zero pinned peers but other by-key homes have pinned peers (the "you're watching the wrong inbox" case), and
  • consider a stable per-host (or per-project) identity instead of per-session keyed homes, to stop DID churn and home proliferation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions