Skip to content

fix(core): wire AbortSignal into agent-team sleep waits - #115

Open
li872 wants to merge 1 commit into
stepfun-ai:mainfrom
li872:fix/agent-team-sleep-abort-signal
Open

li872 wants to merge 1 commit into
stepfun-ai:mainfrom
li872:fix/agent-team-sleep-abort-signal

Conversation

@li872

@li872 li872 commented Sep 14, 2026

Copy link
Copy Markdown

Summary

agent-team idle waits ignored cancel: Ctrl+C during delegation/handoff delays had to wait out delayMs. agent-loop sleep already honored AbortSignal; team waits did not.

This wires a real abort path into the team sleep call sites (not a dead optional param). Aligns with ZouR-Ma's guidance on #98 (which withdrew a partial #85 attempt).

Closes #85

Changes

  • Match agent-loop sleep: abort rejects promptly; remove abort listener on abort and on normal timer completion.
  • AgentTeam.close() aborts a team-level signal so idle waits wake immediately.
  • Pass that signal into the real wait sites: readInbox idle polling and worker claim-slot backoff.
  • read_inbox forwards the tool AbortSignal into readInbox.

Tests

  • Abort during readInbox wait; already-aborted signal; normal completion cleans listener
  • close() wakes idle worker waits and claim-slot backoff
  • Plugin forwards ctx.signal into readInbox
  • pnpm check: 1529 passed, 8 skipped

Closes stepfun-ai#85

Idle inbox waits and claim-slot backoff ignored cancellation, so
Ctrl+C during delegation/handoff delays blocked until delayMs
elapsed. Match agent-loop abort cleanup and wire the team abort
signal into those call sites.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core packages/core area/skills skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] agent-team.ts 的 sleep 不支持 AbortSignal

1 participant