-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Extract flush_all teardown helpers into agent_server.teardown#1916
Open
Shi-Dong wants to merge 1 commit into
Open
Extract flush_all teardown helpers into agent_server.teardown #1916Shi-Dong wants to merge 1 commit into
Shi-Dong wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Enjoy a better diff viewing experience by clicking one of these URLs:
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Devin Review: No Issues Found
Devin Review analyzed this PR and found no bugs or issues to report.
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.
Uh oh!
There was an error while loading. Please reload this page.
What
Continues slimming the repo-root
miles_agent_server.pytoward a thin FastAPI entrypoint. Now that the mutable state (inflight_tasks,trial_projects) lives on theServerStatesingleton, the two/flush_allteardown helpers no longer reach into miles globals and can move cleanly.New
agent_server/teardown.pyholds:_cancel_all_inflight— cancels every in-flight/runtask (reads_state.inflight_tasks)_kill_trial_containers— tears down the compose projects this server created (reads_state.trial_projects, callsdocker_ops._list_compose_projects/_run_docker)miles_agent_server.pyre-imports both (the/flush_allroute still calls them) and drops the now-orphaned_list_compose_projects/_run_dockerimports._prune_dockerstays (still used directly by the/flush_allhandler).Tests
from agent_server import teardowntotest_miles_agent_server_flush_all.py.TestKillTrialContainerspatches the helper's internal_list_compose_projects/_run_dockercalls → repointed toteardown.*(patch-where-used: the moved function resolves those in its own namespace).TestListComposeProjectsinvokes the helper directly → repointed todocker_ops._list_compose_projects()(no longer re-imported into miles)./flush_allendpoint tests patchmodule._cancel_all_inflight/module._kill_trial_containers— unchanged (the route resolves them via the re-import).Full
tests/unitsuite: 2854 passed, 1 skipped.ruff check+ruff format --checkclean on the changed files.Stacked
Targets
shi/refactor-agent-server-13-trial-runner(#1914). Part of themiles_agent_server.py→agent_server/decomposition chain.