diff --git a/skills/deploy-to-vibestack/scripts/vibestack_deploy.py b/skills/deploy-to-vibestack/scripts/vibestack_deploy.py index 5b39c7b..60d81b1 100755 --- a/skills/deploy-to-vibestack/scripts/vibestack_deploy.py +++ b/skills/deploy-to-vibestack/scripts/vibestack_deploy.py @@ -691,9 +691,9 @@ def deploy(args: argparse.Namespace) -> None: print(json.dumps(status.get("error") or status, indent=2)) app_id = status.get("appId") or (status.get("app") or {}).get("id") or created.get("appId") or args.app_id if app_id: - doctor = fetch_doctor(endpoint, args.token, str(app_id), args.insecure_tls, args.diagnostics_tail) - if doctor: - print_doctor_guidance(doctor) + doctor_packet = fetch_doctor(endpoint, args.token, str(app_id), args.insecure_tls, args.diagnostics_tail) + if doctor_packet: + print_doctor_guidance(doctor_packet) raise SystemExit(1) time.sleep(args.poll_interval) diff --git a/skills/deploy-to-vibestack/scripts/vibestack_deploy_test.py b/skills/deploy-to-vibestack/scripts/vibestack_deploy_test.py index 1282f1f..6350332 100644 --- a/skills/deploy-to-vibestack/scripts/vibestack_deploy_test.py +++ b/skills/deploy-to-vibestack/scripts/vibestack_deploy_test.py @@ -258,6 +258,34 @@ def fake_http_json(method, url, token, body=None, content_type=None, insecure_tl self.assertEqual(calls, ["https://vibestack.local.test/api/v1/apps/app-1/doctor?tail=25"]) self.assertIn('"rootCauseCategory": "missing_health_route"', output.getvalue()) + def test_deploy_dispatches_doctor_without_local_shadowing(self) -> None: + module = load_helper_module() + calls: list[str] = [] + + def fake_http_json(method, url, token, body=None, content_type=None, insecure_tls=False): + calls.append(url) + return {"doctor": {"summary": "health route is missing", "rootCauseCategory": "missing_health_route"}} + + module.http_json = fake_http_json + args = module.build_parser().parse_args( + [ + "--doctor", + "--api-url", + "https://vibestack.local.test", + "--token", + "test-token", + "--app-id", + "app-1", + ] + ) + + output = StringIO() + with redirect_stdout(output): + module.deploy(args) + + self.assertEqual(calls, ["https://vibestack.local.test/api/v1/apps/app-1/doctor?tail=300"]) + self.assertIn('"summary": "health route is missing"', output.getvalue()) + def test_print_doctor_guidance_prefers_ai_enhancement(self) -> None: module = load_helper_module() output = StringIO()