fix: redirect Winston logger to stderr to prevent IPC stream corruption + fix binary tests#11914
Merged
fix: redirect Winston logger to stderr to prevent IPC stream corruption + fix binary tests#11914
Conversation
…al requests The binary tests were failing because Core sends getIdeInfo, getIdeSettings, and getControlPlaneSessionInfo on startup but the test had no handlers for these messages (ReverseMessageIde was commented out), causing the binary to crash immediately.
Contributor
|
No documentation updates needed for this PR. This change fixes internal test infrastructure by wiring up |
…t corruption
- Replace ReverseMessageIde with BinaryIdeHandler that responds with plain
data (matching Kotlin CoreMessenger format) instead of the JS _handleLine
auto-wrapper
- Unwrap binary responses in test assertions (binary wraps in {done, content, status})
- Redirect Winston Console transport to stderr so it never corrupts the
stdout IPC JSON stream
- Update stale test expectations (models → modelsByRole, expected files)
- Add stderr capture for debugging binary crashes
- Set jest timeout to 30s for binary startup
Contributor
There was a problem hiding this comment.
2 issues found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="binary/test/binary.test.ts">
<violation number="1" location="binary/test/binary.test.ts:85">
P2: Avoid per-chunk `Buffer.toString()` for stdout IPC parsing; use stream UTF-8 decoding (`setEncoding("utf8")`) so split multibyte characters are handled correctly.
(Based on your team's feedback about Node.js child process stream decoding with UTF-8 StringDecoder.) [FEEDBACK_USED]</violation>
<violation number="2" location="binary/test/binary.test.ts:246">
P2: `BinaryIdeHandler` is created even in TCP mode where `subprocess` is undefined, which will crash test setup when `USE_TCP` is enabled.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
This was referenced Mar 27, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
process.stdout, which corrupts the\r\n-delimited JSON IPC stream between the binary and JetBrains plugin. Redirected all Winston log levels to stderr instead.ReverseMessageIdewithBinaryIdeHandlerthat responds with plain data matching the KotlinCoreMessengerformat, added response unwrapping for test assertions, and updated stale test expectations (models→modelsByRole, expected files).Test plan