Commit Graph
157 Commits
Author SHA1 Message Date
pku-xht e9f1b6c53e Merge remote-tracking branch 'origin/master' into codex/subprocess-native-containment
# Conflicts:
#	.agents/notes/implemented/architecture/2026-07-16-explicit-turn-cancellation.i18n.yaml
#	.agents/notes/implemented/architecture/2026-07-16-explicit-turn-cancellation.md
#	.agents/notes/implemented/architecture/2026-07-16-explicit-turn-cancellation.zh.md
#	.agents/notes/implemented/architecture/2026-09-05-canonical-feedback-log.i18n.yaml
#	.agents/notes/implemented/architecture/2026-09-05-nonofficial-feedback-otel.i18n.yaml
#	.agents/notes/implemented/architecture/2026-09-06-embedded-stream-record-readers.i18n.yaml
#	.agents/notes/implemented/bug-fix/2026-09-03-normalized-unread-fs-tool-diagnostic.i18n.yaml
#	.agents/notes/implemented/bug-fix/2026-09-06-windows-python-console-spawn-wait.i18n.yaml
#	.agents/notes/implemented/feature/2026-08-26-generic-file-upload.i18n.yaml
#	.agents/notes/implemented/feature/2026-09-07-model-switch-notice.i18n.yaml
#	.agents/notes/implemented/process/2026-09-03-semantic-issue-templates-and-policy.i18n.yaml
#	packages/shell/bash-local/tests/executor.spec.ts
#	packages/subprocess/subprocess-local/README.i18n.yaml
#	packages/subprocess/subprocess-local/README.md
#	packages/subprocess/subprocess-local/README.zh.md
#	packages/subprocess/subprocess-local/src/spawn.ts
#	packages/subprocess/subprocess-local/tests/spawn.spec.ts
#	packages/subprocess/win32-process/package.json
2026-09-07 17:43:45 +08:00
Chinesezjc 1f0a87eb06 Merge remote-tracking branch 'origin/master' into fix/test-tmp-teardown-self-clean
# Conflicts:
#	packages/subprocess/subprocess-local/tests/spawn.spec.ts
2026-09-04 11:58:16 +08:00
pku-xht e82e5ffd7a fix(subprocess): normalize PTY scope launcher environment 2026-09-04 02:58:09 +08:00
pku-xht d82fd86c5c fix(subprocess): isolate native runner bootstrap 2026-09-04 00:24:52 +08:00
Turtle a05b5fbe79 fix(subprocess): hide Windows cleanup helpers 2026-09-03 19:01:30 +08:00
Chinesezjc c8fc38541f test: own the default spill dir in subprocess specs; correct retention wording
Second review round (ds-review-bot v4p/v5/v6): the exit cleanup claim that
collectors unlink their spill files on dispose was wrong — completed spill
files are retained (seal() only closes, discardSpill() is the only unlink),
so the exit removal only ever applies to directories that never spilled.
Reword the JSDoc, README, and Agent Note accordingly, drop the redundant
readdirSync precheck (rmdirSync ENOTEMPTY is caught anyway), and recount the
v8-ignore window. The spawn.spec default-spill test now records the default
per-process directory it created and removes it in afterAll, so a completed
spill file is never left behind by the unit suite.
2026-09-03 17:29:21 +08:00
Turtle cc8099dc5f fix(subprocess): hide Windows child windows 2026-09-03 17:05:18 +08:00
Chinesezjc 0364343a7e test: remove dsh-* temp dirs created by unit tests at teardown
Spec files that create /tmp/dsh-* directories via mkdtemp now track and
delete them in afterEach/afterAll; module-scope fixture dirs (executor
spill dirs) are removed in afterAll. The file list came from the
observed-residue inventory on the self-hosted CI host: only specs whose
dirs actually accumulated were leak sources (issue #3134), superseding
the kept-but-unmerged CI sweep branch per the #3233 review decision.

Product per-process spill roots (dsh-subprocess-local spawn,
dsh-spill-local store) register a process-exit handler that removes the
memoized dir, so processes that used the spawn/spill path clean up on
normal exit. A SIGKILLed process cannot run in-process teardown; the
machine-side timer remains the backstop for that path.

Agent Note: .agents/notes/implemented/process/2026-08-28-test-temp-dir-self-cleanup.md
2026-09-03 16:19:18 +08:00
pku-xht 0652b7b4d7 fix(subprocess): close containment review gaps 2026-09-03 06:18:21 +08:00
pku-xht 14c16012fb fix(subprocess): preserve post-commit runner errors 2026-09-03 04:07:57 +08:00
pku-xht ff6a49660f fix(subprocess): tighten native containment settlement 2026-09-03 03:26:42 +08:00
pku-xht bc681d7a54 fix(subprocess): harden cancellation settlement 2026-09-03 01:18:40 +08:00
pku-xht 05b6789425 fix(subprocess): preserve clean range after start errors 2026-09-03 00:59:07 +08:00
pku-xht ac1a5891c2 fix(subprocess): close remaining native containment findings 2026-09-02 22:49:46 +08:00
pku-xht fc19a0a3fa fix(subprocess): clarify provider failures and scope polling 2026-08-31 19:26:08 +08:00
pku-xht 5e3eaea742 refactor(subprocess): keep runner error bindings one-shot 2026-08-31 15:22:12 +08:00
pku-xht 8bb19f8f7f fix(subprocess): close containment review findings 2026-08-31 14:36:13 +08:00
pku-xht 93c11689e7 fix(subprocess): address containment review findings 2026-08-29 15:44:13 +08:00
pku-xht aaa5117ebd fix(subprocess): preserve literal spawn error stacks 2026-08-29 13:08:43 +08:00
pku-xht c0e7b98169 test(subprocess): preserve optional spawn error keys 2026-08-29 13:02:36 +08:00
pku-xht 13f3b2c172 fix(subprocess): match native spawn error semantics 2026-08-29 12:13:30 +08:00
pku-xht 60dd357a02 fix(subprocess): preserve native spawn error shape 2026-08-29 11:36:27 +08:00
pku-xht 1760649ba7 refactor(subprocess): derive native owner state 2026-08-29 11:28:33 +08:00
pku-xht a416b13eb5 fix(subprocess): preserve Windows search miss errors 2026-08-29 10:28:44 +08:00
pku-xht 5aab793045 fix(subprocess): preserve clean Windows range settlement 2026-08-29 09:08:34 +08:00
pku-xht 6e7b152de7 fix(subprocess): preserve native runner contracts 2026-08-29 07:57:59 +08:00
pku-xht 23af4410f6 fix(subprocess): resolve source runner loader absolutely 2026-08-29 06:14:15 +08:00
pku-xht a825b8d042 fix(subprocess): close native containment contract gaps 2026-08-29 05:56:29 +08:00
pku-xht 40279aea17 fix(subprocess): preserve native runner stdio 2026-08-29 00:03:12 +08:00
pku-xht 635c35991c test(subprocess): type Linux exec mock 2026-08-28 22:38:18 +08:00
pku-xht a0bc2ea803 fix(subprocess): preserve native runner launch semantics 2026-08-28 22:34:09 +08:00
pku-xht aca5c0cb2b fix(subprocess): release Windows runner stdio owners 2026-08-28 21:29:09 +08:00
pku-xht 32b2b24099 fix(subprocess): close runner stdio handles 2026-08-28 20:30:11 +08:00
pku-xht 8ef28f76c0 fix(subprocess): preserve Windows runner spawn semantics 2026-08-28 19:55:16 +08:00
pku-xht b65575442d Merge origin/master into codex/subprocess-native-containment 2026-08-28 18:34:22 +08:00
pku-xht a95f0b368f fix(subprocess): contain escaped descendants with native owners 2026-08-28 18:15:49 +08:00
Yichen Jiang 9757224349 fix(subprocess): fence each signal against current process state
Review found the shared observation defeated the very fence it fed:
it carries the original PID-to-start-time pairing forward, so a
recycled PID still matches it and takes a signal meant for the process
that exited. Capturing it outside the per-member try also let one
failed read abort a whole teardown round, breaking the synchronous
host-exit contract, and an empty round paid a read for no members.

signalProcess now reads ProcessInspector.isAlive immediately before
delivering, from the narrowest per-identity source each platform
offers; signalMembers and waitForMembers return before capturing when
a round has no members. snapshot() keeps serving the readiness poll,
whose per-poll table read stays at one.

Windows enumerates Toolhelp32 lazily on the first tree question, so a
snapshot asked only for liveness — the 25 ms teardown poll — performs
no table walk at all.
2026-08-27 15:19:43 +08:00
Yichen Jiang 32ddfcd89c fix(subprocess): read the process table once per terminal poll
MacProcessInspector answered the descendant tree and every member's
liveness with its own `/bin/ps` fork, so one readiness poll cost N+1
full table reads for N tracked descendants. With execFileSync on that
path and a 50 ms poll interval, any command spawning two or more
children saturated the host event loop until it exited.

ProcessInspector.snapshot() now returns one ProcessSnapshot that
answers tree, session, and alive from a single observation, and
signalProcess takes the caller's observation so its PID-reuse fence
does not re-read the table per member.
2026-08-27 13:06:12 +08:00
pku-xht c302bedc3a test(subprocess): defer fake runner disconnect 2026-08-27 02:37:00 +08:00
pku-xht 81257defd2 fix(subprocess): preserve clean Windows runner close 2026-08-27 00:41:59 +08:00
pku-xht 07408ff0f1 fix(subprocess): preserve failed teardown state 2026-08-26 23:43:15 +08:00
pku-xht 3caa9e4f5a fix(subprocess): retain failed cleanup ownership 2026-08-26 22:16:20 +08:00
pku-xht 166004a6a8 fix(subprocess): preserve Windows startup errors 2026-08-26 20:01:10 +08:00
pku-xht 6a34a0dd4b fix(subprocess): isolate Linux native target group 2026-08-26 19:00:40 +08:00
pku-xht cf6f25d283 fix(subprocess): keep native runner private 2026-08-26 14:10:08 +08:00
pku-xht 678cfdfdb4 Merge commit '0c177e17a23692d018a79bae59ac9a2db6eba59c' into codex/subprocess-native-containment
# Conflicts:
#	.agents/notes/implemented/architecture/2026-07-10-single-file-executable-sdk-runtime-distribution.i18n.yaml
#	.agents/notes/implemented/architecture/2026-07-10-single-file-executable-sdk-runtime-distribution.md
#	.agents/notes/implemented/architecture/2026-07-10-single-file-executable-sdk-runtime-distribution.zh.md
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/input.json
#	examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
#	packages/bundle/acp-app/package.json
#	packages/examples/jsonrpc-demo/src/packaged-bin.ts
#	packages/subagent/subagent-acp/src/run.ts
#	packages/subagent/subagent-acp/tests/subagent-acp.spec.ts
#	packages/subprocess/subprocess-local/README.i18n.yaml
#	packages/subprocess/subprocess-local/README.md
#	packages/subprocess/subprocess-local/README.zh.md
#	pnpm-lock.yaml
#	scripts/smoke-python-runtime.py
2026-08-25 23:22:25 +08:00
pku-xht ff413cfe5e fix(subprocess): align async pid evidence 2026-08-25 22:24:20 +08:00
pku-xht 26969588b7 fix(subprocess): address native containment review findings 2026-08-25 21:51:22 +08:00
pku-xht 8e9bac4a27 fix(subprocess): align native containment contract 2026-08-25 20:06:00 +08:00
Yichen Jiang 2338f4ad14 fix(pty): detect emulated kernel syscall ABI 2026-08-25 14:01:04 +08:00