Skip to content

feat(runner): let sys_session_create set a per-session reasoning_effort (#2080)#3243

Open
abhay-codes07 wants to merge 1 commit into
omnigent-ai:mainfrom
abhay-codes07:feat/2080-session-create-reasoning-effort
Open

feat(runner): let sys_session_create set a per-session reasoning_effort (#2080)#3243
abhay-codes07 wants to merge 1 commit into
omnigent-ai:mainfrom
abhay-codes07:feat/2080-session-create-reasoning-effort

Conversation

@abhay-codes07

Copy link
Copy Markdown
Contributor

Related issue

Closes #2080

Summary

sys_session_create(agent_id=...) already forwards a caller-supplied model into the POST /v1/sessions body as model_override (shipped since the issue was filed), but there was no matching knob for reasoning effort — so a parent that launches an existing agent by id was pinned to that agent's default effort. SessionCreateRequest.reasoning_effort is already a first-class field on the create endpoint; only the tool surface didn't expose it.

This adds an optional reasoning_effort parameter to sys_session_create, threaded through _build_session_create_body into the create body next to model_override. It is included only when a non-empty string, so an unset value leaves the server on the agent default rather than persisting an empty override. That completes the per-session override surface the issue asks for (cost / tier routing of fan-out children: cheap throwaway probes on a small/haiku-class model + low effort, distinct from the orchestrator's own default).

Test Plan

Added to tests/runner/test_runner_dispatch.py:

  • test_sys_session_create_threads_model_and_reasoning_effort — both model_override and reasoning_effort land in the create body
  • test_sys_session_create_omits_reasoning_effort_when_absent — an unset value (and model) is omitted entirely
OMNIGENT_SKIP_WEB_UI=true uv run pytest tests/runner/test_runner_dispatch.py -q -k sys_session_create

The reasoning_effort thread-through fails against main (the key is dropped from the create body) and passes with the change. ruff check + ruff format --check clean.

Demo

N/A. Runner tool-surface change with no visual surface. Before: sys_session_create had model but no reasoning_effort, so a by-id child always ran the agent's default effort. After: passing reasoning_effort: "low" persists it on the child session (omitted when unset).

Type of change

  • Bug fix
  • Feature
  • UI / frontend change
  • Refactor / chore
  • Docs
  • Test / CI
  • Breaking change

Test coverage

  • Unit tests added / updated
  • Integration tests added / updated
  • E2E tests added / updated
  • Manual verification completed
  • Existing tests cover this change
  • Not applicable

Coverage notes

The thread-through is asserted end to end through execute_tool (schema → dispatch → create body) for both the present and absent cases. The model half of the issue was already shipped and covered; this PR closes the remaining reasoning_effort gap.

Changelog

sys_session_create now accepts an optional reasoning_effort, so an orchestrator can launch an existing agent on a non-default reasoning effort (matching the existing model override) for cost/tier routing.

…rt (omnigent-ai#2080)

`sys_session_create(agent_id=...)` already forwards a caller-supplied
`model` into the create body as `model_override`, but had no matching
knob for reasoning effort, so a parent that launches an existing agent by
id was pinned to that agent's default effort. `SessionCreateRequest`
already accepts `reasoning_effort` as a first-class field; only the tool
surface did not expose it.

Add an optional `reasoning_effort` parameter to `sys_session_create`,
threaded through `_build_session_create_body` into the `POST /v1/sessions`
body next to `model_override`. Included only when a non-empty string, so
an unset value leaves the server on the agent default rather than
persisting an empty override. This completes the per-session override
surface for cost/tier routing of fan-out children.

Tests: model + reasoning_effort both land in the create body; an unset
reasoning_effort (and model) are omitted entirely. The reasoning_effort
thread-through fails against main (the key is dropped) and passes with it.

Signed-off-by: abhay-codes07 <abhaysingh0293@gmail.com>
Copilot AI review requested due to automatic review settings July 24, 2026 15:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the size/M Pull request size: M label Jul 24, 2026
@github-actions
github-actions Bot requested a review from SabhyaC26 July 24, 2026 15:11
@github-actions

Copy link
Copy Markdown
Contributor

@abhay-codes07 This PR is a Bug fix, Feature, or UI / frontend change but the Demo section is missing or only contains a placeholder.

These change types require a screenshot or screen recording so reviewers can see the new behaviour without checking out the branch. Please update the Demo section with:

  • A screenshot or screen recording of the change, or
  • A link to a hosted video or GIF showing the new behaviour.

Use N/A only when the change has no user-visible effect whatsoever (e.g. a pure refactor or test-only change). If that's the case, uncheck the relevant type box and check Refactor / chore or Test / CI instead.

@github-actions github-actions Bot added the needs-demo PR needs a demo screenshot or recording label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-demo PR needs a demo screenshot or recording size/M Pull request size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(runner): sys_session_create cannot set a per-session model — no way to launch an existing agent on a non-default model

3 participants