mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix: ensure command uses currently selected model (#2336)
Some checks are pending
deploy / deploy (push) Waiting to run
Some checks are pending
deploy / deploy (push) Waiting to run
This commit is contained in:
parent
b4d95545e0
commit
2946898934
1 changed files with 9 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue