refactor: route v2 context changes through context ops#1359
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2135b7d58d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // The wire map accepts any `context.${string}` type, so unknown operation | ||
| // types can't be caught at compile time — fail the restore loudly instead | ||
| // of silently dropping an unclaimed context record. |
There was a problem hiding this comment.
Move inline rationale into the file header
packages/agent-core-v2/AGENTS.md requires comments in this tree to live only in the top-of-file /** */ block and says to "never beside functions, methods, or statements"; this newly added inline rationale comment violates that convention, as do similar new inline comments elsewhere in the commit. Please fold this rationale into the file header or remove it so the source stays consistent with the documented rule.
Useful? React with 👍 / 👎.
1d55671 to
7d44096
Compare
…ps-wire # Conflicts: # packages/agent-core-v2/src/agent/contextMemory/messageId.ts # packages/agent-core-v2/src/agent/goal/goalService.ts
Related Issue
No linked issue. This PR addresses the v2 context mutation wire format and replay ownership cleanup.
Problem
The v2 agent currently mixes direct context memory mutation with wire record replay concerns. Context updates such as append, remove, clear, compact, and undo need a single operation surface so live execution, replay, migration, and blob offload all stay aligned.
What changed
contextOpsdomain that owns context append/remove/clear/replace operation registration.IAgentContextOpsServiceinstead of direct context splices.context.appenduses flat message args while still tolerating the older nested append shape during restore/offload paths.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.Validation:
git diff --checkCOREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm -C packages/agent-core-v2 exec vitest run test/wireRecord/migration/v1.5.test.ts test/wireRecord/persistence.test.tsNotes: