Skip to content

fix(subagent): preserve interruption state and prevent duplicate delegation - #669

Merged
stephamie7 merged 2 commits into
devfrom
fix/subagent-interrupt-retry-guard
Aug 6, 2026
Merged

fix(subagent): preserve interruption state and prevent duplicate delegation#669
stephamie7 merged 2 commits into
devfrom
fix/subagent-interrupt-retry-guard

Conversation

@xiami762

@xiami762 xiami762 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • report interrupted subagent runs as failed terminal results while preserving the child session ID
  • propagate the interrupted status to parent tool metadata so the child session can be resumed
  • preserve the latest running tool metadata when direct task cancellation writes the terminal error state
  • drain foreground parallel tool calls before propagating provider stream errors or cancellation
  • suppress step replay after tool execution has started to prevent duplicate delegation

Testing

  • uv run pytest -q tests/tool/test_delegate_task_compat.py tests/tool/test_subagent_hooks.py tests/session/test_runner_llm_hooks.py tests/session/test_stream_processor_parallel_tools.py tests/session/test_auto_model_failover.py tests/session/test_runner_step.py tests/session/test_stream_processor.py
  • uv run ruff check flocks/session/streaming/stream_processor.py flocks/tool/subagent_result.py flocks/tool/agent/delegate_task.py flocks/session/runner.py tests/session/test_stream_processor.py tests/tool/test_delegate_task_compat.py tests/session/test_runner_llm_hooks.py tests/session/test_runner_step.py
  • git diff --check

Result: 239 tests passed; Ruff and diff checks passed.

@xiami762
xiami762 requested a review from stephamie7 August 4, 2026 06:38
@stephamie7
stephamie7 merged commit 178d559 into dev Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants