fix(sessions): read the composer from a styled capture so a prompt suggestion is not a draft

Claude Code draws its prompt suggestion in an empty composer, the first letter in the reverse-video cursor cell and the rest faint, so a plain capture read it as typed text and keep-warm never nudged those sessions. The keep-warm pane read now uses capture-pane -e and drops the suggestion before checking the composer.

Also from review: an off status carries no window, automation and an unreadable composer retry instead of stopping, a failed evaluation re-arms a retry, a trigger during an evaluation queues one follow-up that remove() cancels, and the cap's clock is seeded from lastSubmitAt for pre-upgrade state.
This commit is contained in:
JD committed 2026-10-19 19:58:14 -04:00
1 parent 5db6c633d3
commit 83d80578e4
13 files changed
+292 -37

No files matched your search

+3 -2
View File
@@ -1001,8 +1001,9 @@ export class Session extends EventEmitter {
// response viewer re-derive the live conversation without waiting for the
// user to type again.
this._lastSubmitAt = config.lastSubmitAt ?? 0;
// Restored so a restart neither reopens the keep-warm window nor drops the choice.
this._lastRealPromptAt = config.lastRealPromptAt ?? 0;
// Restored so a restart neither reopens the keep-warm window nor drops the choice. A state.json
// from before the field has only `lastSubmitAt`, and every submit then was a real one.
this._lastRealPromptAt = config.lastRealPromptAt ?? config.lastSubmitAt ?? 0;
this._keepWarmEnabled = config.keepWarmEnabled;
// Restored chain: its tail is the conversation the CLI was actually on when
// the server stopped, which outranks the launch id seeded just above. The