fix: Emit plan contents in plan mode#326
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes missing plan visibility in ACP clients (e.g., Zed) by emitting plan item contents as standard agent_message_chunk updates, including support for plans that only arrive via item/plan/delta streaming.
Changes:
- Handle
item/plan/deltanotifications by buffering streamed plan text and emitting a plan message onitem/completed. - Emit
planthread items asagent_message_chunkupdates (withmessageId+ Codex phase meta) inCodexAcpServer. - Add a dedicated Vitest suite + snapshots covering plan delta buffering, fallback behavior, and ensuring
turn/plan/updatedremains an ACP checklist update.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/CodexEventHandler.ts | Adds handling for streamed plan deltas and emits completed plan text as an agent message chunk. |
| src/CodexAcpServer.ts | Updates plan item rendering to use createAgentTextMessageChunk (adds messageId + meta). |
| src/tests/CodexACPAgent/plan-events.test.ts | Adds coverage for plan delta buffering, fallbacks, and checklist plan updates. |
| src/tests/CodexACPAgent/data/plan-deltas.json | Snapshot for completed-plan emission after receiving plan deltas. |
| src/tests/CodexACPAgent/data/plan-delta-fallback.json | Snapshot for delta-buffer fallback when completed plan text is empty. |
| src/tests/CodexACPAgent/data/plan-completed-fallback.json | Snapshot for completed plan emission when no deltas streamed. |
| src/tests/CodexACPAgent/data/plan-checklist-update.json | Snapshot ensuring turn/plan/updated remains an ACP checklist update. |
| src/tests/CodexACPAgent/data/load-session-response-item-history-fallback.json | Snapshot update for plan item history output format (messageId + meta). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+115
to
+116
| case "item/plan/delta": | ||
| return this.createPlanDeltaEvent(notification.params); |
Comment on lines
+303
to
+304
| const text = this.planDeltaTextByItemId.get(event.itemId) ?? ""; | ||
| this.planDeltaTextByItemId.set(event.itemId, text + event.delta); |
AlexandrSuhinin
approved these changes
Jul 22, 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.
Closes #307