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
+7
View File
@@ -135,6 +135,13 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
hub.queueStore = stores[0]
hub.liveStore = stores[0]
}
// Operator shell commands persist beside the operator sessions they belong
// to: the execution store, else an injected store-backed registry.
if len(stores) > 0 {
hub.startShellRunner(ctx, stores[0])
} else if store, ok := registry.(chatShellRunStore); ok {
hub.startShellRunner(ctx, store)
}
acks := newAttentionAckHub()
var ackStore attentionAckStore
var notes *appNotifier