Skip to content

The agent that grows with you

test: trampoline identity probe accepts nested launchers; native suite keeps the full worker traceback as an artifact

Teknium98efa22cb4e6
diff --git a/tests/gateway/test_managed_worker_trampoline.py b/tests/gateway/test_managed_worker_trampoline.py
index 97df9267233..c8f085b93d0 100644
--- a/tests/gateway/test_managed_worker_trampoline.py
+++ b/tests/gateway/test_managed_worker_trampoline.py
@@ -42,7 +42,8 @@ def test_owner_binds_reservation_to_verified_descendant_of_the_handle_only(tmp_p
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
try:
real = int(launcher.stdout.readline())
- assert real != launcher.pid and psutil.Process(real).ppid() == launcher.pid
+ # One hop on POSIX; a venv trampoline (Windows) nests a second launcher in the chain.
+ assert real != launcher.pid and launcher.pid in [p.pid for p in psutil.Process(real).parents()]
with closing(SessionDB(tmp_path / 'state.db')) as db:
db.create_session('owned', 'cli')
epoch = begin_runtime_epoch(db, instance_id='owner')
diff --git a/tests/gateway/test_unified_gateway_native_live.py b/tests/gateway/test_unified_gateway_native_live.py
index c268b43c49e..0c1a5c3a380 100644
--- a/tests/gateway/test_unified_gateway_native_live.py
+++ b/tests/gateway/test_unified_gateway_native_live.py
@@ -493,6 +493,11 @@ def test_native_safe_mode_cli_executes_in_managed_worker(harness):
'worker_errors': [r for r in records(audit) if r['kind'] == 'worker_error'],
'worker_executions': query(home, 'SELECT execution_id,status FROM worker_executions'),
'gateway_log': (home / 'logs' / 'gateway.log').read_text(encoding='utf-8', errors='replace')[-4000:]}
+ if proc.returncode != 0:
+ # The assertion repr truncates the worker traceback; the artifact keeps it whole.
+ artifacts = Path(os.environ.get('UGW_ARTIFACT_DIR', str(home.parent)))
+ artifacts.mkdir(parents=True, exist_ok=True)
+ (artifacts / 'safe-mode-evidence.json').write_text(json.dumps(evidence, indent=1), encoding='utf-8')
assert proc.returncode == 0, (proc.returncode, out, err, json.dumps(evidence, indent=1))
assert 'NATIVE_ACK_SAFE_PROBE_NATIVE' in out + err, (out, err)
sid = re.search(r'Session: (\S+)', err).group(1)