Skip to content

Distill a completed thread into a durable memory/rule with o - #1587

Merged
currentbits merged 2 commits into
mainfrom
coder/distill-a-completed-thread-into-a-durabl-940f3e
Oct 11, 2026
Merged

currentbits merged 2 commits into
mainfrom
coder/distill-a-completed-thread-into-a-durabl-940f3e

Conversation

@currentbits

Copy link
Copy Markdown
Owner

No description provided.

Thread overflow gains "Save as memory…": runs.distillMemory asks the
local model for one {type, title, body} lesson (fallback: thread title +
closing assistant message), then opens the Memory tab's add form
prefilled. Nothing is stored until the user saves; the entry carries a
thread citation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T08:56:47.924531Z 3976b30 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3976b30e7d

ℹ️ 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".

Comment thread src/App.tsx
Comment on lines +900 to +904
const draft = await api.runs.distillMemory({
threadId: selectedThreadId,
});
setDistillError(null);
setMemoryDraft(draft);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the source project attached to the memory draft

If the user switches to a thread in another project while distillMemory is awaiting the local model, this completion puts the original thread's draft into the now-current AgentsPanel; MemoryTab.handleSave then scopes it using the current projectSlug. The resulting durable memory cites the original thread but is stored for the wrong project, so preserve the source project/context with the request or discard stale completions.

Useful? React with 👍 / 👎.

Comment thread electron/distill.js
"- body keeps only non-obvious decisions, gotchas and their reasons; no play-by-play of the work",
"- body is at most 1500 characters",
"",
buildTranscript(thread, messages) || "(empty thread)",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve closing turns in the memory prompt

For any thread whose serialized user/assistant text exceeds DISTILL_PROMPT_LIMIT (6000 characters), buildTranscript returns only body.slice(0, 6000), so this call drops every later turn—including the final diagnosis and outcome that contain the durable lesson. The model will therefore distill incomplete opening context for typical long agent threads; construct the bounded memory transcript so the closing turns are retained.

Useful? React with 👍 / 👎.

@currentbits
currentbits merged commit f536044 into main Oct 11, 2026
6 checks passed
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