docs(hooks-claude): current-state comment wording caught in review

Two Codex nitpicks, comment-only (no behavior change):
- the SubagentStop-cwd regression test comment narrated "The bug" / "Proven to
  regress" — rewrote to state the invariant it checks, not the history.
- the subagent/end listener comment said "no session is passed"; with a child a
  session IS passed — corrected to "no `turn` is passed (so no hook/* records)",
  which is the actual reason runPoint has nothing that can reject.
This commit is contained in:
Tianyi Cui
2026-07-02 07:01:55 +08:00
parent bae6141398
commit 8e8c791eb0
2 changed files with 8 additions and 9 deletions
+3 -2
View File
@@ -290,8 +290,9 @@ export function apply(ctx: Context, config: Config): void {
// Look up the child (still recoverable: `subagent/end` fires from the
// service's detached `.then` BEFORE the tool caller's `await run.result`
// disposes it) so the hook runs in the child's cwd, not the server default.
// No `.then`/inject (SubagentStop only observes) and no session is passed, so
// runPoint cannot reject — no `.catch` is needed. Fire-and-forget.
// No `.then`/inject follows (SubagentStop only observes), and no `turn` is
// passed (so no `hook/*` log records), so runPoint has nothing that can
// reject — no `.catch` is needed. Fire-and-forget.
const child = ctx.get('agents')?.get(info.id)
void runPoint('SubagentStop', SUBAGENT_TYPE, subagentPayload('SubagentStop', info, child), { ...child ? { agent: child } : {} })
})