Skip to content

Surface a silent session reset in Ask Lucid#114

Merged
ankitsejwal merged 1 commit into
mainfrom
feat/flag-silent-session-reset
Jul 9, 2026
Merged

Surface a silent session reset in Ask Lucid#114
ankitsejwal merged 1 commit into
mainfrom
feat/flag-silent-session-reset

Conversation

@ankitsejwal

Copy link
Copy Markdown
Member

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

  • Daemon flags the done frame with freshStart: true when it had a resume handle but fell back to a fresh session — both the coding path (runCodeTurn.ts) and the pod ask path (room/client.ts). It's set only when the user expected continuity (a resume was sent); a fresh-from-start turn is never flagged.
  • Wire (@lucidity/shared): an optional freshStart on the done stream event.
  • Phone:
    • roomClient threads freshStart into onDone meta and logs a session-reset diag event (red) so it shows in the diagnostics panel and counters.
    • The Lucid bubble shows a small amber note — "♻︎ Couldn't resume the earlier thread — answered from a fresh start (no memory of earlier messages)" — so the user learns immediately, instead of discovering it by quizzing the model's memory.
    • The Markdown export marks it too, so a pasted transcript reflects it.

Tests

  • Daemon: the self-heal fallback test now asserts 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.
  • Mobile tsc --noEmit clean.

With this, the exact failure behind #107 — a reply that silently forgot the conversation — now says so on the bubble and logs a session-reset in diagnostics.

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.
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