Support configuring effort alongside model
This commit is contained in:
@@ -39,7 +39,7 @@ func (m *Manager) lockDelivery(sessionID string) func() {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Manager) Message(ctx context.Context, sessionID, actor, text, model, sendID, client string, images ...string) (api.AgentSession, bool, error) {
|
||||
func (m *Manager) Message(ctx context.Context, sessionID, actor, text, model, effort, sendID, client string, images ...string) (api.AgentSession, bool, error) {
|
||||
unlock := m.lockDelivery(sessionID)
|
||||
defer unlock()
|
||||
|
||||
@@ -64,11 +64,11 @@ func (m *Manager) Message(ctx context.Context, sessionID, actor, text, model, se
|
||||
}
|
||||
held := sess.State == api.AgentSessionStateIdle && sess.Role == api.Implementer && (automatedActor(actor) && m.interrupted(sess.Id) || landing || m.isPaused(sess.Id))
|
||||
if !held && (sess.State != api.AgentSessionStateRunning || sess.Role != api.Implementer) {
|
||||
sess, err = m.Send(ctx, sessionID, actor, text, model, sendID, client, images...)
|
||||
sess, err = m.Send(ctx, sessionID, actor, text, model, effort, sendID, client, images...)
|
||||
return sess, false, err
|
||||
}
|
||||
|
||||
sess, err = m.changeModel(ctx, sess, model, actor)
|
||||
sess, err = m.changeModel(ctx, sess, model, effort, actor)
|
||||
if err != nil {
|
||||
return api.AgentSession{}, false, err
|
||||
}
|
||||
@@ -157,7 +157,7 @@ func (m *Manager) deliverQueued(ctx context.Context, sess api.AgentSession) (boo
|
||||
}
|
||||
|
||||
in := inputs[0]
|
||||
_, err = m.Send(ctx, sess.Id, in.Actor, in.Text, "", in.SendID, in.Client, in.Images...)
|
||||
_, err = m.Send(ctx, sess.Id, in.Actor, in.Text, "", "", in.SendID, in.Client, in.Images...)
|
||||
if errors.Is(err, ErrConflict) {
|
||||
slog.Info("queued message held: session changed state", "session", sess.Id, "task", task.Id, "err", err)
|
||||
return true, nil
|
||||
|
||||
Reference in New Issue
Block a user