Repository navigation
Check route selection before every ACP prompt - #1166
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
MI's lifetime-hold finding is already partly fixed on Toad main by #1159: open_selected and ACP start no longer transfer their route contexts into cleanup. This PR keeps those scopes as direct with-blocks and removes their unnecessary ExitStack wrappers.
The supplied ACP prompt callback checks session and queue identity. AgentProcess.prompt reaches the existing CoordinationAccess through agent.controller.transcripts.access, then invokes access.require(self.route_selection) on its existing preparation worker. CoordinationAccess.require owns the live-route comparison; AgentProcess contains no copy. The session/queue callback still runs after that check and before the RPC. No lifetime route lock is added.
Paired with OpenHCSDev/agent-comms#2915 at d0ea1698fec34bcf0142974715d9a7007661a8c0, which shortens the Core watch client scopes before removing its route-publication deadline.
Step 0 after:
comms_root.py:374-380acp/agent_process.py:73-93cli_commands.py:939-940cli_commands.py:1411-1413cli_commands.py:1449-1450comms.py:100-101comms.py:106-112comms.py:115-116route_selection.py:70-71comms.py:92-93,active_route.py:62-63active_route.py:187-188client_wireis a context factory, not an entered lifetime holder. Historical-root write callers were traced in input_origin, messaging, channel_management, publisher, coordination_tables/refusals and todos; each encloses its one write operation. Route publication waits inactive_route.py:267through the existing UNBOUNDED_CONTENTION, with no deadline or refusal translation.Search
RouteReadersHold|default-route readers holdacross Core and Toad src/tests: empty. At 12e6c7f, Ruff I001 passes. No tests, application launch or install ran, as directed.Assumed: the pair ships in the same runtime update; the existing session and queue checks remain required alongside the route check.