Dismiss and restore operator shell commands per chat
chat_shell_dismiss hides finished runs from every readback and pushes a dismissal frame to every watcher; chat_shell_restore undoes it within a 30 s window, after which the command, output and error are purged and only a tombstone remains, reported by chat_shell_runs for clients that missed the event.
This commit is contained in:
@@ -70,7 +70,26 @@ func handleChatShellRunRequest(ctx context.Context, request protocol.Message, br
|
||||
fail(err)
|
||||
return
|
||||
}
|
||||
_ = write(protocol.Message{Type: protocol.ChatShellRuns, ID: request.ID, ChatShellRuns: runs})
|
||||
dismissed, err := runner.Dismissed(ctx, sessionID)
|
||||
if err != nil {
|
||||
fail(err)
|
||||
return
|
||||
}
|
||||
_ = write(protocol.Message{Type: protocol.ChatShellRuns, ID: request.ID, ChatShellRuns: runs, ChatShellDismissed: dismissed})
|
||||
case protocol.ChatShellDismiss:
|
||||
dismissed, err := runner.Dismiss(ctx, sessionID, body.RunIDs)
|
||||
if err != nil {
|
||||
fail(err)
|
||||
return
|
||||
}
|
||||
_ = write(protocol.Message{Type: protocol.ChatShellDismiss, ID: request.ID, ChatShellDismissed: dismissed})
|
||||
case protocol.ChatShellRestore:
|
||||
runs, err := runner.Restore(ctx, sessionID, body.RunIDs)
|
||||
if err != nil {
|
||||
fail(err)
|
||||
return
|
||||
}
|
||||
_ = write(protocol.Message{Type: protocol.ChatShellRestore, ID: request.ID, ChatShellRuns: runs})
|
||||
case protocol.ChatShellInput:
|
||||
if err := runner.Input(sessionID, body.RunID, body.Data); err != nil {
|
||||
fail(err)
|
||||
|
||||
Reference in New Issue
Block a user