mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
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:
@@ -7,7 +7,6 @@
|
|||||||
/* ACP defines a schema for a simple (experimental) JSON-RPC protocol that allows GUI applications to interact with agents. */
|
/* ACP defines a schema for a simple (experimental) JSON-RPC protocol that allows GUI applications to interact with agents. */
|
||||||
|
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { EOL } from 'node:os';
|
|
||||||
import * as schema from './schema.js';
|
import * as schema from './schema.js';
|
||||||
export * from './schema.js';
|
export * from './schema.js';
|
||||||
|
|
||||||
@@ -173,7 +172,7 @@ class Connection {
|
|||||||
const decoder = new TextDecoder();
|
const decoder = new TextDecoder();
|
||||||
for await (const chunk of output) {
|
for await (const chunk of output) {
|
||||||
content += decoder.decode(chunk, { stream: true });
|
content += decoder.decode(chunk, { stream: true });
|
||||||
const lines = content.split(EOL);
|
const lines = content.split('\n');
|
||||||
content = lines.pop() || '';
|
content = lines.pop() || '';
|
||||||
|
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
|
|||||||
Reference in New Issue
Block a user