Skip to content

fix(opencode): share session status across worktree contexts - #13685

Merged
iscekic merged 7 commits into
mainfrom
kwf/fix-live-session-advertiseme-4533
Sep 2, 2026
Merged

iscekic merged 7 commits into
mainfrom
kwf/fix-live-session-advertiseme-4533

Conversation

@iscekic

@iscekic iscekic commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • The live-session heartbeat now sees a busy session set in any directory of the same project.
  • SessionStatus keeps one process-global status map, keyed by project id.
  • get() and list() keep their per-directory isolation for the instance status endpoint.
  • Idle sessions still delete their entry, so each project store stays self-cleaning.

Why

In kilo run, the session prompt loop sets busy under the session worktree directory. The heartbeat gather runs under a different captured directory. InstanceState keys state by directory, so the two contexts used separate maps and the heartbeat sent sessions:[]. The session never appeared in the mobile live list while busy.

Verification

  • Driver checks: 5 checks passed after round 3.
  • cli test:ci: failed only on files that also fail on clean main (pre-existing); advisory.

Notes for the reviewer

  • The store is keyed by project id, not one single global map, so projects stay isolated.
  • The heartbeat still reads Permission and Question with list(); the fix does not widen to them.

@iscekic iscekic added the human-ready PR is ready for a human review. label Sep 2, 2026
@iscekic iscekic self-assigned this Sep 2, 2026
Comment thread packages/opencode/src/session/status.ts Resolved
Comment thread packages/opencode/src/session/status.ts Resolved
@kilo-code-bot

kilo-code-bot Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • packages/opencode/src/session/status.ts
Previous Review Summaries (4 snapshots, latest commit 6c77dd9)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 6c77dd9)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • packages/opencode/src/kilo-sessions/kilo-sessions.ts
  • packages/opencode/src/session/status.ts
  • packages/opencode/test/session/status.test.ts

Previous review (commit 3b33ebb)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/opencode/src/session/status.ts 17 Avoid widening the upstream SessionStatus interface with Kilo-only listAll
packages/opencode/src/session/status.ts 34 Process-global project store is not cleaned on instance dispose
Files Reviewed (2 files)
  • packages/opencode/src/session/status.ts - 2 issues
  • packages/opencode/test/session/status.test.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit 9c122bf)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/opencode/src/session/status.ts 17 Avoid widening the upstream SessionStatus interface with Kilo-only listAll
packages/opencode/src/session/status.ts 34 Process-global project store is not cleaned on instance dispose
Files Reviewed (2 files)
  • packages/opencode/src/session/status.ts - 2 issues
  • packages/opencode/test/session/status.test.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit 7125cb8)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/opencode/src/session/status.ts 17 Avoid widening the upstream SessionStatus interface with Kilo-only listAll
packages/opencode/src/session/status.ts 33 Process-global project store is not cleaned on instance dispose
Files Reviewed (4 files)
  • packages/opencode/src/kilo-sessions/kilo-sessions.ts - 0 issues
  • packages/opencode/src/session/status.ts - 2 issues
  • packages/opencode/test/kilocode/suggestion/tool.test.ts - 0 issues
  • packages/opencode/test/session/status.test.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 37.5K · Output: 6.8K · Cached: 192.3K

Review guidance: REVIEW.md from base branch main

@iscekic
iscekic requested a review from eshurakov September 2, 2026 02:10
@iscekic iscekic removed the human-ready PR is ready for a human review. label Sep 2, 2026
@iscekic iscekic added the human-ready PR is ready for a human review. label Sep 2, 2026
@iscekic iscekic added human-ready PR is ready for a human review. and removed human-ready PR is ready for a human review. labels Sep 2, 2026
@iscekic
iscekic requested a review from lambertjosh September 2, 2026 11:09
@iscekic
iscekic merged commit cf2127e into main Sep 2, 2026
31 checks passed
@iscekic
iscekic deleted the kwf/fix-live-session-advertiseme-4533 branch September 2, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human-ready PR is ready for a human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants