Fix: Add streaming notification support to ACP handler (#995) - #1031
Merged
Conversation
added 2 commits
February 2, 2026 18:23
The ACP handler currently ignores all JSON-RPC notifications (messages without `id` field). This adds an optional callback mechanism to enable real-time progress feedback during long AI responses. Changes: - Add optional `onNotification` callback to ACPTargetConfig interface - Store current config reference in ACPTargetHandler class - Handle notifications in handleMessage() by invoking callback - Add 4 comprehensive test cases for notification handling - Maintain 100% backward compatibility (callback is optional) Fixes #995
Owner
Author
🔍 Automated Code ReviewSummaryThe implementation correctly addresses the root cause and adds streaming notification support as specified. Code quality is excellent with good test coverage. Two potential issues identified that should be considered. Findings✅ Strengths
|
5 tasks
Owner
Author
|
Follow-up issue created: #1050 - Add exception handling for notification callbacks This addresses the callback exception handling suggestion from the code review. |
5 tasks
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
The ACP handler currently ignores all JSON-RPC notifications (messages without
idfield) at line 140 ofacp-handler.ts. This PR adds an optional callback mechanism to enable real-time progress feedback during long AI responses, as demonstrated in the PoC.Root Cause
The
handleMessage()method inACPTargetHandleronly processes RPC responses (messages with anidfield that match pending requests). All other messages are silently ignored with a comment at line 140. This prevents consumers from receiving streamingsession/updatenotifications that provide incremental progress updates.Changes
src/types/notification.tsonNotificationcallback to ACPTargetConfig interfacesrc/core/target-handlers/acp-handler.tstests/unit/core/target-handlers/acp-handler.test.tsTesting
Validation
Test Results:
Issue
Fixes #995
📋 Implementation Details
Implementation followed artifact:
.claude/PRPs/issues/issue-995.mdDeviations from plan:
config as ACPTargetConfig) to fix linting errorKey Design Decisions:
Automated implementation from investigation artifact