Skip to content

Choosing a model and effort per session over the API, without writing to disk #513

Description

@irisitymichaelgrundberg

What I'm trying to do

My task board starts agent sessions through POST /api/sessions, and its new-session dialog now lets me pick the model and the effort for each session. Two of those choices have no clean route through Codeman's API.

Claude's model

POST /api/sessions takes effort for one session, but it has no per-session model for Claude. The only field that sets one is modelOverride, and the route writes that into <workingDir>/.claude/settings.local.json. The model then stays in that file after the session ends. Every later claude run in that directory starts on it, including runs outside Codeman, until something rewrites the file. Picking a model for one session should not change what a plain claude does in my checkout next week.

The launch template already has a --model slot for Claude. The route fills it only from the app-wide default, because the registry marks Claude's model source as claude-settings-file.

Proposal: add an optional top-level model to CreateSessionSchema, checked against the same characters as the registry's model-claude pattern. When the CLI's model source is claude-settings-file, the route uses body.model first and falls back to the app-wide default. The value reaches the CLI as --model and nothing is written to disk. modelOverride keeps working as it does today for anyone who wants the model written into the case.

Codex's reasoning effort

codexConfig takes a model but no effort, so a session can't start at a particular reasoning effort. Codex sets one with --config model_reasoning_effort=<level>.

Proposal: add codexConfig.reasoningEffort, an enum of the levels codex accepts (none, minimal, low, medium, high, xhigh, max, ultra as of codex-cli 0.154.0). The registry's argv tokens can't splice a value into a literal, so the Codex entry would get one --config model_reasoning_effort=<level> literal per level, each gated on that enum value. Nothing new in the registry is needed, and a level the enum doesn't know emits nothing.

Branches

I have both changes working locally with tests, as two separate branches, since each one stands on its own. I'll open them as draft PRs that link here. Happy to reshape either one if you'd rather do it differently.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions