mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-07 05:32:20 +01:00
test(baseline): align UI and model profile expectations
This commit is contained in:
@@ -15,6 +15,11 @@ NOTES_TOOLS = {
|
||||
"ask_user",
|
||||
"update_plan",
|
||||
}
|
||||
GENERAL_COMPACT_TOOLS = {"ask_user", "web_search", "web_fetch"}
|
||||
CALENDAR_COMPACT_TOOLS = {
|
||||
"ask_user", "bash", "get_workspace", "manage_calendar", "manage_notes",
|
||||
"python", "read_file", "web_fetch", "web_search",
|
||||
}
|
||||
|
||||
|
||||
def _collect(generator):
|
||||
@@ -102,9 +107,7 @@ def test_odysseus_notes_mode_clamps_without_overriding_caller_denials(monkeypatc
|
||||
assert {"manage_notes", "manage_calendar", "manage_tasks"} <= route["disabled_tools"]
|
||||
|
||||
|
||||
def test_odysseus_general_mode_disables_every_tool(monkeypatch):
|
||||
from src.tool_policy import known_tool_names
|
||||
|
||||
def test_odysseus_general_mode_uses_compact_core(monkeypatch):
|
||||
prompt_calls, _ = _install_route_probe(monkeypatch)
|
||||
|
||||
_run_probe(
|
||||
@@ -113,11 +116,10 @@ def test_odysseus_general_mode_disables_every_tool(monkeypatch):
|
||||
)
|
||||
|
||||
route = prompt_calls[0]
|
||||
assert route["relevant_tools"] == set()
|
||||
assert known_tool_names() <= route["disabled_tools"]
|
||||
assert route["relevant_tools"] == GENERAL_COMPACT_TOOLS
|
||||
|
||||
|
||||
def test_odysseus_calendar_intent_uses_notes_mode(monkeypatch):
|
||||
def test_odysseus_calendar_intent_uses_compact_calendar_route(monkeypatch):
|
||||
prompt_calls, _ = _install_route_probe(monkeypatch)
|
||||
|
||||
_run_probe(
|
||||
@@ -125,10 +127,10 @@ def test_odysseus_calendar_intent_uses_notes_mode(monkeypatch):
|
||||
relevant_tools={"manage_notes", "manage_calendar", "manage_tasks", "bash"},
|
||||
)
|
||||
|
||||
assert prompt_calls[0]["relevant_tools"] == NOTES_TOOLS
|
||||
assert prompt_calls[0]["relevant_tools"] == CALENDAR_COMPACT_TOOLS
|
||||
|
||||
|
||||
def test_odysseus_calendar_followup_keeps_notes_mode(monkeypatch):
|
||||
def test_odysseus_calendar_followup_keeps_compact_calendar_route(monkeypatch):
|
||||
prompt_calls, _ = _install_route_probe(monkeypatch)
|
||||
messages = [
|
||||
{"role": "user", "content": "Add lunch tomorrow to my calendar."},
|
||||
@@ -153,7 +155,7 @@ def test_odysseus_calendar_followup_keeps_notes_mode(monkeypatch):
|
||||
relevant_tools={"manage_notes", "manage_calendar", "manage_tasks", "bash"},
|
||||
)
|
||||
|
||||
assert prompt_calls[0]["relevant_tools"] == NOTES_TOOLS
|
||||
assert prompt_calls[0]["relevant_tools"] == CALENDAR_COMPACT_TOOLS
|
||||
|
||||
|
||||
def test_agent_route_passes_workspace_to_system_prompt(monkeypatch):
|
||||
@@ -169,7 +171,7 @@ def test_agent_route_passes_workspace_to_system_prompt(monkeypatch):
|
||||
assert prompt_calls[0]["workspace"] == "/tmp/example-repo"
|
||||
|
||||
|
||||
def test_odysseus_qwen_temperature_is_capped_for_agent_requests(monkeypatch):
|
||||
def test_odysseus_compact_primary_uses_deterministic_temperature(monkeypatch):
|
||||
_, stream_calls = _install_route_probe(monkeypatch)
|
||||
|
||||
_run_probe(
|
||||
@@ -178,7 +180,7 @@ def test_odysseus_qwen_temperature_is_capped_for_agent_requests(monkeypatch):
|
||||
temperature=1.2,
|
||||
)
|
||||
|
||||
assert stream_calls[0]["temperature"] == 0.2
|
||||
assert stream_calls[0]["temperature"] == 0.0
|
||||
|
||||
|
||||
def test_qwen_fallback_candidate_gets_capped_temperature(monkeypatch):
|
||||
@@ -214,7 +216,7 @@ def test_non_qwen_fallback_keeps_requested_temperature(monkeypatch):
|
||||
fallbacks=[("https://backup.example/v1", "gpt-4o", {})],
|
||||
)
|
||||
|
||||
assert stream_calls[0]["temperature"] == 0.2
|
||||
assert stream_calls[0]["temperature"] == 0.0
|
||||
factory = stream_calls[0]["candidate_request_factory"]
|
||||
request = asyncio.run(factory(1, "https://backup.example/v1", "gpt-4o", {}))
|
||||
assert request["kwargs"]["temperature"] == 1.2
|
||||
|
||||
Reference in New Issue
Block a user