You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The platform group-kill primitive (win32 taskkill /T /F vs unix negative-pid process.kill) is duplicated between hook/settings.tsexecShell (its killGroup) and util/process.ts (stop win32 branch, signalTree), with diverging error handling. Code review of #500-504 flagged the shape as drifting (four near-copies of the escalation chain; the SDK copy has already diverged semantically).
Scope
packages/opencode/src/util/process.ts, packages/opencode/src/hook/settings.ts (+ their tests).
Extract a shared killGroupPid(pid, signal?) primitive in util/process.ts: unix process.kill(-pid, signal), win32 taskkill /pid <pid> /T /F, best-effort with a boolean result; reuse it in stop's win32 branch and replace the hook's killGroup body with it (hook keeps its own logging and killSent state).
Why
The platform group-kill primitive (win32
taskkill /T /Fvs unix negative-pidprocess.kill) is duplicated betweenhook/settings.tsexecShell(itskillGroup) andutil/process.ts(stopwin32 branch,signalTree), with diverging error handling. Code review of #500-504 flagged the shape as drifting (four near-copies of the escalation chain; the SDK copy has already diverged semantically).Scope
packages/opencode/src/util/process.ts,packages/opencode/src/hook/settings.ts(+ their tests).packages/sdk/js/src/process.ts(published-package structural copy, documented and accepted in fix: unify child-process stop semantics with await-exit and SIGKILL escalation #503).Approach
killGroupPid(pid, signal?)primitive inutil/process.ts: unixprocess.kill(-pid, signal), win32taskkill /pid <pid> /T /F, best-effort with a boolean result; reuse it instop's win32 branch and replace the hook'skillGroupbody with it (hook keeps its own logging andkillSentstate).Acceptance
hook/andutil/processtest suites green including the fix: hook command grandchildren hold stdio pipes and hang triggers forever #500 process-group regression tests; platform kill branching has a single source inside the opencode package; typecheck and lint unaffected.