Skip to content

🤖 fix: confirm pre-boundary message edits#3402

Merged
ethanndickson merged 1 commit into
mainfrom
message-edit-kwy5
May 28, 2026
Merged

🤖 fix: confirm pre-boundary message edits#3402
ethanndickson merged 1 commit into
mainfrom
message-edit-kwy5

Conversation

@ethanndickson
Copy link
Copy Markdown
Member

@ethanndickson ethanndickson commented May 27, 2026

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

@ethanndickson
Copy link
Copy Markdown
Member Author

@codex review

Copy link
Copy Markdown

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

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: 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".

Comment thread src/browser/utils/chatEditing.ts
@ethanndickson
Copy link
Copy Markdown
Member Author

@codex review
Please take another look.

Copy link
Copy Markdown

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

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: 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".

Comment thread src/node/services/agentSession.editMessageId.test.ts
@ethanndickson
Copy link
Copy Markdown
Member Author

@codex review
Please take another look.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

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

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 -->
@ethanndickson
Copy link
Copy Markdown
Member Author

@codex review

Rebased onto origin/main and squashed the branch into one commit.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

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

@ethanndickson ethanndickson enabled auto-merge May 28, 2026 02:26
@ethanndickson ethanndickson added this pull request to the merge queue May 28, 2026
Merged via the queue into main with commit 93be766 May 28, 2026
24 checks passed
@ethanndickson ethanndickson deleted the message-edit-kwy5 branch May 28, 2026 02:41
mux-bot Bot pushed a commit that referenced this pull request May 28, 2026
…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.
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