Skip to content

fix: reject conflicting stable session runtimes - #4

Merged
dataforxyz merged 1 commit into
mainfrom
fix/local-session-id-collision
Jul 27, 2026
Merged

dataforxyz merged 1 commit into
mainfrom
fix/local-session-id-collision

Conversation

@dataforxyz

Copy link
Copy Markdown
Owner

Summary

Port the stable-session collision guard from dataforxyz/agent-intercom-pi#9 to the OpenCode broker copy.

  • reject a second live local runtime claiming an active stable session ID with SESSION_ID_IN_USE
  • preserve same-runtime reconnects using optional runtimeInstanceId, with legacy pid + startedAt fallback
  • keep the incumbent socket and pending deliveries intact
  • prevent superseded sockets from applying stale ask deferrals
  • rebuild the packaged broker artifacts

Validation

  • npm test — 72 passed, 0 failed
  • npm run typecheck
  • npm run build
  • git diff --check
  • focused collision tests cover token-aware conflicts, legacy compatibility, pending-delivery preservation, private runtime identity, and legitimate reconnect replacement

@dataforxyz
dataforxyz merged commit ce6deeb into main Jul 27, 2026
2 checks passed
@dataforxyz
dataforxyz deleted the fix/local-session-id-collision branch July 27, 2026 01:15
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