fix(agent): forward reasoning_config to background review AIAgent fork#18973
Open
nftpoetrist wants to merge 1 commit into
Open
fix(agent): forward reasoning_config to background review AIAgent fork#18973nftpoetrist wants to merge 1 commit into
nftpoetrist wants to merge 1 commit into
Conversation
_spawn_background_review() (run_agent.py line ~3611) inherits the parent session's provider, model, base_url, api_key, and api_mode — but not reasoning_config. On Codex Responses routes the forked review agent falls back to the transport default (medium effort), so a session configured for agent.reasoning_effort: xhigh still generates medium- effort background review requests. Fix: pass reasoning_config=self.reasoning_config to the AIAgent constructor in _spawn_background_review(). When reasoning_config is None the behaviour is identical to before — harmless no-op for sessions without a reasoning override. Symmetric with the api_mode/base_url/api_key fields that NousResearch#16006 and NousResearch#15884 already propagate on the same fork path. Fixes NousResearch#18871
11 tasks
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.
What does this PR do?
`_spawn_background_review()` in `run_agent.py` (line ~3611) inherits the parent session's `provider`, `model`, `base_url`, `api_key`, and `api_mode` when forking a review agent. `reasoning_config` was not forwarded.
On Codex Responses routes the missing field causes the forked review agent to fall back to the transport default (`medium` effort), so a session configured for `agent.reasoning_effort: xhigh` still generates medium-effort background review requests — wasting budget and ignoring the user's explicit preference.
One-line fix in `_spawn_background_review()` — passes `reasoning_config=self.reasoning_config`. When `reasoning_config` is `None` the behaviour is identical to before: harmless no-op for sessions without a reasoning override. Symmetric with the `api_mode`, `base_url`, and `api_key` fields that #16006 and #15884 already propagate on the same fork path.
Related Issue
Fixes #18871
Type of Change
Changes Made
How to Test
```bash
python3.11 -m pytest tests/run_agent/test_background_review.py -v --override-ini="addopts="
```
Checklist
Code
Documentation & Housekeeping