🤖 fix: confirm pre-boundary message edits#3402
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5abb02e587
ℹ️ 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: 135e202f35
ℹ️ 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 |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Allow editing displayed user messages from before the latest context boundary, but require an explicit composer confirmation before the edit truncates the compaction or reset summary and later history. Keep edit truncation snapshot-safe by falling back to full-history lookup when the edited message is outside the active context window, so synthetic file or skill snapshots immediately before the edited message are removed with it. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: $22.15_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=22.15 -->
0fb8dcc to
ef00579
Compare
|
@codex review Rebased onto origin/main and squashed the branch into one commit. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…ding The exec-subagent hard-restart path in maybeHardRestartExecSubagentOnContextExceeded walks backward from the first prompt to include any contiguous synthetic snapshots in its seed slice. The loop inlined the same role/metadata predicate that isSyntheticSnapshotUserMessage already exposes on the class — and that the new pre-boundary edit truncation helper introduced in #3402 also routes through. Route this callsite through the same predicate so all synthetic-snapshot detection in agentSession.ts goes through one definition; pure dedup with no behavior change (the inlined '?? ' chain and the helper's '!== undefined' chain are equivalent for the array/object snapshot fields). The execSubagentHardRestart tests in agentSession.postCompactionRetry.test.ts and agentSession.startupAutoRetry.test.ts continue to pass.
Summary
Allow editing user messages from before the latest compaction or context-reset boundary again, while requiring a confirmation before the edited send proceeds.
Background
The edit pipeline already truncates chat history from the edited message, which naturally discards any later compaction/reset boundary and summary. The recent editability gate prevented that older behavior entirely, so users could no longer revise pre-compaction turns.
Implementation
Pre-boundary user messages are editable again, and the edit state carries whether the source row was before the latest context boundary. When sending one of those edits, the composer opens a confirmation dialog explaining that the send will discard the latest compaction/reset summary and every message after the edited one; confirming reruns the normal send path with an internal confirmation bypass.
The backend edit truncation target lookup now falls back to full-history search when the edited message is outside the active context window, so immediately preceding file/skill snapshot rows are still removed before appending the replacement message.
Risks
The intended destructive behavior is restored for users who confirm the dialog. The main regression risk is around the send affordance for pre-boundary edits; normal edits, side-question rows, goal continuation rows, local command output edit gates, and snapshot cleanup for post-boundary edits remain covered.
Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh• Cost:$9.77