on main help sign in
fix: handle code agent not initialized
commitd3f28ddd95a4572d508dfd15cfe3d667a3c1a94b authorKujtim Hoxha <kujtimii.h@gmail.com> dateFri 1 Aug 2025, 08:32 (1 year ago) parent428d71a
2 files changed+5−1
internal/tui/page/chat/chat.go+4 internal/tui/tui.go+1−1
internal/tui/page/chat/chat.go+4
@@ -300,6 +300,10 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
300300 case tea.KeyPressMsg:
301301 switch {
302302 case key.Matches(msg, p.keyMap.NewSession):
303+ // if we have no agent do nothing
304+ if p.app.CoderAgent == nil {
305+ return p, nil
306+ }
303307 if p.app.CoderAgent.IsBusy() {
304308 return p, util.ReportWarn("Agent is busy, please wait before starting a new session...")
305309 }
internal/tui/tui.go+1−1
@@ -393,7 +393,7 @@ func (a *appModel) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
393393 )
394394 return tea.Sequence(cmds...)
395395 case key.Matches(msg, a.keyMap.Suspend):
396− if a.app.CoderAgent.IsBusy() {
396+ if a.app.CoderAgent != nil && a.app.CoderAgent.IsBusy() {
397397 return util.ReportWarn("Agent is busy, please wait...")
398398 }
399399 return tea.Suspend