fix: background review agent inherits base_url/api_key from parent#7491
Closed
zicochaos wants to merge 1 commit into
Closed
fix: background review agent inherits base_url/api_key from parent#7491zicochaos wants to merge 1 commit into
zicochaos wants to merge 1 commit into
Conversation
The _run_review() closure in _spawn_background_review() creates a child AIAgent with only model/platform/provider but not base_url or api_key. For custom providers, the review agent hits the default endpoint and fails with model_not_supported. Fixes the background memory/skill review path to inherit the full runtime config from the parent agent.
10 tasks
This was referenced Apr 25, 2026
Contributor
|
Thanks for the report and the patch, @zicochaos! This fix has already landed on Evidence:
The implementation goes slightly further than this PR: it also inherits Automated review by hermes-sweeper. |
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.
Summary
The background memory/skill review agent (
_spawn_background_review→_run_review) creates a childAIAgentthat only receivesmodel,platform, andproviderfrom the parent. It does not receivebase_urlorapi_key.For users with custom providers (custom
base_url), the review agent constructs a different client that hits the default provider endpoint instead of the configured one. This causesmodel_not_supportederrors in the background — even though the primary request succeeded.Fix
Pass
base_url=self._base_urlandapi_key=self.api_keyto the review agent constructor (2 lines).How to reproduce
base_urlagent.logshows:Root cause
Test plan
tests/run_agent/test_review_agent_runtime.pybase_urlandapi_keyare passed to the review agent constructor