Repository navigation
Thread recap: auto-cached summary when returning to an idle thread (#239) - #1569
Conversation
) Build a short Asked / Changed / Now / Open recap after every successful turn and cache it on the thread. Extractive by default; on-device fm rewrites it when available, so no cloud provider is billed. threads.get returns it when the thread sat unvisited 30+ min, or for a fresh fork (the source's recap). ThreadView shows a dismissible card. Hand-off prefixes now lead with the source recap. Sidebar rows omit it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7bbf131bb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const recap = | ||
| source && source.recap && source.recap.text | ||
| ? `Recap:\n${source.recap.text}\n\n` | ||
| : ""; |
There was a problem hiding this comment.
Omit stale recaps when replaying a rewind
When replayContext is set, sourceId is the current thread, so this reads the thread's cached recap even after rewindThread has truncated the messages without clearing that recap. The next resubmitted turn therefore receives a summary of the discarded future alongside the retained tail, allowing removed instructions or results to influence—and potentially recreate—the work the user explicitly rewound. Only prepend the recap for an actual handoff, or invalidate/rebuild it when rewinding.
Useful? React with 👍 / 👎.
| // A newer turn may have landed while fm ran; its own refresh wins. | ||
| if ((store.getMessages(threadId) || []).length !== msgs.length) return null; | ||
| if (!store.getThread(threadId)) return null; | ||
| const recap = { text: (fm && fm.trim()) || extractive, at: Date.now() }; |
There was a problem hiding this comment.
Bound and validate fm recap output
When the optional on-device fm returns a verbose or malformed response, this accepts it wholesale despite the four-line instruction being advisory; fmRun permits up to 64 KiB. That oversized text is persisted on every affected thread, rendered in the recap card, and later prepended outside HANDOFF_TOTAL_MAX, potentially consuming a substantial portion of a fork's agent context. Enforce a recap size/line cap and fall back to the bounded extractive recap when the output does not match the requested format.
Useful? React with 👍 / 👎.
Closes #239.
What
electron/recap.js: after every successful turn, build an Asked / Changed / Now / Open recap and cache it on the thread (recap: { text, at }). Extractive (free, deterministic); on-devicefmrewrites it when present. No cloud provider is billed.threads.getreturnsdetail.recapwhen the thread sat unvisited ≥30 min (and isn't working), or for a fresh fork with no recap of its own (shows the source's). Computed before thelastVisitedAtstamp; background pushes never carry it.detail.recap); cached details strip it so a stale one can't reappear.buildHandoffPrefixleads with the source thread's recap when it has one.recap; writing it does not touchupdatedAt.Tests
electron/test/recap.test.js: extractive text, fm preference, mid-build staleness guard, idle rule, list stripping, fork display + handoff seed.test/forkHandoff.test.tsx: recap card renders when due and dismisses.Known limits
src/devCoder.tsdev twin not updated.🤖 Generated with Claude Code