Let Compact continue on another model or vendor
This commit is contained in:
@@ -325,13 +325,24 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
return "Interrupted.", nil
|
||||
}),
|
||||
|
||||
tool("compact_task", "Have a task's idle agent write a handoff and continue in a fresh session.", taskOnly,
|
||||
tool("compact_task", "Have a task's idle agent write a handoff and continue in a fresh session.",
|
||||
`{"type": "object", "properties": {
|
||||
"task_id": {"type": "string"},
|
||||
"model": {"type": "string", "description": "Start the fresh session on this model, on either vendor; the current agent still writes the handoff. Defaults to the current model."}
|
||||
}, "required": ["task_id"]}`,
|
||||
func(ctx context.Context, user api.User, raw json.RawMessage) (string, error) {
|
||||
args := struct {
|
||||
Model string `json:"model"`
|
||||
}{}
|
||||
err := json.Unmarshal(raw, &args)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
sess, err := m.taskSessionArg(ctx, raw)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
_, err = m.Compact(ctx, sess.Id)
|
||||
_, err = m.Compact(ctx, sess.Id, args.Model)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user