fix: make stop agent button immediately kill running agent#177
Merged
Conversation
The heartbeat endpoint now uses long-polling: when a task is still running, the server holds the connection for up to 4 seconds waiting for a stop signal. When StopTask is called, it immediately notifies the held heartbeat request via an in-process channel, causing the worker to cancel the agent container within milliseconds instead of waiting up to 5 seconds for the next polling cycle. Changes: - Add WatchStop/UnwatchStop/notifyStop to task.Store for in-process stop signal propagation - Convert heartbeat handler from immediate-response to long-polling with configurable hold duration (4s default) - StopTask now closes the stop channel to wake any waiting heartbeat Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📸 UI ScreenshotsCaptured 64 screenshots from this PR. ConversationCreateDashboardEditEpicMetricsMobileRepoTask |
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
Stop agents button now integrated with a dedicated stop-poll channel so workers receive stop signals immediately with O(1) connection overhead. Additionally, epic planning agents had no stop mechanism — this adds one mirroring the task pattern.
Changes
safety net