Skip to content

fix: use dedicated flag for restart detection in session lifecycle#389

Merged
alari76 merged 1 commit intomainfrom
fix/opencode-model-and-thinking
Apr 12, 2026
Merged

fix: use dedicated flag for restart detection in session lifecycle#389
alari76 merged 1 commit intomainfrom
fix/opencode-model-and-thinking

Conversation

@alari76
Copy link
Copy Markdown
Contributor

@alari76 alari76 commented Apr 12, 2026

Summary

  • Use _processStartedOnce flag instead of _lastReportedModel to detect process restarts
  • Fixes double "Session started" when the first OpenCode process never emits system_init (because it starts without a model, then gets restarted when the frontend sets one)

Test plan

  • Create new OpenCode session — verify only ONE "Session started" message appears
  • All 1591 tests pass

🤖 Generated with Claude Code

…tup (#386)

Use a dedicated _processStartedOnce flag to detect restarts instead of
_lastReportedModel, which may be undefined when the first process never
emitted system_init (e.g. OpenCode sessions starting without a model).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alari76 alari76 merged commit 832fb60 into main Apr 12, 2026
@alari76 alari76 deleted the fix/opencode-model-and-thinking branch April 12, 2026 16:25
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