Stop background tasks separately from chat turns
Keep Esc and /stop scoped to the foreground turn while exposing an explicit stop-tasks operation for supported chat backends. Add the protocol, server routing, app command, and coverage for task stopping and unsupported harnesses.
This commit is contained in:
@@ -49,6 +49,10 @@ type chatPromptWithMessageID interface {
|
||||
PromptWithMessageID(context.Context, string, string, string) error
|
||||
}
|
||||
|
||||
type chatTaskStopper interface {
|
||||
StopTasks(context.Context, string) (int, error)
|
||||
}
|
||||
|
||||
// chatPromptWithFiles is implemented by a broker that can hand local files to
|
||||
// the agent with a prompt. The server writes browser attachment bytes to private
|
||||
// temporary files first; a browser URI is not readable by the agent service.
|
||||
@@ -195,6 +199,9 @@ func handleChat(ctx context.Context, request protocol.Message, broker chatBroker
|
||||
case protocol.ChatInterrupt:
|
||||
handleChatSimple(ctx, request, broker, hub, write)
|
||||
return true
|
||||
case protocol.ChatStopTasks:
|
||||
handleChatStopTasks(ctx, request, broker, write)
|
||||
return true
|
||||
case protocol.ChatReply:
|
||||
handleChatSimple(ctx, request, broker, hub, write)
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user