fix(worker): release slot on result so ScheduleWakeup cannot pin currentTask #649
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!649
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "boss/646"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #646
Fix the Claude Agent SDK iterator deadlock that pinned
worker.currentTaskafterresultevents when the agent invokedScheduleWakeup(50+ minute stall on PRs #643 + #645, 2026-05-01).Test plan
bun x turbo run typecheckcleanbun x turbo run test— 2841/2841 server tests, 605/605 web tests, 0 failrunTaskemitsresultthen keeps the iterator alive →currentTask = nullrunTaskPromise resolvesworker_stuck_after_resultfires whencurrentTaskoutlivesresultby ≥ 60 s (with regression-replay covering the recorded 1a4db328 task)resultevent so ScheduleWakeup can't pin currentTaskSlot release is correct and well-guarded.
releaseSlot()is idempotent (slotReleasedflag), only clears the slot it owns (currentTask?.id === idguard), then callsprocessNext()— clean.finallyfalls back toreleaseSlot()whenonResultEventnever fired (error/crash path) — no latch leak.agent-runner.ts/foreman.ts:breakafterresultinstead ofcontinueis correct;resultis terminal so no events are dropped.pendingResultis captured before the break so the post-loop classifier path still fires.sawScheduleWakeupscan overev.toolUsesis safe because the guardev.type === "assistant"matches the SDK shape.docker psfailure cannot silence a stuck-worker alert — good ordering.d222edab).Slot release correct and well-guarded.
d222edab).