-
Notifications
You must be signed in to change notification settings - Fork 315
fix: Handle CancelledError in bash and task tools #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: Handle CancelledError in bash and task tools #82
Conversation
Update config directory path from ~/.config/kimi/ to ~/.kimi/ to match the actual implementation. The config directory was changed to ~/.kimi/, but AGENTS.md was not updated accordingly.
Add CancelledError handling in bash and task tool to clean up subprocesses and provide better error messages. Return proper ToolError instead of propagating exception
- Resolved import conflicts in task tool (Wire -> WireUISide) - Maintained CancelledError handling additions
|
I think the reason i failed CI is the refactoring of Wire to WireUI, The core fix for CancelledError is correct. Happy to update for the new API if needed. |
Yes I'm refactoring the codebase to prepare for Kimi CLI SDK. I'll update you once I complete, you can resolve conflicts then. |
|
BTW could you provide a reproducible case that this CancelledError is somehow visible to the user? IIUC cancellation of a tool call task will be properly handled by |
|
you are right, the CancelledError can be solved by https://github.com/MoonshotAI/kosong/blob/main/src/kosong/__init__.py#L41, but this part can solve the FIXME comment about processing cleanup while letting kosong handle the error response: except asyncio.CancelledError: |
Which FIXME comment? |
|
this one you can check it: https://github.com/MoonshotAI/kimi-cli/blob/main/src/kimi_cli/tools/bash/init.py line 83 |
Summary
Fix resource leak caused by orphan processes when operations are cancelled.
Changes