web: run pipelines from the browser and quiet background chat
Add the Run pipeline dialog with prompt, server directory and a per-run notification choice; add --notify auto/on/off to run and retry; move the live tool call onto the tool-count line and tick the reasoning duration; stop chat frames from repainting a different screen.
This commit is contained in:
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
func (r *runner) notifyStep(id int64, name, workspace string, policy *protocol.NotificationPolicy, step protocol.RunStep) {
|
||||
if policy == nil {
|
||||
if r.notifyMode(id) == "off" || policy == nil {
|
||||
return
|
||||
}
|
||||
event := "success"
|
||||
@@ -183,6 +183,40 @@ func (r *runner) attentionAlready(id int64, sequence int, event string) bool {
|
||||
return r.attentionSent[id][fmt.Sprintf("%d:%s", sequence, event)]
|
||||
}
|
||||
|
||||
func (r *runner) setNotifyMode(id int64, mode string) {
|
||||
mode = strings.ToLower(strings.TrimSpace(mode))
|
||||
if mode != "on" && mode != "off" {
|
||||
mode = "auto"
|
||||
}
|
||||
r.notifyMu.Lock()
|
||||
r.notifyModes[id] = mode
|
||||
r.notifyMu.Unlock()
|
||||
}
|
||||
|
||||
func (r *runner) notifyMode(id int64) string {
|
||||
r.notifyMu.Lock()
|
||||
mode := r.notifyModes[id]
|
||||
r.notifyMu.Unlock()
|
||||
if mode != "" {
|
||||
return mode
|
||||
}
|
||||
if r.store != nil {
|
||||
if stored, err := r.store.RunNotifyMode(r.ctx, id); err == nil && stored != "" {
|
||||
r.notifyMu.Lock()
|
||||
r.notifyModes[id] = stored
|
||||
r.notifyMu.Unlock()
|
||||
return stored
|
||||
}
|
||||
}
|
||||
return "auto"
|
||||
}
|
||||
|
||||
func (r *runner) forgetNotifyMode(id int64) {
|
||||
r.notifyMu.Lock()
|
||||
delete(r.notifyModes, id)
|
||||
r.notifyMu.Unlock()
|
||||
}
|
||||
|
||||
// forgetAttention drops a run's delivered-event set once it is terminal, so the
|
||||
// registry is bounded by the runs still in flight.
|
||||
func (r *runner) forgetAttention(id int64) {
|
||||
@@ -206,6 +240,9 @@ func runAttentionClick(id int64) string {
|
||||
// A run that needs nobody produces nothing, and a delivery failure is logged and
|
||||
// never fails the run: this is a best-effort alert, not persisted run evidence.
|
||||
func (r *runner) notifyRun(id int64, name, status string, sequence int, currentStage, diagnostic string) {
|
||||
if r.notifyMode(id) == "off" {
|
||||
return
|
||||
}
|
||||
event := runAttentionEvent(status)
|
||||
if event == "" {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user