Run operator shell commands in a chat's directory on the server

chat_shell_run starts $SHELL -lc in the chat session's directory in its own
process group, streams merged output to every watcher of the session, keeps a
1 MiB tail and persists each run; chat_shell_stop interrupts the group and
kills it after a grace period. chat_shell_share queues an ordinary prompt
with the command and a bounded output tail.
This commit is contained in:
2026-11-09 15:55:14 +00:00
parent 57679d9591
commit e6bc57c901
16 changed files with 1367 additions and 1 deletions
+3
View File
@@ -255,6 +255,9 @@ func handleChat(ctx context.Context, request protocol.Message, broker chatBroker
case protocol.ChatShellOutput:
handleChatShellOutput(ctx, request, broker, registry, write)
return true
case protocol.ChatShellRun, protocol.ChatShellStop, protocol.ChatShellRuns, protocol.ChatShellRunOutput, protocol.ChatShellShare:
handleChatShellRunRequest(ctx, request, broker, hub, registry, clientID, write)
return true
case protocol.ChatAttachmentImage:
handleChatAttachmentImage(request, broker, write)
return true