Repository navigation
fix: apply agent.control signals off the agent_control topic processor #870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AlexanderZ-Band
merged 5 commits into
main
from
fix/control-signals-off-the-topic-processor-INT-1808
Oct 20, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2fcc437
fix: apply agent.control signals off the agent_control topic processor
AlexanderZ-Band 7afa503
refactor: share the unconnected BandLink test fixture
AlexanderZ-Band 32a2aaf
fix: bound the adapter's control hook so a hung one cannot stall the …
AlexanderZ-Band debf7d4
revert: drop the adapter control deadline in favour of a stated contract
AlexanderZ-Band 74a015e
fix: cancel bridge play nudges only after the link has disconnected
AlexanderZ-Band File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| """``AgentRunner.close()`` cancels a play nudge spawned while its link is still | ||
| disconnecting: the link applies control signals until ``disconnect()`` returns.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import asyncio | ||
|
|
||
| from band.client.streaming import AgentControlPayload | ||
| from tests.bridge.test_bridge import _build_runner | ||
|
|
||
|
|
||
| class TestCloseAfterControl: | ||
| async def test_a_play_applied_during_disconnect_never_outlives_close( | ||
| self, | ||
| ) -> None: | ||
| runner, _, link = _build_runner() | ||
| story: list[str] = [] | ||
| nudge_started = asyncio.Event() | ||
|
|
||
| async def next_message(room_id: str) -> None: | ||
| story.append(f"nudge {room_id}") | ||
| nudge_started.set() | ||
| try: | ||
| await asyncio.Future() | ||
| except asyncio.CancelledError: | ||
| story.append(f"nudge {room_id} cancelled") | ||
| raise | ||
|
|
||
| async def disconnect() -> None: | ||
| """A PLAY queued in the link's control lane applies before it ends.""" | ||
| await runner._control.handle( | ||
| AgentControlPayload( | ||
| mode="play", scope="room", agent_id="agent-1", room_id="r1" | ||
| ) | ||
| ) | ||
| await nudge_started.wait() | ||
|
|
||
| link.get_next_message.side_effect = next_message | ||
| link.disconnect.side_effect = disconnect | ||
|
|
||
| await asyncio.wait_for(runner.close(), timeout=5.0) | ||
|
|
||
| assert story == ["nudge r1", "nudge r1 cancelled"] |
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
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
Empty file.
Oops, something went wrong.
Oops, something went wrong.
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.