feat(runner): let sys_session_create set a per-session reasoning_effort (#2080)#3243
Open
abhay-codes07 wants to merge 1 commit into
Open
Conversation
…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>
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:
Use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Closes #2080
Summary
sys_session_create(agent_id=...)already forwards a caller-suppliedmodelinto thePOST /v1/sessionsbody asmodel_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_effortis already a first-class field on the create endpoint; only the tool surface didn't expose it.This adds an optional
reasoning_effortparameter tosys_session_create, threaded through_build_session_create_bodyinto the create body next tomodel_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— bothmodel_overrideandreasoning_effortland in the create bodytest_sys_session_create_omits_reasoning_effort_when_absent— an unset value (and model) is omitted entirelyThe reasoning_effort thread-through fails against
main(the key is dropped from the create body) and passes with the change.ruff check+ruff format --checkclean.Demo
N/A. Runner tool-surface change with no visual surface. Before:
sys_session_createhadmodelbut noreasoning_effort, so a by-id child always ran the agent's default effort. After: passingreasoning_effort: "low"persists it on the child session (omitted when unset).Type of change
Test coverage
Coverage notes
The thread-through is asserted end to end through
execute_tool(schema → dispatch → create body) for both the present and absent cases. Themodelhalf of the issue was already shipped and covered; this PR closes the remainingreasoning_effortgap.Changelog
sys_session_createnow accepts an optionalreasoning_effort, so an orchestrator can launch an existing agent on a non-default reasoning effort (matching the existingmodeloverride) for cost/tier routing.