Skip to content

API: allow choosing a model when creating a session #2780

@dgageot

Description

@dgageot

When using docker agent serve api, there's no way to tell the server which model to use for a new session.

POST /api/sessions accepts a session template, but the model-related fields (agent_model_overrides, custom_models_used) are silently dropped — only MaxIterations, MaxConsecutiveToolCalls, MaxOldToolCallTokens, ToolsApproved, WorkingDir and Permissions are copied onto the new session.

The TUI already supports this via App.SetCurrentAgentModel and persists overrides in the session, so the runtime knows how to honor them. It would be nice if the API did the same: pass agent_model_overrides in the create-session body and have SessionManager apply them when building the runtime.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions