mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-14 07:09:20 +00:00
fix(teacher): import _TEACHER_SYSTEM_PROMPT from its current module (#5756)
* fix(teacher): import teacher prompt from current module * test(teacher): make prompt monkeypatch import-order independent --------- Co-authored-by: Alexandre Teixeira <alexandremagteixeira@gmail.com>
This commit is contained in:
parent
e7eddbae13
commit
17ee856d1c
2 changed files with 11 additions and 2 deletions
|
|
@ -233,7 +233,8 @@ async def _call_teacher(teacher_model_spec: str, prompt: str,
|
|||
owner: Optional[str] = None) -> Optional[str]:
|
||||
"""Call the configured teacher endpoint with the escalation prompt."""
|
||||
from src.llm_core import llm_call_async
|
||||
from src.ai_interaction import _resolve_model, _TEACHER_SYSTEM_PROMPT
|
||||
from src.ai_interaction import _resolve_model
|
||||
from src.agent_tools.model_interaction_tools import _TEACHER_SYSTEM_PROMPT
|
||||
try:
|
||||
url, model, headers = await asyncio.to_thread(_resolve_model, teacher_model_spec, owner=owner)
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -21,10 +21,17 @@ def test_call_teacher_scopes_model_resolution_to_owner(monkeypatch):
|
|||
return ("http://endpoint.local/v1", "teacher-model", {})
|
||||
|
||||
async def fake_llm_call_async(url, model, messages, **kwargs):
|
||||
seen["messages"] = messages
|
||||
return "teacher reply"
|
||||
|
||||
from src.agent_tools import model_interaction_tools
|
||||
|
||||
monkeypatch.setattr("src.ai_interaction._resolve_model", fake_resolve_model)
|
||||
monkeypatch.setattr("src.ai_interaction._TEACHER_SYSTEM_PROMPT", "sys", raising=False)
|
||||
monkeypatch.setattr(
|
||||
model_interaction_tools,
|
||||
"_TEACHER_SYSTEM_PROMPT",
|
||||
"sys",
|
||||
)
|
||||
monkeypatch.setattr("src.llm_core.llm_call_async", fake_llm_call_async)
|
||||
|
||||
result = asyncio.run(
|
||||
|
|
@ -34,6 +41,7 @@ def test_call_teacher_scopes_model_resolution_to_owner(monkeypatch):
|
|||
assert result == "teacher reply"
|
||||
assert seen["owner"] == "alice"
|
||||
assert seen["spec"] == "teacher-model"
|
||||
assert seen["messages"][0] == {"role": "system", "content": "sys"}
|
||||
|
||||
|
||||
def test_audit_teacher_resolution_scoped_to_owner(monkeypatch):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue