Skip to content

fix(soul): cancel nested task on outer cancellation - #2619

Open
koriyoshi2041 wants to merge 1 commit into
MoonshotAI:mainfrom
koriyoshi2041:fix/cancel-nested-soul-task
Open

fix(soul): cancel nested task on outer cancellation#2619
koriyoshi2041 wants to merge 1 commit into
MoonshotAI:mainfrom
koriyoshi2041:fix/cancel-nested-soul-task

Conversation

@koriyoshi2041

@koriyoshi2041 koriyoshi2041 commented Aug 26, 2026

Copy link
Copy Markdown

Summary

  • include the initial asyncio.wait() in run_soul lifecycle cleanup
  • cancel and await nested soul/cancel-event tasks when the outer coroutine is cancelled
  • add a regression for cancellation while the nested soul task is still running

Fixes #2615.

Validation

  • uv run pytest tests/core tests/background -q (919 passed)
  • uv run pyright src/kimi_cli/soul/__init__.py tests/core/test_run_soul_cancellation.py
  • uv run ruff check src/kimi_cli/soul/__init__.py tests/core/test_run_soul_cancellation.py
  • uv run ruff format --check src/kimi_cli/soul/__init__.py tests/core/test_run_soul_cancellation.py
  • git diff --check

Open in Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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.

[Bug] Background subagent keeps making LLM calls after TaskStop/timeout marks it terminal

1 participant