From de51577a408fc24698a111818d8fc36105786f33 Mon Sep 17 00:00:00 2001 From: seekskyworld Date: Wed, 16 Sep 2026 12:05:46 +0800 Subject: [PATCH 1/3] test(runtime): stabilize late ConPTY PID readiness Emit no trailing terminal control bytes after the readiness marker so PID-only observations compare a fully delivered output snapshot. Fixes #5372 Generated-by: OpenAI Codex Signed-off-by: seekskyworld --- packages/runtime/src/__tests__/shell-run-manager.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/runtime/src/__tests__/shell-run-manager.test.ts b/packages/runtime/src/__tests__/shell-run-manager.test.ts index d798e9b54a6..2cb6db9174c 100644 --- a/packages/runtime/src/__tests__/shell-run-manager.test.ts +++ b/packages/runtime/src/__tests__/shell-run-manager.test.ts @@ -350,7 +350,8 @@ describe('ShellRunProcessManager', () => { cwd, command: nodeCommand(` const { existsSync } = require('node:fs'); - process.stdout.write('READY\\n'); + // No trailing control bytes: seeing READY must mean the entire output arrived. + process.stdout.write('READY'); setInterval(() => { if (existsSync(${JSON.stringify(exitGate)})) process.exit(0); }, 10); From c4ed6a7e886dd1618472a7515d975ff3243d6e69 Mon Sep 17 00:00:00 2001 From: seekskyworld Date: Thu, 17 Sep 2026 22:27:59 +0800 Subject: [PATCH 2/3] test(runtime): document PTY snapshot readiness invariant Generated-by: OpenAI Codex Signed-off-by: seekskyworld --- packages/runtime/src/__tests__/shell-run-manager.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/runtime/src/__tests__/shell-run-manager.test.ts b/packages/runtime/src/__tests__/shell-run-manager.test.ts index 2cb6db9174c..a2c133c0a10 100644 --- a/packages/runtime/src/__tests__/shell-run-manager.test.ts +++ b/packages/runtime/src/__tests__/shell-run-manager.test.ts @@ -3098,6 +3098,7 @@ function waitForTerminalShellRun( ); } +// 若调用方随后比较输出快照,fixture 必须在匹配标记之后停止输出任何字节。 function waitForPtyText( manager: ShellRunProcessManager, ref: string, From e3d909b2780beb70f215bcdd21abff47f208dd94 Mon Sep 17 00:00:00 2001 From: seekskyworld Date: Sat, 10 Oct 2026 16:20:15 +0800 Subject: [PATCH 3/3] docs: explain regression invariants in English Generated-by: OpenAI Codex Signed-off-by: seekskyworld --- packages/runtime/src/__tests__/shell-run-manager.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime/src/__tests__/shell-run-manager.test.ts b/packages/runtime/src/__tests__/shell-run-manager.test.ts index a2c133c0a10..1d0ccf2addd 100644 --- a/packages/runtime/src/__tests__/shell-run-manager.test.ts +++ b/packages/runtime/src/__tests__/shell-run-manager.test.ts @@ -3098,7 +3098,7 @@ function waitForTerminalShellRun( ); } -// 若调用方随后比较输出快照,fixture 必须在匹配标记之后停止输出任何字节。 +// Snapshot comparisons require the fixture to emit no bytes after the readiness marker. function waitForPtyText( manager: ShellRunProcessManager, ref: string,