import json

from rcl_rlm import host


def test_run_for_host_sets_adapter_module(monkeypatch) -> None:
    captured = {}

    def fake_run(payload: dict) -> dict:
        captured["payload"] = payload
        return {"answer": "ok"}

    monkeypatch.setattr(host, "run_runner", fake_run)

    response = host.run_for_host(json.dumps({"question": "hello"}))
    data = json.loads(response)

    assert data["answer"] == "ok"
    assert captured["payload"]["adapter_module"] == "rcl_rlm.runner_adapter"
    assert captured["payload"]["question"] == "hello"
