Validate providers and retain complete run debugging context

This commit is contained in:
2026-10-09 23:21:01 +01:00
parent f3d829bea5
commit 08b8647d5b
51 changed files with 1036 additions and 159 deletions
+27 -1
View File
@@ -133,6 +133,10 @@ type Model struct {
versionIndex int
confirmOpen bool
actionConfirm *protocol.Message
actionApproved bool
defaultModel string
mutationTitle string
mutationCommand func() tea.Cmd
pendingDraft *editedMsg
submitID string
submitNotice string
@@ -315,6 +319,9 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
if msg.Type == protocol.PipelineList || msg.Type == protocol.Submitted {
m.notificationEndpoints = msg.NotificationEndpoints
if msg.DefaultModel != "" {
m.defaultModel = msg.DefaultModel
}
}
if msg.Type == protocol.Templates && msg.ID == m.templateRequest {
m.templates = msg.Templates
@@ -490,6 +497,19 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if m.actionConfirm != nil {
return m.updateActionConfirm(msg)
}
if m.mutationCommand != nil {
if msg.String() == "y" {
command := m.mutationCommand
m.mutationCommand = nil
m.mutationTitle = ""
return m, command()
}
if msg.String() == "n" || msg.String() == "esc" {
m.mutationCommand = nil
m.mutationTitle = ""
}
return m, nil
}
if m.editorChecking {
return m, nil
}
@@ -620,6 +640,9 @@ func (m *Model) appendLine(line string) {
func (m Model) View() string {
connection := m.status
if m.conn != nil {
connection = "Connected · :status"
}
if m.conn == nil {
connection = m.loading(connection)
}
@@ -631,7 +654,7 @@ func (m Model) View() string {
}
connection += " · ntfy " + address + " · topic " + endpoint.Topic
if m.width < 100 {
connection = m.status + " · ntfy " + address + "/" + endpoint.Topic
connection = "Connected · ntfy " + address + "/" + endpoint.Topic
}
}
status := ansi.Truncate(connection, max(0, m.width-min(24, m.width/4)), "…")
@@ -717,6 +740,9 @@ func (m Model) View() string {
if m.actionConfirm != nil {
content = m.actionConfirmView(bodyHeight)
}
if m.mutationCommand != nil {
content = popup(m.width, bodyHeight, 76, []string{m.mutationTitle, "This opens a new session/editor and may modify a retained draft.", "Published definitions and previous run history are unchanged.", "y confirm · n / Esc cancel"})
}
if m.editorChecking {
content = popup(m.width, bodyHeight, 76, []string{"Checking published edits", m.loading("Refreshing pipeline information…"), "Local draft remains retained."})
}