feat(telegram): /stop stops the chat agent, else the tasks it created, or one task; delete the dead approval actions

This commit is contained in:
sam committed 2026-10-06 01:12:28 +11:00
1 parent 399098329b
commit b0f1ad7cdc
52 files changed
+2385 -2781

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -26,6 +26,7 @@ const (
ChatService_Route_FullMethodName = "/gateway.v1.ChatService/Route"
ChatService_Stream_FullMethodName = "/gateway.v1.ChatService/Stream"
ChatService_Cancel_FullMethodName = "/gateway.v1.ChatService/Cancel"
ChatService_StopTasks_FullMethodName = "/gateway.v1.ChatService/StopTasks"
ChatService_SetPersona_FullMethodName = "/gateway.v1.ChatService/SetPersona"
ChatService_ApplyTaskAction_FullMethodName = "/gateway.v1.ChatService/ApplyTaskAction"
ChatService_ApplyOperatorTaskAction_FullMethodName = "/gateway.v1.ChatService/ApplyOperatorTaskAction"
@@ -56,6 +57,7 @@ type ChatServiceClient interface {
Route(ctx context.Context, in *RouteRequest, opts ...grpc.CallOption) (*RouteResponse, error)
Stream(ctx context.Context, in *StreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamResponse], error)
Cancel(ctx context.Context, in *CancelRequest, opts ...grpc.CallOption) (*CancelResponse, error)
StopTasks(ctx context.Context, in *StopTasksRequest, opts ...grpc.CallOption) (*StopTasksResponse, error)
SetPersona(ctx context.Context, in *SetPersonaRequest, opts ...grpc.CallOption) (*SetPersonaResponse, error)
ApplyTaskAction(ctx context.Context, in *ApplyTaskActionRequest, opts ...grpc.CallOption) (*ApplyTaskActionResponse, error)
ApplyOperatorTaskAction(ctx context.Context, in *ApplyOperatorTaskActionRequest, opts ...grpc.CallOption) (*ApplyOperatorTaskActionResponse, error)
@@ -162,6 +164,16 @@ func (c *chatServiceClient) Cancel(ctx context.Context, in *CancelRequest, opts
return out, nil
}
func (c *chatServiceClient) StopTasks(ctx context.Context, in *StopTasksRequest, opts ...grpc.CallOption) (*StopTasksResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StopTasksResponse)
err := c.cc.Invoke(ctx, ChatService_StopTasks_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *chatServiceClient) SetPersona(ctx context.Context, in *SetPersonaRequest, opts ...grpc.CallOption) (*SetPersonaResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SetPersonaResponse)
@@ -343,6 +355,7 @@ type ChatServiceServer interface {
Route(context.Context, *RouteRequest) (*RouteResponse, error)
Stream(*StreamRequest, grpc.ServerStreamingServer[StreamResponse]) error
Cancel(context.Context, *CancelRequest) (*CancelResponse, error)
StopTasks(context.Context, *StopTasksRequest) (*StopTasksResponse, error)
SetPersona(context.Context, *SetPersonaRequest) (*SetPersonaResponse, error)
ApplyTaskAction(context.Context, *ApplyTaskActionRequest) (*ApplyTaskActionResponse, error)
ApplyOperatorTaskAction(context.Context, *ApplyOperatorTaskActionRequest) (*ApplyOperatorTaskActionResponse, error)
@@ -391,6 +404,9 @@ func (UnimplementedChatServiceServer) Stream(*StreamRequest, grpc.ServerStreamin
func (UnimplementedChatServiceServer) Cancel(context.Context, *CancelRequest) (*CancelResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Cancel not implemented")
}
func (UnimplementedChatServiceServer) StopTasks(context.Context, *StopTasksRequest) (*StopTasksResponse, error) {
return nil, status.Error(codes.Unimplemented, "method StopTasks not implemented")
}
func (UnimplementedChatServiceServer) SetPersona(context.Context, *SetPersonaRequest) (*SetPersonaResponse, error) {
return nil, status.Error(codes.Unimplemented, "method SetPersona not implemented")
}
@@ -582,6 +598,24 @@ func _ChatService_Cancel_Handler(srv interface{}, ctx context.Context, dec func(
return interceptor(ctx, in, info, handler)
}
func _ChatService_StopTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StopTasksRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChatServiceServer).StopTasks(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ChatService_StopTasks_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChatServiceServer).StopTasks(ctx, req.(*StopTasksRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ChatService_SetPersona_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetPersonaRequest)
if err := dec(in); err != nil {
@@ -919,6 +953,10 @@ var ChatService_ServiceDesc = grpc.ServiceDesc{
MethodName: "Cancel",
Handler: _ChatService_Cancel_Handler,
},
{
MethodName: "StopTasks",
Handler: _ChatService_StopTasks_Handler,
},
{
MethodName: "SetPersona",
Handler: _ChatService_SetPersona_Handler,
File diff suppressed because it is too large. Load diff
@@ -41,6 +41,7 @@ const (
StateStoreService_RevokePersonalToken_FullMethodName = "/state.v1.StateStoreService/RevokePersonalToken"
StateStoreService_EnqueueIssue_FullMethodName = "/state.v1.StateStoreService/EnqueueIssue"
StateStoreService_EnqueueChatTask_FullMethodName = "/state.v1.StateStoreService/EnqueueChatTask"
StateStoreService_ActiveTasksByOrigin_FullMethodName = "/state.v1.StateStoreService/ActiveTasksByOrigin"
StateStoreService_ClaimNext_FullMethodName = "/state.v1.StateStoreService/ClaimNext"
StateStoreService_ClaimByIssue_FullMethodName = "/state.v1.StateStoreService/ClaimByIssue"
StateStoreService_Transition_FullMethodName = "/state.v1.StateStoreService/Transition"
@@ -187,6 +188,7 @@ type StateStoreServiceClient interface {
// Lifecycle
EnqueueIssue(ctx context.Context, in *EnqueueIssueRequest, opts ...grpc.CallOption) (*EnqueueIssueResponse, error)
EnqueueChatTask(ctx context.Context, in *EnqueueChatTaskRequest, opts ...grpc.CallOption) (*EnqueueChatTaskResponse, error)
ActiveTasksByOrigin(ctx context.Context, in *ActiveTasksByOriginRequest, opts ...grpc.CallOption) (*ActiveTasksByOriginResponse, error)
ClaimNext(ctx context.Context, in *ClaimNextRequest, opts ...grpc.CallOption) (*ClaimNextResponse, error)
ClaimByIssue(ctx context.Context, in *ClaimByIssueRequest, opts ...grpc.CallOption) (*ClaimByIssueResponse, error)
Transition(ctx context.Context, in *TransitionRequest, opts ...grpc.CallOption) (*TransitionResponse, error)
@@ -598,6 +600,16 @@ func (c *stateStoreServiceClient) EnqueueChatTask(ctx context.Context, in *Enque
return out, nil
}
func (c *stateStoreServiceClient) ActiveTasksByOrigin(ctx context.Context, in *ActiveTasksByOriginRequest, opts ...grpc.CallOption) (*ActiveTasksByOriginResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ActiveTasksByOriginResponse)
err := c.cc.Invoke(ctx, StateStoreService_ActiveTasksByOrigin_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *stateStoreServiceClient) ClaimNext(ctx context.Context, in *ClaimNextRequest, opts ...grpc.CallOption) (*ClaimNextResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ClaimNextResponse)
@@ -1651,6 +1663,7 @@ type StateStoreServiceServer interface {
// Lifecycle
EnqueueIssue(context.Context, *EnqueueIssueRequest) (*EnqueueIssueResponse, error)
EnqueueChatTask(context.Context, *EnqueueChatTaskRequest) (*EnqueueChatTaskResponse, error)
ActiveTasksByOrigin(context.Context, *ActiveTasksByOriginRequest) (*ActiveTasksByOriginResponse, error)
ClaimNext(context.Context, *ClaimNextRequest) (*ClaimNextResponse, error)
ClaimByIssue(context.Context, *ClaimByIssueRequest) (*ClaimByIssueResponse, error)
Transition(context.Context, *TransitionRequest) (*TransitionResponse, error)
@@ -1908,6 +1921,9 @@ func (UnimplementedStateStoreServiceServer) EnqueueIssue(context.Context, *Enque
func (UnimplementedStateStoreServiceServer) EnqueueChatTask(context.Context, *EnqueueChatTaskRequest) (*EnqueueChatTaskResponse, error) {
return nil, status.Error(codes.Unimplemented, "method EnqueueChatTask not implemented")
}
func (UnimplementedStateStoreServiceServer) ActiveTasksByOrigin(context.Context, *ActiveTasksByOriginRequest) (*ActiveTasksByOriginResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ActiveTasksByOrigin not implemented")
}
func (UnimplementedStateStoreServiceServer) ClaimNext(context.Context, *ClaimNextRequest) (*ClaimNextResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ClaimNext not implemented")
}
@@ -2619,6 +2635,24 @@ func _StateStoreService_EnqueueChatTask_Handler(srv interface{}, ctx context.Con
return interceptor(ctx, in, info, handler)
}
func _StateStoreService_ActiveTasksByOrigin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ActiveTasksByOriginRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(StateStoreServiceServer).ActiveTasksByOrigin(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: StateStoreService_ActiveTasksByOrigin_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(StateStoreServiceServer).ActiveTasksByOrigin(ctx, req.(*ActiveTasksByOriginRequest))
}
return interceptor(ctx, in, info, handler)
}
func _StateStoreService_ClaimNext_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ClaimNextRequest)
if err := dec(in); err != nil {
@@ -4457,6 +4491,10 @@ var StateStoreService_ServiceDesc = grpc.ServiceDesc{
MethodName: "EnqueueChatTask",
Handler: _StateStoreService_EnqueueChatTask_Handler,
},
{
MethodName: "ActiveTasksByOrigin",
Handler: _StateStoreService_ActiveTasksByOrigin_Handler,
},
{
MethodName: "ClaimNext",
Handler: _StateStoreService_ClaimNext_Handler,