Fix: Add exception handling for ACP notification callbacks (#1050) - #1111
Merged
tbrandenburg merged 3 commits intoFeb 2, 2026
Conversation
added 2 commits
February 2, 2026 18:45
The ACP handler's onNotification callback was invoked without exception protection, allowing user callback errors to crash the Node.js process. Changes: - Wrapped callback invocation in try-catch with console.error logging - Added test case to verify exception handling works correctly - Process continues after callback errors instead of crashing Fixes #1050
Owner
Author
🔍 Automated Code ReviewSummaryAll checks pass. The implementation correctly addresses the root cause and follows existing codebase patterns. No blocking issues identified. Findings✅ Strengths
|
tbrandenburg
deleted the
fix/issue-1050-acp-callback-exception-handling
branch
February 2, 2026 18:04
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's onNotification callback was invoked without exception protection, allowing user callback errors to crash the Node.js process.
Root Cause
The notification callback (added in PR #1031) is invoked directly from an EventEmitter data handler without try-catch protection. If the callback throws, it crashes the process.
Changes
src/core/target-handlers/acp-handler.ts:142-150tests/unit/core/target-handlers/acp-handler.test.ts:540-570Testing
Validation
Issue
Fixes #1050
📋 Implementation Details
Implementation followed artifact:
.claude/PRPs/issues/issue-1050.mdDeviations from plan:
jest.spyOntovi.spyOnin test (Vitest framework instead of Jest)mockImplementation()for proper spy behaviorKey decisions:
console.errorfor logging (matches existing error handler patterns)Automated implementation from investigation artifact