Skip to content

Multiple agents on same machine overwrite each other's identity #4

@theflysurfer

Description

@theflysurfer

Problem

When two agents run on the same machine simultaneously, wk init writes to a single ~/.walkie/.wk-id file. The second agent's wk init overwrites the first agent's identity, causing:

  1. Message misrouting: Messages buffered for agent A are never read because subsequent wk read calls use agent B's identity
  2. Silent failure: No error is raised — the agent just never sees its messages

Steps to reproduce

# Terminal 1
wk init agent-alpha
# Terminal 2  
wk init agent-beta
# Terminal 1 — identity has been silently overwritten
wk send "hello"   # Now sends as agent-beta, not agent-alpha
wk read             # Reads agent-beta's queue, misses agent-alpha's messages

Proposed fix

Replace the single ~/.walkie/.wk-id file with per-agent files under ~/.walkie/ids/<agent-name>:

  • wk init agent-alpha → writes ~/.walkie/ids/agent-alpha
  • wk init agent-beta → writes ~/.walkie/ids/agent-beta (no collision)
  • Single agent on machine → auto-detected, no env var needed
  • Multiple agents → WK_AGENT=<name> targets the right identity
  • wk off removes only that agent's file

Reference implementation: https://github.com/theflysurfer/walkie/tree/feat/per-agent-identity

Environment

  • walkie-sh 1.3.0
  • Windows 11 + Git Bash (PPID=1 issue makes PID-based approaches unreliable)
  • Multiple AI agents (Pi, Claude Code) running concurrently

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions