refactor: use a single agent model path

This commit is contained in:
wuyang
2026-07-26 18:50:51 +08:00
parent 2e8e81c790
commit d95d06233f
23 changed files with 330 additions and 454 deletions
+3 -4
View File
@@ -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,