Forward warning messages and compact notifications to client#175
Merged
benbrandt merged 1 commit intozed-industries:mainfrom Mar 5, 2026
Merged
Conversation
After /compact runs, the client received no feedback — the LLM-driven summarization ran silently and only a stopReason notification arrived. This change improves the UX in two ways: 1. When a ContextCompaction TurnItem completes (or a ContextCompacted event fires), send an agent message "Context compacted" so users see explicit confirmation that the operation finished. 2. Forward Warning events as agent messages. Codex emits user-facing warnings in several situations (post-compact advisory, deprecated config notices, etc.). Previously they were only logged server-side; now clients receive them as session/update notifications. Fixes zed-industries#164 Co-Authored-By: Claude <noreply@anthropic.com>
benbrandt
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #164
When
/compactruns, users received no feedback during the operation — the LLM-driven summarization ran silently and only astopReasonnotification arrived at the end. This PR adds two complementary improvements:Context compaction notification: When a
ContextCompactionturn item completes (viaItemCompletedevent) or aContextCompactedevent fires, the adapter sends an agent message"Context compacted"to the client, giving users explicit confirmation.Warning forwarding: Codex emits user-facing
Warningevents in several situations — the post-compact advisory ("Heads up: Long threads…"), deprecated config notices, etc. Previously these were only logged server-side. Now they are also forwarded to the client assession/updateagent messages.Changes
src/thread.rs:codex_protocol::items::TurnItemItemCompletedhandler: send"Context compacted"when item isContextCompactionWarninghandler: forward the message to the client as an agent text notificationContextCompactedhandler (moved out of the ignored-events list)🤖 Generated with Claude Code