feat: use git-backed workspace diffs for memory consolidation#18982
feat: use git-backed workspace diffs for memory consolidation#18982
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bedf34af22
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd15970b5a
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f80399650
ℹ️ 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".
…system # Conflicts: # codex-rs/state/src/model/mod.rs
Why
This PR make the
morpheusagent (memory phase 2) use a git diff to start it's consolidation. The workflow is the following:.codex/memoriesdoes not exist or is not a git root, initialize everything (and make a first empty commit)raw_memories.mdandrollout_summaries/as before. Basically we select max N phase 1 memories based on a given policygix) to get a diff between the current state of.codex/memoriesand the last commit.phase2_workspace_diff.mdmorpheusand point it tophase2_workspace_diff.mdmorpheusto be done.gitand make one single commit on it. We do this because we don't want to preserve history through.gitand this is cheap anywayOn top of this, we keep the retry policies etc etc
The goals of this new workflow are:
chronicleAs a follow-up we will need to add support for user's edition while
morpheusis runningWhat Changed
phase2_workspace_diff.md, and reset the baseline after successful consolidation.raw_memories.mdandrollout_summaries/, prune old extension resources, skip clean workspaces, and run the consolidation subagent only when the workspace has changes.Verification
core/src/memories/tests.rs,core/src/memories/workspace_tests.rs,state/src/runtime/memories.rs, andcore/tests/suite/memories.rs.