diff --git a/internal/tui/page/chat/chat.go b/internal/tui/page/chat/chat.go index 9696e316e6f546a1e4ffaab02941951093a87dfb..26bd464a59e02632d3817f7a5582ac1f9d4a0a03 100644 --- a/internal/tui/page/chat/chat.go +++ b/internal/tui/page/chat/chat.go @@ -300,6 +300,10 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case tea.KeyPressMsg: switch { case key.Matches(msg, p.keyMap.NewSession): + // if we have no agent do nothing + if p.app.CoderAgent == nil { + return p, nil + } if p.app.CoderAgent.IsBusy() { return p, util.ReportWarn("Agent is busy, please wait before starting a new session...") } diff --git a/internal/tui/tui.go b/internal/tui/tui.go index b218392bf527cba946a640973ac4f125e5a91c47..333826f564e2909fc0689e117ab5f85f947b410f 100644 --- a/internal/tui/tui.go +++ b/internal/tui/tui.go @@ -393,7 +393,7 @@ func (a *appModel) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd { ) return tea.Sequence(cmds...) case key.Matches(msg, a.keyMap.Suspend): - if a.app.CoderAgent.IsBusy() { + if a.app.CoderAgent != nil && a.app.CoderAgent.IsBusy() { return util.ReportWarn("Agent is busy, please wait...") } return tea.Suspend