mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-07 05:32:20 +01:00
Squash Odysseus development history
This commit is contained in:
@@ -13,6 +13,7 @@ def test_calendar_imperative_variants_promote_to_agent():
|
||||
assert message_needs_tools("schedule a call with Mina next Friday")
|
||||
assert message_needs_tools("put dentist appointment on my calendar")
|
||||
assert message_needs_tools("Alright. Recreate that same appointment")
|
||||
assert message_needs_tools("delete that actually")
|
||||
assert message_needs_tools("Okay delete that doctor appointment from the calendar")
|
||||
assert message_needs_tools("have another go at adding a test entry to the calendar")
|
||||
assert message_needs_tools(
|
||||
@@ -56,12 +57,25 @@ def test_explicit_web_search_promotes_to_agent():
|
||||
assert classify_tool_intent("use web search and find a recipe").category == "web"
|
||||
|
||||
|
||||
def test_chinese_web_lookup_requests_route_to_web_tools():
|
||||
intent = classify_tool_intent("帮我查一下这些店铺的地址,我要去打卡")
|
||||
|
||||
assert intent.needs_tools
|
||||
assert intent.category == "web"
|
||||
|
||||
|
||||
def test_nearest_place_lookup_promotes_to_web_agent():
|
||||
intent = classify_tool_intent("from vasaplan stockholm where is closest parking")
|
||||
assert intent.needs_tools
|
||||
assert intent.category == "web"
|
||||
|
||||
|
||||
def test_workspace_agent_requests_promote_to_shell_workspace():
|
||||
prompts = [
|
||||
"fix the bug in this repo",
|
||||
"run the tests for this project",
|
||||
"debug the server logs",
|
||||
"run terminal-bench on this task",
|
||||
"run a performance benchmark on this project",
|
||||
"inspect the traceback and patch the code",
|
||||
]
|
||||
for prompt in prompts:
|
||||
@@ -70,6 +84,61 @@ def test_workspace_agent_requests_promote_to_shell_workspace():
|
||||
assert intent.category == "workspace"
|
||||
|
||||
|
||||
def test_page_references_are_not_mistaken_for_named_computers():
|
||||
for prompt in (
|
||||
"What heading is visible on that page?",
|
||||
"Read it from the current page.",
|
||||
"Compare this with the same page.",
|
||||
):
|
||||
intent = classify_tool_intent(prompt)
|
||||
assert intent.category != "workspace"
|
||||
|
||||
intent = classify_tool_intent("check the service on odysseus")
|
||||
assert intent.needs_tools and intent.category == "workspace"
|
||||
|
||||
|
||||
def test_direct_code_requests_promote_to_workspace_agent():
|
||||
prompts = [
|
||||
"write a Python function that parses CSV",
|
||||
"write answer.json",
|
||||
"create app.ts",
|
||||
"edit src/app.py",
|
||||
"Can you create a script in this project?",
|
||||
"edit the React component to show a loading state",
|
||||
"I want you to build a small command-line tool",
|
||||
"Can you code this in the repo?",
|
||||
]
|
||||
for prompt in prompts:
|
||||
intent = classify_tool_intent(prompt)
|
||||
assert intent.needs_tools
|
||||
assert intent.category == "workspace"
|
||||
|
||||
|
||||
def test_code_explanations_stay_plain_chat():
|
||||
assert not message_needs_tools("How do I write a Python function?")
|
||||
assert not message_needs_tools("Can you explain how a React component works?")
|
||||
|
||||
|
||||
def test_shell_diagnostic_commands_promote_to_agent():
|
||||
prompts = [
|
||||
"lsblk",
|
||||
"run lsblk",
|
||||
"df -h",
|
||||
"docker ps",
|
||||
"nvidia-smi",
|
||||
"can you run journalctl -u odysseus",
|
||||
]
|
||||
for prompt in prompts:
|
||||
intent = classify_tool_intent(prompt)
|
||||
assert intent.needs_tools
|
||||
assert intent.category in {"shell", "workspace"}
|
||||
|
||||
|
||||
def test_shell_command_explanations_stay_plain_chat():
|
||||
assert not message_needs_tools("How do I use lsblk?")
|
||||
assert not message_needs_tools("Can you explain docker ps?")
|
||||
|
||||
|
||||
def test_explanatory_calendar_questions_stay_plain_chat():
|
||||
assert not message_needs_tools("How do I add an entry to my calendar?")
|
||||
assert not message_needs_tools("What about the built-in Odysseus calendar, is that linked to email?")
|
||||
|
||||
Reference in New Issue
Block a user