Skip to content

Fix canvas owner liveness across concurrent sessions - #159

Merged
0101 merged 1 commit into
mainfrom
session-doc-ownership-fight
Jul 31, 2026
Merged

Fix canvas owner liveness across concurrent sessions#159
0101 merged 1 commit into
mainfrom
session-doc-ownership-fight

Conversation

@0101

@0101 0101 commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Problem

  • Two Copilot sessions can remain active in the same worktree and heartbeat independently.
  • The bridge liveness API exposed only the most recently registered session ID for each worktree.
  • AgentDoc liveness dots and Start-session visibility compared ownership against that alternating ID, so a healthy document owner appeared offline whenever the other session sent the latest heartbeat.

Fix

  • Add BridgeLiveness.LiveSessionIds containing every identified session still within the liveness TTL.
  • Check AgentDoc ownership against the complete live-session set.
  • Preserve the existing freshest SessionId for aggregate status and SystemView fallback routing.
  • Update the canvas-pane specification and add regression coverage for a non-freshest live owner.

Tests

  • dotnet test src\Tests\Tests.fsproj --filter "FullyQualifiedName~CanvasBridgeTests|FullyQualifiedName~SessionBridgeTests" — 66 passed
  • npm run build

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: dc712bcd-b101-45f2-9d6b-b278fd884ce9
Copilot AI balanced review requested due to automatic review settings July 31, 2026 12:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends bridge liveness tracking so concurrently active sessions keep their AgentDocs online independently.

Changes:

  • Adds and populates all live session IDs per worktree.
  • Uses the full live-session set for document status and session-launch visibility.
  • Updates specifications and regression tests.
Show a summary per file
File Description
src/Shared/Types.fs Adds LiveSessionIds and lookup helper.
src/Server/SessionBridge.fs Aggregates live identified sessions.
src/Client/CanvasPane.fs Checks document owners against all live sessions.
src/Tests/SessionBridgeTests.fs Covers stale-session liveness output.
src/Tests/CanvasBridgeTests.fs Covers concurrent non-freshest owners.
docs/spec/canvas-pane.md Documents multi-session liveness behavior.

Review details

  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@0101
0101 merged commit 4a5e961 into main Jul 31, 2026
2 checks passed
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.

2 participants