Repository navigation
Distill a completed thread into a durable memory/rule with o - #1587
Conversation
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]>
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: 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".
| const draft = await api.runs.distillMemory({ | ||
| threadId: selectedThreadId, | ||
| }); | ||
| setDistillError(null); | ||
| setMemoryDraft(draft); |
There was a problem hiding this comment.
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 👍 / 👎.
| "- 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)", |
There was a problem hiding this comment.
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 👍 / 👎.
No description provided.