fix(run_agent): shut down background review memory providers (salvage #15289)#16204
Merged
Conversation
Temporary background review agents can initialize Hindsight-backed memory clients, but close() alone skips provider teardown. Shut the memory provider down before closing so aiohttp sessions do not leak at process exit. Made-with: Cursor
Background review fork now inherits session_id, credential_pool, and status_callback from the parent (added in #16099 after this PR was written). Extend the bare-agent helper so the regression test keeps reaching the cleanup assertions instead of failing in the runtime resolver. Signed-off-by: Teknium <8425893+teknium1@users.noreply.github.com>
19 tasks
5 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.
Shuts down the fork's memory provider before close so Hindsight's aiohttp session doesn't leak once per turn.
Salvage of #15289 by @mrhwick. Cherry-picked all three contributor commits onto current main; author attribution preserved via rebase merge.
Changes
_spawn_background_review: callreview_agent.shutdown_memory_provider()infinallybeforereview_agent.close(). Guarded with try/except Exception: pass.session_id,_parent_session_id,_credential_pool,base_url/api_key/api_mode, andstatus_callback— live-runtime attrs the review fork started touching after fix(run_agent): background review fork inherits parent's live runtime #16099 landed.Validation
finallyblockCloses #15289 (original PR, merged via salvage).