Skip to content

Fix: multiple sessions in same repo now get independent bridges - #5

Open
spor3006 wants to merge 3 commits into
PatilShreyas:mainfrom
spor3006:fix/per-session-bridge-identity
Open

Fix: multiple sessions in same repo now get independent bridges#5
spor3006 wants to merge 3 commits into
PatilShreyas:mainfrom
spor3006:fix/per-session-bridge-identity

Conversation

@spor3006

@spor3006 spor3006 commented May 3, 2026

Copy link
Copy Markdown

Hi Shreyas, thanks for the awesome tool! Have been giving this a spin lately and faced the issue mentioned below. Raised a fix for the same, PTAL!

Summary

  • Session identity was stored per-project (.claude/bridge-session file), causing two Claude sessions in the same repo to share one bridge ID
  • Exiting either session would destroy the other's bridge
  • All three scripts (register.sh, get-session-id.sh, cleanup.sh) now prefer the per-process BRIDGE_SESSION_ID env var over the shared file
  • cleanup.sh only removes the file pointer if it still belongs to the exiting session

Test plan

  • Start a bridge in session A (/bridge start)
  • Open a second Claude session in the same repo, start a bridge in session B
  • Verify both sessions get different session IDs
  • Exit session B — verify session A's bridge still works
  • Verify /bridge peers shows both sessions while both are active

spor3006 added 3 commits May 3, 2026 11:28
Session identity was stored per-project (.claude/bridge-session file),
causing two Claude sessions in the same repo to share one bridge ID.
Exiting either session would destroy the other's bridge.

Now all three scripts prefer the per-process BRIDGE_SESSION_ID env var
over the shared file. cleanup.sh only removes the file pointer if it
still belongs to the exiting session.
- test-register: verify env var reuse, new session without env var, two sessions in same project
- test-get-session-id: env var priority over file, stale env var fallback
- test-cleanup: pass BRIDGE_SESSION_ID, verify cross-session file preservation
The connect/listen/ask commands used get-session-id.sh which could return
another session's ID from the shared file. Now all commands call
register.sh first (idempotent via env var) to ensure each session has
its own identity. Also fixed bridge-listen.sh fallback and updated
bridge-awareness skill docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant