refactor: use a single agent model path
This commit is contained in:
@@ -69,12 +69,11 @@ class StubHandler(BaseHTTPRequestHandler):
|
||||
available_names = {
|
||||
str((tool.get("function") or {}).get("name", "")) for tool in tools if isinstance(tool, dict)
|
||||
}
|
||||
is_work = "update_plan" in available_names
|
||||
is_agent = "update_plan" in available_names
|
||||
|
||||
if tools and not has_tool_result:
|
||||
path = "work-proof.txt" if is_work else "chat-proof.txt"
|
||||
arguments = json.dumps(
|
||||
{"path": path, "content": _last_user_text(messages) or "e2e"},
|
||||
{"path": "work-proof.txt", "content": _last_user_text(messages) or "e2e"},
|
||||
ensure_ascii=False,
|
||||
)
|
||||
message = {
|
||||
@@ -91,7 +90,7 @@ class StubHandler(BaseHTTPRequestHandler):
|
||||
self._respond(payload, _completion(model, message, "tool_calls"))
|
||||
return
|
||||
|
||||
if is_work and "write_file" in called_tools and "read_file" not in called_tools:
|
||||
if is_agent and "write_file" in called_tools and "read_file" not in called_tools:
|
||||
message = {
|
||||
"role": "assistant",
|
||||
"content": None,
|
||||
|
||||
Reference in New Issue
Block a user