From e43b2a78def1a311768c13df6a266c11a9a11f3d Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Fri, 23 Oct 2026 14:06:33 -0400 Subject: [PATCH] Let the SessionStart owner test give its root to the runtime that serves it The test built its root in-process, so the test venv adopted it, then started the hook's bridge from the source programs: RootRuntime refused that foreign runtime and the bridge died before readiness. Publish the root to the source programs' runtime, as test_install_session_bridge and test_goal_nominal do, and drop the Bus.install that root adoption already performs. SessionBridge.pause returns one ResumableBridge, so stop unpacking it as a tuple. Co-Authored-By: Claude Opus 5.5 --- tests/test_session_bridge_owner.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/test_session_bridge_owner.py b/tests/test_session_bridge_owner.py index 9053077060..ab280c6252 100644 --- a/tests/test_session_bridge_owner.py +++ b/tests/test_session_bridge_owner.py @@ -1,8 +1,5 @@ """The real SessionStart program must leave an installable serve after hook exit.""" - -from agent_comms.bus import Bus - import asyncio import json import os @@ -20,6 +17,7 @@ from agent_comms.cli_bridges.shared import Binding, Serve from agent_comms.comms import wire from agent_comms.launch_runtime import LaunchRuntime +from agent_comms.root_runtime import RootRuntime from agent_comms.thread_execution import ExternalThreadExecution from agent_comms_hooks.session import started from agent_comms_hooks.watch import LiveWatch, WatchClaim, WatchRecord @@ -31,7 +29,8 @@ def test_session_start_hook_exit_preserves_the_recorded_owner_for_install_pause( home = bridge_home session = 'copied-session' comms = wire(tmp_path / 'bus') - Bus.install(Bus.path_in(comms.root)) + # The source programs run the hook's bridge, so their runtime owns the root it attaches to. + RootRuntime.publish(comms.root, source_programs.runtime) comms.registry.declare(Thread( 'bridge-copy', frozenset(), str(tmp_path), execution=ExternalThreadExecution)) transcript = tmp_path / f'{session}.jsonl' @@ -92,7 +91,7 @@ def unexpected_serve(): assert observed.process.alive() (bridge,) = Serve.running(home) with ExitStack() as resources: - (paused,) = bridge.pause(resources) + paused = bridge.pause(resources) assert paused.bridge.observed.owner == expected assert isinstance(claim.state(), LiveWatch) assert owner.poll() is None