import importlib.util from pathlib import Path def _load_ws_smoke_module(): script_path = Path(__file__).resolve().parents[1] / "scripts" / "ws_smoke.py" spec = importlib.util.spec_from_file_location("ws_smoke", script_path) module = importlib.util.module_from_spec(spec) assert spec.loader is not None spec.loader.exec_module(module) return module def test_build_payload_can_disable_handoff_note_tool(): ws_smoke = _load_ws_smoke_module() payload = ws_smoke.build_payload( message="debug the event flow", model="compatible-model", handoff_note_enabled=False, ) assert payload["user_message"] == "debug the event flow" assert payload["chat_agent"]["model"] == "compatible-model" assert payload["event_agent"]["enabled_tools"] == [] def test_parser_defaults_to_blank_model_for_backend_fallback(): ws_smoke = _load_ws_smoke_module() args = ws_smoke.build_parser().parse_args([]) assert args.model == ""