Repository navigation
docs: state that only quit releases a session's background commands - #353
Merged
Merged
Conversation
The new "When a command is released" section says the release is gated on `reason === "quit"`, but the ownership table right above it still listed "deleted, replaced, or resumed away" as stopping the tree. Those are exactly the reasons that do not end a session, so the two statements contradict each other and the table is the one a reader trusts. The table now separates them: `new` and `resume` keep running like a fork and a reload, and only a deleted session or a host exit stops the tree. The docblock on `releaseSessionProcesses` had the same stale claim — it described `session_shutdown` as firing only when the session is really going away, and "a session switch or a fork never reaches this handler". The handler does receive `new`, `resume` and `fork`; the gate is what keeps the trees alive. Both statements were left over from the ungated version and are now gone.
liuedcson
requested review from
MelodyVAR,
Uking-xxx and
ZouR-Ma
as code owners
November 7, 2026 12:47
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.
问题
docs/orchestration-lifecycle.md里同一节内部自相矛盾。上面是所有权表格(#349 引入):
下面是「When a command is released」(#351 引入):
replaced和resumed away正是new/resume/fork这三个 reason——代码里它们不释放(step.ts的if (event.reason === "quit"))。表格说的和代码相反,而表格是读者最先看的东西。顺带:
#351加了上面那段新说明,却没删#349的旧表述,这是这次遗漏的直接原因。改动
表格按真实语义拆开。
new/resume和 fork、reload 一样属于「keeps running」;只有删除会话和宿主退出会停。releaseSessionProcesses的 docblock 同步修正。 原文写:两句都不成立:这个 handler 明确会收到
new/resume/fork(SessionShutdownEvent["reason"]就是quit | reload | new | resume | fork),保住进程的是那个 gate,不是「到不了」。这段同样是无 gate 版本的遗留。验证
tsgo --noEmit通过session-process-release/step-ps/step-subagents共 19 个用例通过git grep确认never reaches this handler、resumed away、really going away已无残留边界
只改文档和注释,无行为变更。