fix(acp): replace EOL with newline for content splitting

- Replace `EOL` from `node:os` with `\n` for consistent line splitting in ACP connection output processing
- This ensures cross-platform compatibility since `EOL` is platform-specific while `\n` is universally used in text decoding
- The change maintains the same behavior on all platforms by using standard newline characters
This commit is contained in:
Matthieu Beaumont
2025-11-08 14:54:43 +01:00
parent 3c01c7153b
commit 6aaac12d70

View File

@@ -7,7 +7,6 @@
/* ACP defines a schema for a simple (experimental) JSON-RPC protocol that allows GUI applications to interact with agents. */
import { z } from 'zod';
import { EOL } from 'node:os';
import * as schema from './schema.js';
export * from './schema.js';
@@ -173,7 +172,7 @@ class Connection {
const decoder = new TextDecoder();
for await (const chunk of output) {
content += decoder.decode(chunk, { stream: true });
const lines = content.split(EOL);
const lines = content.split('\n');
content = lines.pop() || '';
for (const line of lines) {