Skip to content

fix(opencode): announce locally started sessions to the mobile live list - #13681

Merged
iscekic merged 2 commits into
mainfrom
kwf/locally-started-cli-sessions-aa28
Sep 2, 2026
Merged

iscekic merged 2 commits into
mainfrom
kwf/locally-started-cli-sessions-aa28

Conversation

@iscekic

@iscekic iscekic commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • CLI sessions that start locally (kilo run, TUI) now appear in the live list when their first turn opens.
  • A locally started session leaves the live list when it is disposed.
  • A completed turn does not remove the session from the live list.
  • Repeated turns on one session add no duplicate live-list entry.
  • The CLI does not announce a session when remote is disabled.
  • A first turn that races bootstrap remote enable waits for enable and still announces.
  • A failed announce rolls the attach back and retries on the next turn.
  • A failed detach rolls back so the session stays in the live list.

Why

The live list in the app is fed by the relay registry for each connection.
The registry is built only from attached-session ids on the remote heartbeat.
The CLI attached a remote session only from the app-spawned create_session path.
Locally created sessions connected and sent heartbeats but never announced.
They never appeared in the live list.

Verification

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

Notes for the reviewer

Dispose of an unowned id is a no-op.
This covers an app-spawned session that exit_cli already detached.

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

kilo-code-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/opencode/src/kilo-sessions/kilo-sessions.ts
  • packages/opencode/test/kilocode/sessions/kilo-sessions-local-announce.test.ts
Previous Review Summary (commit 087a802)

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

Previous review (commit 087a802)

Status: 1 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/opencode/src/kilo-sessions/kilo-sessions.ts 312 Deleted sessions can still be announced after the enabling wait
Files Reviewed (2 files)
  • packages/opencode/src/kilo-sessions/kilo-sessions.ts - 1 issue
  • packages/opencode/test/kilocode/sessions/kilo-sessions-local-announce.test.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 64.7K · Output: 15K · Cached: 484.5K

Review guidance: REVIEW.md from base branch main

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