Repository navigation
test(windows): record native PTY stress lifecycle milestones - #25042
Conversation
Preserve the gate assertions, deadlines, concurrency and cleanup while recording bounded sanitized diagnostics.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe Windows PTY stress observer tracks PTY and worker events and produces bounded state snapshots. The stress script reports input hashes and sanitized paths, transcript output, and error stacks. It records observer checkpoints during spawn, timeout, kill, and completion paths. The Windows PTY test prints stdout only when the process exits with code 0 and does not time out. OpenCode Go key resolution prepares a copied default environment through the managed data-account service. Explicitly supplied environments remain unchanged. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to This change adds diagnostics to the Windows PTY stress test and prepares the default OpenCode Go key-resolution environment. The review found no remaining merge-blocking risk. A real Windows CI run is still needed to qualify the stress behavior. Architecture SummaryArchitecture risk: 🟡 Medium · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Reliability and maintainability
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
72b42d1d-6e4d-4a27-a31e-184ba7f2a441
📒 Files selected for processing (4)
config/scripts/windows-pty-table-stress-observer.mjsconfig/scripts/windows-pty-table-stress-observer.test.mjsconfig/scripts/windows-pty-table-stress.cjssrc/main/windows/windows-pty-job.win32.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Reuse the existing probe invocation pattern while preserving native callback receiver, arguments, return value and thrown errors.
* Add host-owned OpenCode and Devin account profiles * Manage OpenCode and Devin profiles in account Settings * Expose registered account roots to host transcript readers * Clarify managed profile provider flags * Retain isolated Electron home in browser sidecars * Restore inherited account environment and preserve cleanup retries * Check relay environment values before merging * fix(opencode): keep saved Go credentials in main-owned storage Co-authored-by: kespineira <[email protected]> Co-authored-by: kevimux <[email protected]> * test(opencode): retain legacy key ownership across worker writes * Consolidate managed account type imports * test(accounts): provide OpenCode credential API in lifetime fixture * fix(accounts): use existing localized provider names Align the new Japanese account copy with the existing catalog repair policy. * Keep managed account baselines private to the execution host * Align account enrollment help with accepted providers and flags * Show the active System account in managed profile lists * Document the validated Linux managed account scope * fix(opencode): resolve Go keys by execution backend * Use host-private account restoration for OpenCode Go usage * Fix managed account removal, credential audits, and runtime bundling * Quarantine removed accounts and audit captured credential snapshots * fix(accounts): canonicalize account removal to rm Use account rm as the canonical removal command and keep account remove as an alias. Preserve the existing accounts.removeData RPC and the full original 63-path account component. Original-Account-Source: cf71ae4 Frozen-Account-Base: 08ee7ba Frozen-Integrated-Main: 53f9ea7 Private validation source only; no ref or publication. * fix(accounts): recover interrupted profile removal on startup Scan private removal backups before quarantined cleanup, reuse the existing state schema to validate the exact UUID, and preserve registered or unmarked profiles. Mark account rm as destructive using the existing typo recovery policy. Retain the full original account component and public author ancestry. Account-PR: 24636 Original-Account-Source: cf71ae4 Reviewed-Public-Parent: 6abaf73 Frozen-Integrated-Main: 53f9ea7 Private source only; no ref or publication. * fix(accounts): protect registered UUID case variants during removal recovery Compare validated account UUID identities without changing stored IDs or filesystem paths. Protect registered originals and quarantines, including explicit retry variants, and accept equivalent UUID spelling in a valid removal backup. Retain the complete account component and published contributor ancestry. Private source only; no index, ref, or public mutation. * Allow cold node-pty setup on Windows ARM CI Keep a ten-minute bound only for node-pty rebuilt on Windows ARM CI hosts; all other node-gyp calls retain five minutes. Cold setup in two completed ARM jobs left compilation less than a minute. --------- Co-authored-by: kespineira <[email protected]> Co-authored-by: kevimux <[email protected]>
There was a problem hiding this comment.
Important
The static analysis job fails on anti-slop/no-reflect-apply at config/scripts/windows-pty-table-stress-observer.mjs:152, which cascades into the verify aggregator — required checks are red on a6a10f0. There is also a small redaction gap in the new sanitizer that the shielding introduces. Both are inline.
Reviewed changes
- New stress observer (
config/scripts/windows-pty-table-stress-observer.mjs) — records bounded, sanitized PTY lifecycle milestones (spawn return, first data, socket/worker state, native exit callback) and pending per-terminal snapshots at each existing deadline. - Observer unit tests (
...observer.test.mjs) — pin callback transparency, error-monitor handling, event/record bounds, same-length redaction, and loaded-input hashing. All 7 pass locally. - Stress script wiring (
windows-pty-table-stress.cjs) — creates the observer, watches each terminal, reports pending state at both deadlines and on completion, and sanitizes transcript/error output. - Windows test (
windows-pty-job.win32.test.ts) — logs the stress stdout on success.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta. The
static analysisblocker is fixed; the previously-flagged sanitizer redaction gap is unchanged and its thread remains open.
Reviewed changes
- Native exit callback made anti-slop compliant (
config/scripts/windows-pty-table-stress-observer.mjs) —original.call(this, ...args)replacesReflect.apply(original, this, args)in the_$onProcessExitwrapper, preserving the receiver, arguments, return value, and thrown errors while clearinganti-slop/no-reflect-apply; the existing callback-transparency test still pins that behavior.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…inals Reuse transcript redaction after presentation-control removal while preserving OSC boundaries and exact controls. Keep the warmup survivor and newest bounded terminal records without changing native assertions or timing.
Reuse a second same-length transcript-redactor pass before restoring control sequences. Preserve native stress assertions and timing; consolidate the regression test OS imports.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Sanitizer redaction gap closed (
config/scripts/windows-pty-table-stress-observer.mjs) —sanitizeStressTextnow elides CSI controls from the scan text, records each control's visible-text offset, redacts the control-stripped text, then restores every control at its offset, while intentionally retaining OSC open/close framing as a boundary so a title payload cannot merge with adjacent rendered text. - Identity-masked emails caught by a second pass — a second same-length
redactTranscriptpass removes an email whose local part was claimed by a local username/hostname finding in the first pass, closing the plain/CSI/OSC email leaks. - Bounded snapshots retain the useful window —
watch()now splices out the oldest recent terminal (index 1) when the warmup survivor occupies index 0, so the survivor plus the newest 31 terminals survive instead of later terminals being dropped entirely while still counted as omitted. - Regression coverage (
config/scripts/windows-pty-table-stress-observer.test.mjs) — added an interrupted-secret matrix (email domain/name, vendor key, bearer token), interrupted-OSC-title independence, 11-round retention, post-256-milestone retention, and username/hostname email-priority cases; 22 tests pass locally.
I independently fuzzed the new sanitizer with a CSI inserted at every position of email, vendor, bearer, and opaque-token secrets (and two CSIs at all position pairs): 0 leaks, with the same-length invariant preserved. The previously-open redaction thread is retired.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

