summaryrefslogtreecommitdiffhomepage
path: root/internal/tui
diff options
context:
space:
mode:
Diffstat (limited to 'internal/tui')
-rw-r--r--internal/tui/components/chat/editor.go4
-rw-r--r--internal/tui/components/chat/list.go4
-rw-r--r--internal/tui/components/core/status.go4
-rw-r--r--internal/tui/components/dialog/models.go4
-rw-r--r--internal/tui/page/chat.go8
-rw-r--r--internal/tui/tui.go10
6 files changed, 17 insertions, 17 deletions
diff --git a/internal/tui/components/chat/editor.go b/internal/tui/components/chat/editor.go
index 99991cdf7..e96e6df3d 100644
--- a/internal/tui/components/chat/editor.go
+++ b/internal/tui/components/chat/editor.go
@@ -124,7 +124,7 @@ func (m *editorCmp) Init() tea.Cmd {
}
func (m *editorCmp) send() tea.Cmd {
- if m.app.CoderAgent.IsSessionBusy(m.session.ID) {
+ if m.app.PrimaryAgent.IsSessionBusy(m.session.ID) {
status.Warn("Agent is working, please wait...")
return nil
}
@@ -189,7 +189,7 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, nil
}
if key.Matches(msg, editorMaps.OpenEditor) {
- if m.app.CoderAgent.IsSessionBusy(m.session.ID) {
+ if m.app.PrimaryAgent.IsSessionBusy(m.session.ID) {
status.Warn("Agent is working, please wait...")
return m, nil
}
diff --git a/internal/tui/components/chat/list.go b/internal/tui/components/chat/list.go
index bce6f50e1..bf72e74b5 100644
--- a/internal/tui/components/chat/list.go
+++ b/internal/tui/components/chat/list.go
@@ -170,7 +170,7 @@ func (m *messagesCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
func (m *messagesCmp) IsAgentWorking() bool {
- return m.app.CoderAgent.IsSessionBusy(m.session.ID)
+ return m.app.PrimaryAgent.IsSessionBusy(m.session.ID)
}
func formatTimeDifference(unixTime1, unixTime2 int64) string {
@@ -376,7 +376,7 @@ func (m *messagesCmp) help() string {
text := ""
- if m.app.CoderAgent.IsBusy() {
+ if m.app.PrimaryAgent.IsBusy() {
text += lipgloss.JoinHorizontal(
lipgloss.Left,
baseStyle.Foreground(t.TextMuted()).Bold(true).Render("press "),
diff --git a/internal/tui/components/core/status.go b/internal/tui/components/core/status.go
index d6612fed4..be2f39432 100644
--- a/internal/tui/components/core/status.go
+++ b/internal/tui/components/core/status.go
@@ -140,7 +140,7 @@ func formatTokensAndCost(tokens int64, contextWindow int64, cost float64) string
func (m statusCmp) View() string {
t := theme.CurrentTheme()
- modelID := config.Get().Agents[config.AgentCoder].Model
+ modelID := config.Get().Agents[config.AgentPrimary].Model
model := models.SupportedModels[modelID]
// Initialize the help widget
@@ -283,7 +283,7 @@ func (m statusCmp) model() string {
cfg := config.Get()
- coder, ok := cfg.Agents[config.AgentCoder]
+ coder, ok := cfg.Agents[config.AgentPrimary]
if !ok {
return "Unknown"
}
diff --git a/internal/tui/components/dialog/models.go b/internal/tui/components/dialog/models.go
index 9dc2fdffe..67c4fdfa1 100644
--- a/internal/tui/components/dialog/models.go
+++ b/internal/tui/components/dialog/models.go
@@ -283,7 +283,7 @@ func (m *modelDialogCmp) setupModels() {
func GetSelectedModel(cfg *config.Config) models.Model {
- agentCfg := cfg.Agents[config.AgentCoder]
+ agentCfg := cfg.Agents[config.AgentPrimary]
selectedModelId := agentCfg.Model
return models.SupportedModels[selectedModelId]
}
@@ -325,7 +325,7 @@ func findProviderIndex(providers []models.ModelProvider, provider models.ModelPr
func (m *modelDialogCmp) setupModelsForProvider(provider models.ModelProvider) {
cfg := config.Get()
- agentCfg := cfg.Agents[config.AgentCoder]
+ agentCfg := cfg.Agents[config.AgentPrimary]
selectedModelId := agentCfg.Model
m.provider = provider
diff --git a/internal/tui/page/chat.go b/internal/tui/page/chat.go
index b4984c511..fe71d6f7a 100644
--- a/internal/tui/page/chat.go
+++ b/internal/tui/page/chat.go
@@ -67,7 +67,7 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
case dialog.CommandRunCustomMsg:
// Check if the agent is busy before executing custom commands
- if p.app.CoderAgent.IsBusy() {
+ if p.app.PrimaryAgent.IsBusy() {
status.Warn("Agent is busy, please wait before executing a command...")
return p, nil
}
@@ -92,7 +92,7 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// Run compaction in background
go func(sessionID string) {
- err := p.app.CoderAgent.CompactSession(context.Background(), sessionID)
+ err := p.app.PrimaryAgent.CompactSession(context.Background(), sessionID)
if err != nil {
status.Error(fmt.Sprintf("Compaction failed: %v", err))
} else {
@@ -113,7 +113,7 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if p.session.ID != "" {
// Cancel the current session's generation process
// This allows users to interrupt long-running operations
- p.app.CoderAgent.Cancel(p.session.ID)
+ p.app.PrimaryAgent.Cancel(p.session.ID)
return p, nil
}
case key.Matches(msg, keyMap.ToggleTools):
@@ -158,7 +158,7 @@ func (p *chatPage) sendMessage(text string, attachments []message.Attachment) te
cmds = append(cmds, util.CmdHandler(chat.SessionSelectedMsg(newSession)))
}
- _, err := p.app.CoderAgent.Run(context.Background(), p.session.ID, text, attachments...)
+ _, err := p.app.PrimaryAgent.Run(context.Background(), p.session.ID, text, attachments...)
if err != nil {
status.Error(err.Error())
return nil
diff --git a/internal/tui/tui.go b/internal/tui/tui.go
index 84fbcfdea..a0430faf7 100644
--- a/internal/tui/tui.go
+++ b/internal/tui/tui.go
@@ -266,7 +266,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case dialog.ModelSelectedMsg:
a.showModelDialog = false
- model, err := a.app.CoderAgent.Update(config.AgentCoder, msg.Model.ID)
+ model, err := a.app.PrimaryAgent.Update(config.AgentPrimary, msg.Model.ID)
if err != nil {
status.Error(err.Error())
return a, nil
@@ -460,7 +460,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
a.showHelp = !a.showHelp
return a, nil
case key.Matches(msg, helpEsc):
- if a.app.CoderAgent.IsBusy() {
+ if a.app.PrimaryAgent.IsBusy() {
if a.showQuit {
return a, nil
}
@@ -574,7 +574,7 @@ func (a *appModel) RegisterCommand(cmd dialog.Command) {
func (a *appModel) moveToPage(pageID page.PageID) tea.Cmd {
// Allow navigating to logs page even when agent is busy
- if a.app.CoderAgent.IsBusy() && pageID != page.LogsPage {
+ if a.app.PrimaryAgent.IsBusy() && pageID != page.LogsPage {
// Don't move to other pages if the agent is busy
status.Warn("Agent is busy, please wait...")
return nil
@@ -641,7 +641,7 @@ func (a appModel) View() string {
}
- if !a.app.CoderAgent.IsBusy() {
+ if !a.app.PrimaryAgent.IsBusy() {
a.status.SetHelpWidgetMsg("ctrl+? help")
} else {
a.status.SetHelpWidgetMsg("? help")
@@ -658,7 +658,7 @@ func (a appModel) View() string {
if a.currentPage == page.LogsPage {
bindings = append(bindings, logsKeyReturnKey)
}
- if !a.app.CoderAgent.IsBusy() {
+ if !a.app.PrimaryAgent.IsBusy() {
bindings = append(bindings, helpEsc)
}
a.help.SetBindings(bindings)