summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-08-30 15:41:06 -0500
committerGitHub <[email protected]>2025-08-30 15:41:06 -0500
commit2946898934fe458bce56720203f1074ddc3c524c (patch)
tree8e01c50908b0e39a057a412ee63afcf76a85c606
parentb4d95545e0d902da8398de63f4ae63c240e02792 (diff)
downloadopencode-2946898934fe458bce56720203f1074ddc3c524c.tar.gz
opencode-2946898934fe458bce56720203f1074ddc3c524c.zip
fix: ensure command uses currently selected model (#2336)
-rw-r--r--packages/tui/internal/app/app.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/packages/tui/internal/app/app.go b/packages/tui/internal/app/app.go
index cbf12e504..8aaddfbcc 100644
--- a/packages/tui/internal/app/app.go
+++ b/packages/tui/internal/app/app.go
@@ -814,15 +814,18 @@ func (a *App) SendCommand(ctx context.Context, command string, args string) (*Ap
}
cmds = append(cmds, func() tea.Msg {
+ params := opencode.SessionCommandParams{
+ Command: opencode.F(command),
+ Arguments: opencode.F(args),
+ Agent: opencode.F(a.Agents[a.AgentIndex].Name),
+ }
+ if a.Provider != nil && a.Model != nil {
+ params.Model = opencode.F(a.Provider.ID + "/" + a.Model.ID)
+ }
_, err := a.Client.Session.Command(
context.Background(),
a.Session.ID,
- opencode.SessionCommandParams{
- Command: opencode.F(command),
- Arguments: opencode.F(args),
- Agent: opencode.F(a.Agents[a.AgentIndex].Name),
- Model: opencode.F(a.State.Provider + "/" + a.State.Model),
- },
+ params,
)
if err != nil {
slog.Error("Failed to execute command", "error", err)