Skip to content

Commit 2946898

Browse files
authored
fix: ensure command uses currently selected model (#2336)
1 parent b4d9554 commit 2946898

File tree

1 file changed

+9
-6
lines changed
  • packages/tui/internal/app

1 file changed

+9
-6
lines changed

packages/tui/internal/app/app.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -814,15 +814,18 @@ func (a *App) SendCommand(ctx context.Context, command string, args string) (*Ap
814814
}
815815

816816
cmds = append(cmds, func() tea.Msg {
817+
params := opencode.SessionCommandParams{
818+
Command: opencode.F(command),
819+
Arguments: opencode.F(args),
820+
Agent: opencode.F(a.Agents[a.AgentIndex].Name),
821+
}
822+
if a.Provider != nil && a.Model != nil {
823+
params.Model = opencode.F(a.Provider.ID + "/" + a.Model.ID)
824+
}
817825
_, err := a.Client.Session.Command(
818826
context.Background(),
819827
a.Session.ID,
820-
opencode.SessionCommandParams{
821-
Command: opencode.F(command),
822-
Arguments: opencode.F(args),
823-
Agent: opencode.F(a.Agents[a.AgentIndex].Name),
824-
Model: opencode.F(a.State.Provider + "/" + a.State.Model),
825-
},
828+
params,
826829
)
827830
if err != nil {
828831
slog.Error("Failed to execute command", "error", err)

0 commit comments

Comments
 (0)