Files
pipelines/internal/protocol/chat_shell_dismiss.go
T
alan 03123c23fd 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.
2026-11-09 21:22:07 +00:00

27 lines
1.4 KiB
Go

package protocol
// Dismissing operator shell commands. Dismissal is per chat, for every client:
// a dismissed run leaves every chat_shell_runs readback and every watcher
// receives a chat_shell_run_event with Dismissed set. A running command cannot
// be dismissed. For ChatShellRunUndoWindow after a dismissal the run can be
// restored (chat_shell_restore); after that the server purges its command,
// output and error, keeping only a tombstone whose id chat_shell_runs reports
// in ChatShellDismissed so a client that missed the event drops the card.
const (
// ChatShellDismiss dismisses the finished runs named in
// ChatShellRunRequest.RunIDs; the reply lists those it dismissed in
// ChatShellDismissed (running, unknown and already dismissed runs are
// skipped).
ChatShellDismiss = "chat_shell_dismiss"
// ChatShellRestore undoes a dismissal still inside its undo window; the
// reply carries the restored runs (with their list output tail) in
// ChatShellRuns, and every watcher receives their lifecycle frames.
ChatShellRestore = "chat_shell_restore"
// ChatShellRunUndoWindow is how long, in milliseconds, a dismissed run is
// kept restorable before its output is purged. It is longer than the
// clients' Undo notice so a late Undo still succeeds.
ChatShellRunUndoWindow = 30_000
// ChatShellDismissLimit bounds the run ids of one request.
ChatShellDismissLimit = 200
)