Repository navigation
fix(headless): preserve output and harden prompt shutdown - #246
Merged
Merged
Conversation
Owner
Author
|
已定位并修复本次 CI 失败:测试、runtime 检查和 release build 均通过,失败在 release:pack 的独立 tarball 白名单漏掉了 docs/HEADLESS.md。现已将该文件加入 requiredFiles 和 allowedRoots,未放宽其他发布路径限制。新增回归测试验证允许已声明的发布文档、拒绝缺失的 HEADLESS.md、拒绝未审核路径。本地 38 项单元测试、typecheck、完整 release:pack(含实际安装冒烟测试)通过。 |
Contributor
|
pkg-pr-new preview for commit npx --yes https://pkg.pr.new/zcode-app-cli@f9dec53This preview uses the selected commit. PR updates publish automatically after CI succeeds; kingsword09 can also request a preview with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Harden long-running headless /
-pexecution around output completion, pending asynchronous work and cancellation.child.killedas process completion.Reproduced failures
resultrecord. The new regression delays reading by 10 seconds and verifies complete text, JSON and stream-JSON output.Validation
bun run buildbun run typecheckbun run test:all— 106 passing tests (37 unit, 14 TUI, 38 runtime, 17 Node)bun scripts/check-runtime.tsbun scripts/check-package.tsgit diff --checkValidated locally on macOS with Node v26.4.0 and the locked ZCode 3.17.1 / runtime 0.17.1. POSIX signal regressions are explicitly excluded on Windows.
Scope and limits
These bounded regressions are not an hours-long soak test or a constant-memory guarantee. The native runtime still retains turn events and final responses. Consumers must keep draining both output streams; if they stop reading, successful completion waits instead of silently discarding output. Headless mode itself does not detach the process from shell/SSH lifetime.