diff options
| author | Kujtim Hoxha <[email protected]> | 2025-04-08 20:32:57 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-08 20:32:57 +0200 |
| commit | fde04bbf85ea641a33a282b354d63f227f9945fb (patch) | |
| tree | 8b71df5743546e937f5c89977f0f8e0a1814bf56 /internal/tui/tui.go | |
| parent | 124bd57c507fdcbb56ab27137cbe892f12e1b48f (diff) | |
| parent | 4385fb321903f335097119349aa1ebf9edb3f71a (diff) | |
| download | opencode-fde04bbf85ea641a33a282b354d63f227f9945fb.tar.gz opencode-fde04bbf85ea641a33a282b354d63f227f9945fb.zip | |
Merge pull request #22 from adamdottv/adam/retries
fix(anthropic): better 429/529 handling
Diffstat (limited to 'internal/tui/tui.go')
| -rw-r--r-- | internal/tui/tui.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/tui/tui.go b/internal/tui/tui.go index 15d97a11a..314e0f17a 100644 --- a/internal/tui/tui.go +++ b/internal/tui/tui.go @@ -77,6 +77,8 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case pubsub.Event[permission.PermissionRequest]: return a, dialog.NewPermissionDialogCmd(msg.Payload) + case pubsub.Event[util.InfoMsg]: + a.status, _ = a.status.Update(msg) case dialog.PermissionResponseMsg: switch msg.Action { case dialog.PermissionAllow: @@ -121,8 +123,6 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return a, a.moveToPage(msg.ID) case util.InfoMsg: a.status, _ = a.status.Update(msg) - case util.ErrorMsg: - a.status, _ = a.status.Update(msg) case tea.KeyMsg: if a.editorMode == vimtea.ModeNormal { switch { @@ -141,7 +141,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if a.currentPage == page.ReplPage { sessions, err := a.app.Sessions.List() if err != nil { - return a, util.CmdHandler(util.ErrorMsg(err)) + return a, util.CmdHandler(util.ReportError(err)) } lastSession := sessions[0] if lastSession.MessageCount == 0 { @@ -149,7 +149,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } s, err := a.app.Sessions.Create("New Session") if err != nil { - return a, util.CmdHandler(util.ErrorMsg(err)) + return a, util.CmdHandler(util.ReportError(err)) } return a, util.CmdHandler(repl.SelectedSessionMsg{SessionID: s.ID}) } |
