From 9afb6860326e737d8016792ddbcb5793ceccbc42 Mon Sep 17 00:00:00 2001 From: khushalsonawat Date: Thu, 12 Nov 2026 10:01:31 +0530 Subject: [PATCH 1/3] test(harness): the worker inherits the runner's Cartesia key, and only that test_worker_never_inherits_host_voice_provider_credentials still said the worker never gets the runner's CARTESIA_API_KEY. f0b3fcea (#69) allowed it on purpose, two days after the test was written: the runner's key voices the simulated caller, and a job's own value can't replace it. The test failed since, outside CI's list. It now holds that rule, and still holds that the runner's LiveKit and Deepgram credentials stay out. TH-9550 Signed-off-by: khushalsonawat --- tests/test_harness_secrets.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_harness_secrets.py b/tests/test_harness_secrets.py index b8e0fffb6..5381f27d3 100644 --- a/tests/test_harness_secrets.py +++ b/tests/test_harness_secrets.py @@ -136,7 +136,7 @@ def test_worker_inherits_runner_topology_but_uploaded_values_cannot_replace_it() def test_worker_never_inherits_host_voice_provider_credentials(): child = worker_environment( - {"LIVEKIT_API_KEY": "job-livekit"}, + {"LIVEKIT_API_KEY": "job-livekit", "CARTESIA_API_KEY": "job-cartesia"}, host_environment={ "PATH": "/bin", "LIVEKIT_API_KEY": "runner-livekit", @@ -149,7 +149,10 @@ def test_worker_never_inherits_host_voice_provider_credentials(): assert child["LIVEKIT_API_KEY"] == "job-livekit" assert "LIVEKIT_API_SECRET" not in child assert "DEEPGRAM_API_KEY" not in child - assert "CARTESIA_API_KEY" not in child + # The one exception: the runner's Cartesia key voices the simulated caller + # (call_runner.py, `cartesia_key`), so the worker inherits it (f0b3fcea, #69), and a job's + # own value can't replace it. + assert child["CARTESIA_API_KEY"] == "runner-cartesia" def test_worker_inherits_runner_model_roles_but_jobs_cannot_replace_them(): From 9b1e42add3e172c036d9d2a226a8f39a95187bae Mon Sep 17 00:00:00 2001 From: khushalsonawat Date: Thu, 12 Nov 2026 10:04:03 +0530 Subject: [PATCH 2/3] ci: run the worker-secrets tests in sdk-smoke test_harness_secrets.py guards what a sandbox worker inherits, and one of its tests failed for months unseen because CI never ran the file. The whole file passes on this branch. TH-9550 Signed-off-by: khushalsonawat --- .github/workflows/sdk-smoke.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sdk-smoke.yml b/.github/workflows/sdk-smoke.yml index 8589e0e0d..67c8a35fb 100644 --- a/.github/workflows/sdk-smoke.yml +++ b/.github/workflows/sdk-smoke.yml @@ -69,6 +69,7 @@ jobs: --deselect tests/test_harness_sandbox_server.py::test_public_github_branch_url_populates_job_ref tests/test_harness_architecture.py tests/test_harness_credentials.py + tests/test_harness_secrets.py tests/harness/test_runtime_repair.py tests/harness/test_runtime_selection_admission.py tests/harness/test_nudge_turn.py From e5fd3e1fa8d861c0cfae11925eb33da17bb0df1d Mon Sep 17 00:00:00 2001 From: khushalsonawat Date: Thu, 12 Nov 2026 11:04:09 +0530 Subject: [PATCH 3/3] test(harness): name the worker test for what it checks, and cover a missing LiveKit key The test asserted that the worker inherits the runner's Cartesia key, but its name said it never inherits a voice credential. It is renamed. A job that sends no LiveKit key now has its own case: the runner's LIVEKIT_API_KEY must not be inherited either. Before, the job's own value always hid it. Both from the #309 check. TH-9550 Signed-off-by: khushalsonawat --- tests/test_harness_secrets.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_harness_secrets.py b/tests/test_harness_secrets.py index 5381f27d3..e2b26c102 100644 --- a/tests/test_harness_secrets.py +++ b/tests/test_harness_secrets.py @@ -134,7 +134,7 @@ def test_worker_inherits_runner_topology_but_uploaded_values_cannot_replace_it() assert child["HARNESS_RUNTIME_WEBHOOK_URL"] == "http://runner.internal:8787" -def test_worker_never_inherits_host_voice_provider_credentials(): +def test_worker_inherits_only_the_runners_cartesia_voice_credential(): child = worker_environment( {"LIVEKIT_API_KEY": "job-livekit", "CARTESIA_API_KEY": "job-cartesia"}, host_environment={ @@ -154,6 +154,13 @@ def test_worker_never_inherits_host_voice_provider_credentials(): # own value can't replace it. assert child["CARTESIA_API_KEY"] == "runner-cartesia" + # A job that sends no LiveKit key gets none: the runner's key isn't inherited either. + without_job_keys = worker_environment( + {}, + host_environment={"PATH": "/bin", "LIVEKIT_API_KEY": "runner-livekit"}, + ) + assert "LIVEKIT_API_KEY" not in without_job_keys + def test_worker_inherits_runner_model_roles_but_jobs_cannot_replace_them(): child = worker_environment(