Skip to content

fix: preserve runtime in background review clones - #16006

Closed
guantik-gm wants to merge 1 commit into
NousResearch:mainfrom
guantik-gm:fix/background-review-runtime-clone
Closed

fix: preserve runtime in background review clones#16006
guantik-gm wants to merge 1 commit into
NousResearch:mainfrom
guantik-gm:fix/background-review-runtime-clone

Conversation

@guantik-gm

Copy link
Copy Markdown

Summary

  • preserve base_url, api_key, and api_mode when _spawn_background_review() forks a review agent
  • prevent named custom providers resolved to provider='custom' from degrading into a bare custom/main review clone
  • add regression coverage for memory, skill, and combined background-review modes

Problem

Gateway/main sessions using named custom providers are runtime-resolved to provider='custom' plus explicit runtime credentials. Background review cloned only model + provider, so the fork lost endpoint state and failed with:

  • resolve_provider_client: custom/main requested but no endpoint credentials found
  • Auxiliary background review failed: No LLM provider configured

Test Plan

  • pytest tests/run_agent/test_background_review_runtime_inheritance.py tests/run_agent/test_background_review_summary.py -q
  • minimal runtime repro: clone with only model + provider fails; clone with inherited runtime fields succeeds

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels Apr 26, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #7491, #2581, and #15884 — all address the same background review runtime inheritance issue. This PR adds additional regression test coverage.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the regression-focused fix. This automated hermes-sweeper review found that the requested behavior is already on main.

  • run_agent.py:1155-1163 exposes the parent session's live base_url, api_key, and api_mode through _current_main_runtime().
  • agent/background_review.py:55-64 resolves that live runtime, and agent/background_review.py:683-692 forwards provider, api_mode, base_url, api_key, and credential_pool to the review AIAgent.
  • The linked runtime-inheritance discussion was resolved by merged PR fix(run_agent): background review fork inherits parent's live runtime #16099 (e3901d5b257d5ac3f58420c3fb55aaa536fc56ac); the current refactored implementation is included in v2026.7.1.

Closing as implemented on main.

@teknium1 teknium1 closed this Jul 12, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants