fix(agent): inherit reasoning_config in background review fork (#18871) - #36995
fix(agent): inherit reasoning_config in background review fork (#18871)#36995izzzzzi wants to merge 1 commit into
Conversation
…esearch#18871) _run_review_in_thread now clones the parent's reasoning_config, service_tier, and request_overrides into the forked AIAgent. Without this, a parent session configured for `xhigh` effort (or `none` on thinking models) can still spawn a review that costs tokens the user explicitly opted out of — because a fresh AIAgent with reasoning_config=None falls back to a transport-local medium default on Codex Responses and Ollama routes. This matches the existing posture for enabled_toolsets / disabled_ toolsets: every runtime field the parent carries should be cloned, not just the ones the review path explicitly enumerates. 7 new tests lock the contract: each of the three fields passes through verbatim, None propagates (not absent — that would re-introduce the bug), and pre-existing fields still clone correctly.
|
Duplicate of #27510, which applies the same fix in the same post-refactor location ( |
|
Thanks for the focused regression report. The underlying bug remains on current main: the live review-fork construction at Problems
Suggested changes
Automated hermes-sweeper review. |
|
Thanks for the fix. The core of this PR — inheriting On the other two fields this PR forwards:
Closing as superseded for the merged portion. Thanks for the contribution — the |
Summary
Fix for issue #18871 (open).
_run_review_in_thread(agent/background_review.py) now clones the parent'sreasoning_config,service_tier, andrequest_overridesinto the forkedAIAgent.Without this, a parent session configured for
xhigheffort (ornoneon thinking models) could still spawn a review that costs tokens the user explicitly opted out of — because a freshAIAgentwithreasoning_config=Nonefalls back to a transport-localmediumdefault on Codex Responses and Ollama routes.Changes
agent/background_review.py: Added 3 kwargs to the review fork'sAIAgentconstructor:reasoning_config,service_tier,request_overrides. Each usesgetattr(agent, ...)for backward compatibility with parents that don't carry these fields.tests/run_agent/test_background_review_reasoning_inheritance.py: 7 new tests locking the contract:Testing
Related