mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 07:13:17 +08:00
Make WhatsApp ops English-first for field deployments.
Default progress, quote wrappers, tool-error copy, and playbook recipes to English unless lang is explicitly zh. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
0ab5ab8c5a
commit
47fd83597e
11 changed files with 130 additions and 88 deletions
|
|
@ -27,23 +27,23 @@ def format_unregistered_tool_error(
|
|||
tool_name: str,
|
||||
available: Iterable[str],
|
||||
*,
|
||||
lang: str = "zh",
|
||||
lang: str = "en",
|
||||
) -> dict[str, Any]:
|
||||
suggestions = suggest_tool_names(tool_name, available)
|
||||
if str(lang or "").startswith("en"):
|
||||
err = f"Unregistered tool: {tool_name}"
|
||||
hint = (
|
||||
"Use one of suggestions, or refresh MCP tools for this specialist."
|
||||
if suggestions
|
||||
else "Tool is not in the current registry; check MCP enablement / specialist binding."
|
||||
)
|
||||
else:
|
||||
if str(lang or "").startswith("zh"):
|
||||
err = f"未注册的工具: {tool_name}"
|
||||
hint = (
|
||||
"请改用 suggestions 中的工具名,或检查该专家的 MCP 绑定/启用状态。"
|
||||
if suggestions
|
||||
else "当前工具目录中无此工具;请检查 MCP 是否启用及专家绑定。"
|
||||
)
|
||||
else:
|
||||
err = f"Unregistered tool: {tool_name}"
|
||||
hint = (
|
||||
"Use one of suggestions, or refresh MCP tools for this specialist."
|
||||
if suggestions
|
||||
else "Tool is not in the current registry; check MCP enablement / specialist binding."
|
||||
)
|
||||
out: dict[str, Any] = {
|
||||
"ok": False,
|
||||
"error_code": "tool_not_registered",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue