Skip to content

fix: advertise new sessions at first turn start, not after it completes - #57

Merged
william0wang merged 1 commit into
mainfrom
fix/turn-start-session-discovery
Aug 18, 2026
Merged

fix: advertise new sessions at first turn start, not after it completes#57
william0wang merged 1 commit into
mainfrom
fix/turn-start-session-discovery

Conversation

@william0wang

Copy link
Copy Markdown
Owner

Problem

A brand-new conversation only became visible to remote clients (phone app, second editor) after its first turn fully completedmarkSessionActive fired only in prompt()'s finally block. A minutes-long first turn meant the session was invisible in remote discovery lists for minutes.

Fix

  • Mark the session active at turn start (right after the preempt-lock registration), so it appears in remote lists within one heartbeat of the first prompt — even while that turn is still running.
  • Seed a provisional title (first line of the prompt, capped at 60 chars) so the list entry isn't titleless. The backend's end-turn auto-title stays authoritative — its set-once gate is the separate server.sessionTitles set, so provisional titles never conflict with it.

Verification

  • Live-tested with an isolated-ports discovery probe: new session appeared in the discovery list at 8.0s while its first turn was still running (turn settled at 8.9s); the backend auto-title then won via heartbeat enrichment.
  • pnpm typecheck, pnpm lint, pnpm test all green (626/626).

Docs

  • docs/REMOTE-CLIENTS.md: discovery contract updated (first turn start + provisional titles)
  • CHANGELOG.md: [Unreleased] Fixed entry

@william0wang
william0wang merged commit 7e6b0d7 into main Aug 18, 2026
1 check passed
@william0wang
william0wang deleted the fix/turn-start-session-discovery branch August 18, 2026 13:28
@william0wang william0wang mentioned this pull request Aug 18, 2026
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