Skip to content

🤖 fix: suppress post-compaction continue notifications#3261

Open
ammar-agent wants to merge 1 commit intomainfrom
notifications-g4n7
Open

🤖 fix: suppress post-compaction continue notifications#3261
ammar-agent wants to merge 1 commit intomainfrom
notifications-g4n7

Conversation

@ammar-agent
Copy link
Copy Markdown
Collaborator

@ammar-agent ammar-agent commented May 9, 2026

Summary

Suppress notify-on-response for source-marked internal post-compaction resume turns. The policy is now owned by the transcript aggregator/response-completion layer instead of being threaded through backend stream/activity schemas. User-authored follow-up text after /compact (even exactly Continue) still notifies normally.

Background

I found the prior notification fixes, especially #2959 (🤖 fix: suppress notifications for auto-follow-up handoffs), plus the earlier compaction-specific fixes #1892 and #2914. That work was not regressed: the current test suite still encoded its intended behavior, namely “compaction with continue message should fire only ONE notification (for continue response)”. The remaining gap is narrower: internal mid-stream compaction resumes are implementation-detail follow-ups, but if the workspace is backgrounded during the handoff, the activity generation update clears stale active-stream context before the final background completion is inferred.

Implementation

  • Mark only mid-stream auto-compaction follow-ups with a source marker (dispatchOptions.source = "internal-resume"). On-send compaction preserves user-authored prompts, including prompts whose text is exactly Continue.
  • Keep notification suppression policy localized to StreamingMessageAggregator and response-completion metadata.
  • Let the aggregator preserve only explicitly suppressed completion metadata across a background streaming-generation handoff, while still dropping stale queued follow-up metadata for normal background turns.
  • Avoid adding notification-specific fields to backend stream events, workspace activity snapshots, persisted message metadata, or extension metadata.

Validation

  • bun test src/browser/utils/messages/StreamingMessageAggregator.test.ts src/browser/stores/WorkspaceStore.test.ts
  • make typecheck
  • make static-check

Risks

Low-to-medium. This touches the response completion notification policy and background activity handoff behavior, but the new suppression path is scoped to an explicit internal-resume source marker. User-authored compaction follow-ups remain notifying and are covered by tests.


Generated with mux • Model: openai:gpt-5.5 • Thinking: high • Cost: n/a

@ammar-agent
Copy link
Copy Markdown
Collaborator 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: 7553b82751

ℹ️ 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.ts Outdated
@ammar-agent ammar-agent force-pushed the notifications-g4n7 branch from 7553b82 to f02b2c4 Compare May 9, 2026 21:51
@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the auto-retry resume gap by preserving suppressResponseNotification in the same-session retry resume state and passing it through resumeStream() retries.

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: f02b2c4693

ℹ️ 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.ts Outdated
@ammar-agent ammar-agent force-pushed the notifications-g4n7 branch from f02b2c4 to 4877a0c Compare May 9, 2026 21:59
@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the source-specificity issue by marking only mid-stream auto-compaction follow-ups with dispatchOptions.suppressResponseNotification; user-authored on-send compaction prompts, including exact Continue, are covered by a non-suppression regression test.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

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

@ammar-agent ammar-agent force-pushed the notifications-g4n7 branch from 4877a0c to 830d092 Compare May 10, 2026 00:11
@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Refactored per feedback: notification-specific suppression is no longer threaded through backend stream/activity schemas or persisted metadata. The backend only marks the compaction follow-up source as internal-resume; StreamingMessageAggregator owns the response-completion notification policy and background handoff preservation.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

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

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