Przeglądaj źródła

prevent the editor when agent busy

Kujtim Hoxha 10 miesięcy temu
rodzic
commit
d7569d79c6
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      internal/tui/components/chat/editor.go

+ 3 - 0
internal/tui/components/chat/editor.go

@@ -132,6 +132,9 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 		}
 	case tea.KeyMsg:
 		if key.Matches(msg, focusedKeyMaps.OpenEditor) {
+			if m.app.CoderAgent.IsSessionBusy(m.session.ID) {
+				return m, util.ReportWarn("Agent is working, please wait...")
+			}
 			return m, openEditor()
 		}
 		// if the key does not match any binding, return