Surface a silent session reset in Ask Lucid#114
Merged
Conversation
When the daemon has a `resume` handle but it yields nothing in time, it restarts as a fresh, memoryless Claude session — a real reply that has quietly forgotten the conversation (the silent path behind #107). Flag it end-to-end so it's never invisible: the daemon stamps `freshStart` on the done frame (coding + pod ask, only when a resume was expected), the phone logs a `session-reset` diagnostic and shows a small note on the bubble, and the Markdown export marks it too.
This was referenced Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the deferred bullet from #109 and closes the loop on #107: surface when the daemon silently answers from a fresh, memoryless session.
Why
The #107 fix (#110) makes the daemon's "resume produced nothing → restart fresh" fallback rare, but a genuinely dead/pruned handle still triggers it — and it was invisible: the phone got a normal-looking reply that had quietly lost the conversation. That silence is exactly how the original bug hid for a day. This makes the fallback observable end-to-end.
What
doneframe withfreshStart: truewhen it had aresumehandle but fell back to a fresh session — both the coding path (runCodeTurn.ts) and the podaskpath (room/client.ts). It's set only when the user expected continuity (a resume was sent); a fresh-from-start turn is never flagged.@lucidity/shared): an optionalfreshStarton thedonestream event.roomClientthreadsfreshStartintoonDonemeta and logs asession-resetdiag event (red) so it shows in the diagnostics panel and counters.Tests
freshStart: true; the successful-resume and a new fresh-from-start test assert it's absent; the ask-path hang→retry test asserts the flag. Full suite 49/49.tsc --noEmitclean.With this, the exact failure behind #107 — a reply that silently forgot the conversation — now says so on the bubble and logs a
session-resetin diagnostics.