🤖 fix: persist compaction follow-up delivery#1958
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b446401329
ℹ️ 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".
d5cfeb7 to
42df067
Compare
|
@codex review Addressed legacy continueMessage fallback and preserved baseOptions for compaction follow-ups. Added coverage for base options + legacy metadata. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5eaaf61fb8
ℹ️ 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".
3e041cd to
e11982b
Compare
|
@codex review |
|
re-running CI |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0752cd1eb2
ℹ️ 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".
- Await dispatchPendingFollowUp() before sendQueuedMessages() to prevent race where queued messages could append before follow-up reads history - Extend CompactionFollowUpRequest to include preserved send options (thinkingLevel, additionalSystemInstructions, providerOptions, etc.) - Pass preserved options through prepareCompactionMessage() and dispatchPendingFollowUp() so follow-up uses original user settings - Add model fallback (DEFAULT_MODEL) for legacy follow-ups lacking model Addresses sub-agent review feedback on PR #1958.
- Await dispatchPendingFollowUp() before sendQueuedMessages() to prevent race where queued messages could append before follow-up reads history - Extend CompactionFollowUpRequest to include preserved send options (thinkingLevel, additionalSystemInstructions, providerOptions, etc.) - Pass preserved options through prepareCompactionMessage() and dispatchPendingFollowUp() so follow-up uses original user settings - Add model fallback (DEFAULT_MODEL) for legacy follow-ups lacking model Addresses sub-agent review feedback on PR #1958.
75eefeb to
bf6097a
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf6097ac06
ℹ️ 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".
- Await dispatchPendingFollowUp() before sendQueuedMessages() to prevent race where queued messages could append before follow-up reads history - Extend CompactionFollowUpRequest to include preserved send options (thinkingLevel, additionalSystemInstructions, providerOptions, etc.) - Pass preserved options through prepareCompactionMessage() and dispatchPendingFollowUp() so follow-up uses original user settings - Add model fallback (DEFAULT_MODEL) for legacy follow-ups lacking model Addresses sub-agent review feedback on PR #1958.
cfd40da to
07fb2a9
Compare
- Add CompactionSummaryMetadata type with pendingFollowUp field - Attach follow-up to summary message in performCompaction() - Add dispatchPendingFollowUp() method for single-owner dispatch - Call from subscribeChat() (crash recovery) and stream-end (normal flow) - Remove in-memory queue logic for follow-ups (70+ lines removed) Follow-up content now survives app crashes because it's persisted on the summary message. The existence of a subsequent user message serves as proof of dispatch (no history rewrite needed).
Add legacy format handling for older persisted compaction requests:
- Convert mode ("exec"|"plan") to agentId when agentId is missing
- Support imageParts as alias for fileParts
Update test to reflect new crash-safe architecture where follow-up
is dispatched from summary message instead of in-memory queue.
- Await dispatchPendingFollowUp() before sendQueuedMessages() to prevent race where queued messages could append before follow-up reads history - Extend CompactionFollowUpRequest to include preserved send options (thinkingLevel, additionalSystemInstructions, providerOptions, etc.) - Pass preserved options through prepareCompactionMessage() and dispatchPendingFollowUp() so follow-up uses original user settings - Add model fallback (DEFAULT_MODEL) for legacy follow-ups lacking model Addresses sub-agent review feedback on PR #1958.
Add pickPreservedSendOptions() to centralize the field list for preserved send options, avoiding duplication across type definition, assignment, and usage sites.
…ring Change void to await so the follow-up message is persisted before sendQueuedMessages() runs, preventing race conditions where queued messages could be appended before the follow-up.
07fb2a9 to
044f2da
Compare
Summary
Background
Queue-based follow-up delivery could drop "continue" messages on aborts/errors or resume flows. This change makes follow-up delivery deterministic from persisted compaction metadata instead of ephemeral queues.
Implementation
Validation
make static-checkRisks
Generated with
mux• Model:openai:gpt-5.2-codex• Thinking:xhigh• Cost:$42.05