Repository navigation
test(core): measure native ConPTY codepage initialization - #847
agenteinstinct1-max wants to merge 10 commits into
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
| resolve(result) | ||
| }) | ||
| try { | ||
| stdin.write(JSON.stringify({ type: "write", requestId, data }) + "\n") |
There was a problem hiding this comment.
SUGGESTION: stdin.write() return value (backpressure signal) is ignored. For sustained high-volume writes this could allow unbounded buffer growth in the bridge's stdin pipe. Consider checking the returned boolean and applying backpressure.
| return { run, outcome: () => outcome } | ||
| } | ||
| function parseJsonLines(output: string, prefix: string) { | ||
| const values: unknown[] = [] |
There was a problem hiding this comment.
SUGGESTION: parseJsonLines regex \\{.*?\\} is non-greedy and stops at the first }. It cannot parse JSON objects with nested braces. If CP stage payloads ever include nested structures, they will be silently skipped.
| try { | ||
| for (const _response of processed.responses) { | ||
| let writeResult = { ok: false, message: "", timedOut: false } | ||
| const writeAndWait = proc!.writeAndWait |
There was a problem hiding this comment.
SUGGESTION: Non-null assertion proc! bypasses TypeScript null-checking. Same pattern at lines 1071 and 1103. While proc is assigned before use in the current flow, the assertion removes type safety and could mask undefined access if control flow changes.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Incremental review focused on changes from Gap: targeted re-verification reads for prior suggestions on unchanged code were not completed in this run, so unverified previous findings are not carried forward. Files Reviewed (2 files)
Previous Review Summaries (4 snapshots, latest commit 65c54da)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 65c54da)This review did not finish. The model reached its output limit before it Previous review (commit 65c54da)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit e0dc889)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit d4b71de)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Reviewed by free · Input: 42.9K · Output: 2.8K · Cached: 120.8K |
Issue for this PR
Closes #846, which only asks for the missing measurement. This PR does not fix or explain any underlying defect. Refs #810 (not closed: its production defects remain).
Development link: #846 is linked in this PR's Development sidebar, because "Closes" in the body is not recognized for a non-default base branch.
Type of change
What does this PR do?
Adds a Windows-only measurement of native ConPTY codepage initialization: 3 new files under packages/core/test/pty (native-codepage-probe.test.ts, native-codepage-probe-helper.ps1, native-codepage-probe.md), 2337 additions, 0 deletions. The 6 native cases run in normal Windows CI and skip elsewhere. They record what each backend delivers with no output decoder applied. No production code, workflow, dependency or package-script changes. Base: 2ab1fca on dev-vibecoded. Current head: e0dc889 (chain 34853f8 -> dada8f1 -> d4b71de -> e0dc889 over previous head 217ba5e; the later commits harden probe liveness: fail closed on unknown PTY liveness and pending death, isolate the native Node probe, and tighten stream/cleanup contracts).
It does not claim a cause or a fix.
Interpretation limits: before-exit latency of the standalone box-drawing case is UNVERIFIED; ConPTY may consume OSC title sequences, so absence in output is ambiguous; raw CP437 payload is recorded separately from UTF-8 and wide output.
How did you verify your code works?
Checklist
Update 3 (head e0dc889, on top of d4b71de)
Adds bounded evidence diagnostics to the probe (still measurement only, no cause or fix): late-stderr capture, runtime phase markers, PowerShell-side phases, and a startup-failure observed-exit PID bookkeeping guard. +422/-20 across the 3 probe files. Writer host qualification on the exact head (Linux): 48 passed, 6 native skipped, 0 failed, 219 assertions; strict target typecheck exit 0. The 6 native cases skip on Linux (0 of 6 executed on the qualification host); on d4b71de's Windows CI they executed (3 node-backend failures, 3 bun-backend results, detailed below); the fresh Windows run on this head is pending and native behavior is not claimed green.
The previous head d4b71de fresh CI failed and is causally unresolved: Windows core 9 fail (3 native node-backend probe timeouts ~20s with no cpStages, 6 host-side node-runtime-bridge tests failing (5 at "node PTY bridge exited before spawn with code 1", plus the asynchronous EPIPE control failing expect(report.epipe).toBe(true))), Linux TUI 1 fail (scrollback-history "missing HISTORY-MARK-001", socket closed). These failures are not claimed fixed by this commit; the new instrumentation exists to gather evidence, and fresh CI on this head may fail usefully. No assertions were weakened. Residual limits (writer manifest): observed ChildProcess exit bookkeeping is not an OS ownership handle and a reap-before-event race remains; descendants of an already-exited bridge are unknown, not claimed clean; Windows native phase markers and the taskkill tree path were not executed on the Linux host. An exact named semantic review must cover the whole unreviewed 217ba5e..e0dc889 chain, not just this delta; this plus fresh all-green CI is required before merge.
Update 4: partial host invocation correction
Head
65c54dae86998d2ad0523897c6db6f2bf8ca0a4bcorrects five host invocation cases to use the actual Node bridge executable path; the literal default remains unchanged. Sentinel, negative controls and mutation controls were added. Author qualification: 49 host PASS, 6 native SKIP, 233 assertions, strict type check 0 errors. This is a partial host invocation fix only, not an AddType, late-pipe, EPIPE or barrier fix. Windows may remain RED. No broader source-cause claim beyond the exact beta12 executable lookup mechanism. Prior e0 results above remain historical. Fresh exact-head CI and full named review of the 217-to-65 chain are still required; no merge approval.Update 5: partial fd3 asynchronous control and bounded queue condition
Head
884d49333a8e91b8f41c6b2ae36a97b92bf19c9aadds a genuine asynchronous Node pipe control on fd3, not native stdin proof; the original stdin handler is unchanged. The early-queue check now waits for the actual queue condition with a 5-second bound. Author qualification: 51 host PASS, 6 native SKIP, 248 assertions, strict type check 0 errors; mutation controls RED. This candidate has not executed on Windows. Native AddType, late-grandchild stderr, abandoned-entry barrier and owned-default paths remain OPEN. The outer 5-second backstop may beat the 4+1-second cleanup budget: this fails closed but is not join proof. Earlier head results above are historical. Full named whole-chain review and fresh all-green CI remain required. No merge approval.Update 6: partial late-stderr fixture correction
Head
26d79d9f107353d57b7d517e019ec3ef9a1a5601changes the late fixture to require START before observed bridge exit before a fresh-token marker, with a bounded owned loopback and cleanup. Author qualification: 51 host PASS, 6 native SKIP, 263 assertions, strict type check 0 errors. Mutations: marker-before-exit RED, never-START RED, split marker GREEN; no-detach mutation is GREEN on Linux and non-discriminating. Native AddType remains OPEN. No Windows execution or OS-level reap proof is claimed for this candidate. Previous results above are historical. Exact whole-chain named review and fresh all-green CI are still required; no merge approval or additional completed merge.