Print task ID on Ctrl+C interrupt for async tool calls#177
Open
Print task ID on Ctrl+C interrupt for async tool calls#177
Conversation
When `tools-call --task` is interrupted with Ctrl+C and a task ID has been captured, print recovery commands to stderr so the user can fetch or cancel the server-side task. Silent in --json mode. Also updates --task flag help text, adds an "Async tasks" section to the tools-call help footer, and documents that --json --detach returns a CreateTaskResult instead of CallToolResult. Closes #169 https://claude.ai/code/session_01DMuLoe25t4Fwjyun36nRFx
…all-help-0MSlE # Conflicts: # CHANGELOG.md
Extract a shared `printDetachedHint()` helper so both ESC-detach and Ctrl+C interrupt produce identical output with tasks-result and tasks-cancel recovery commands. https://claude.ai/code/session_01DMuLoe25t4Fwjyun36nRFx
Extract formatTaskCommandsHint() to output.ts and use it everywhere: tools-call --detach, tools-call --task ESC/Ctrl+C, tasks-list, and tasks-get. All now show the same "Available commands" block. https://claude.ai/code/session_01DMuLoe25t4Fwjyun36nRFx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhanced the
tools-call --taskcommand to provide better user experience when interrupting long-running async tasks. When a user presses Ctrl+C during task execution, the CLI now prints the task ID and helpful recovery commands instead of silently terminating.Key Changes
callTool()that captures and displays the task ID when interrupted in human modetasks-resultandtasks-cancel) to help users manage interrupted tasks--taskoption description to clarify Ctrl+C behavior--taskand--detachImplementation Details
--taskvs--detachbehaviorhttps://claude.ai/code/session_01DMuLoe25t4Fwjyun36nRFx