import asyncio from mcp_server import codex_server def test_codex_server_has_only_repository_coordination_tools() -> None: tools = asyncio.run(codex_server.mcp.list_tools()) assert {tool.name for tool in tools} == { "get_domain_summary", "get_messages", "mark_message_read", "acknowledge_notice", "add_progress_event", "record_decision", "update_task_status", } def test_codex_server_uses_distinct_server_identity() -> None: assert codex_server.mcp.name == "dev-hub-codex" def test_mark_message_read_passes_reader(monkeypatch) -> None: calls = [] monkeypatch.setattr( codex_server, "_request", lambda method, path, body=None: calls.append((method, path, body)) or {} ) codex_server.mark_message_read("abc", reader="state-hub") codex_server.mark_message_read("abc") codex_server.acknowledge_notice("abc", "state-hub") assert calls == [ ("PATCH", "/messages/abc/read?reader=state-hub", {}), ("PATCH", "/messages/abc/read", {}), ("POST", "/messages/abc/ack", {"agent": "state-hub"}), ]