ELI5
When a Windows terminal stress test stalls, its old log cannot show where progress stopped. The test now records bounded, sanitized lifecycle observations while keeping its existing assertions and timing.
What Changed
Record output-pipe, worker, native exit and final callback milestones, pending state at existing deadlines, and hashes of the native addon and supporting files. Redact addresses and credentials even when terminal controls split them, preserving the controls’ positions. Keep the warmup survivor and newest 31 terminals; later terminals still receive observers, with omissions counted explicitly.
Why
The failing Windows job had one silent terminal and at least one undrained callback. An earlier passing job used the same source and cache inputs, without a loaded-addon hash. Observing the existing objects supplies missing evidence while preserving the gate. Bounded recent records retain the terminals most likely involved in a late failure.
Linked Issue
Diagnosis of PR #25031’s Windows package failure. This does not claim that the original native cause is fixed or close a product issue.
Visual Proof
N/A — test diagnostics add no UI or interaction change.
Testing
On the exact previous public helper, eight strengthened controls failed and six passed. They reproduce control-interrupted credential/address leaks, omitted late terminals after eleven rounds, and late state after the 256-milestone cap. Independent review then reproduced six more leaks on the intermediate helper: usernames and hostnames masked only part of an email. The final helper runs the existing same-length redactor a second time, removing the remaining private domain while preserving controls and OSC framing. Those six before failures and two credential-overlap controls are retained. Corrected source
5037c18a898571539ade5336ad3519cd49dfb20fpasses 171 controls in four files, including all 22 observer controls, the full anti-slop audit, syntax/AST checks, focused format/lint and six quality gates.The previous public source
f1ed3e97passed actual Windows CI: 25 PTYs, eight rounds, 526 passing tests and 26 skips, plus build, package and smoke checks. Its native stress/driver files remain exact here; the observer has changed, so fresh normal CI must qualify this complete correction. The passing run’s native-addon hash differs from the historical failure; it does not explain that failure.Review
All four original diagnostic files and public ancestry are retained; all 32,245 paths outside that scope match main
786a040b. The existing redactor runs twice on a view with presentation controls removed, then controls are restored at their original positions; OSC framing separates title payloads from adjacent text. Logs retain 32 terminal records and 256 milestones with explicit omissions, plus bounded final snapshots. The native callback preserves its receiver, arguments, result and thrown errors; error observers preserve unhandled-error behavior.Native assertions, deadlines, input, concurrency and cleanup remain exact. Companion hashes identify file bytes rather than in-memory DLL equivalence. The original native cause remains unverifiable.
Agent skill upstream boundary
Notes
No production API, RPC, native patch, dependency or workflow change. Blank output or a missing callback is not evidence of process death. Local helper controls run on macOS; the existing real ConPTY gate exercises Windows.
Checklist