Commit Graph

6 Commits

Author SHA1 Message Date
sid1943
82efb719ab fix: preserve pending tasks when subagent completes
Fixes #3031

When a subagent completes and announces its result back to the main
agent, the main agent's pending tasks were being lost due to a race
condition between the followup queue drain and the announce flow.

Changes:
- Add persistence layer for followup queues (similar to subagent runs)
- Implement 30-second grace period before deleting empty queues
- Persist queue state after enqueue/dequeue operations
- Track emptyAt timestamp to prevent premature deletion
- Add periodic cleanup for expired empty queues

This ensures that when a subagent completes and triggers a new main
agent invocation, any pending tasks in the followup queue are
preserved and restored from disk.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-27 19:31:33 -05:00
Peter Steinberger
7cebe7a506 style: run oxfmt 2026-01-17 08:00:05 +00:00
Peter Steinberger
eb8a0510e0 refactor: unify queue drop handling 2026-01-17 06:38:33 +00:00
Peter Steinberger
c7ae5100fa refactor: share queue helpers
Co-authored-by: adam91holt <adam91holt@users.noreply.github.com>
2026-01-17 06:02:27 +00:00
Peter Steinberger
c379191f80 chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
2026-01-14 15:02:19 +00:00
Peter Steinberger
bcbfb357be refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00