mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-17 14:33:22 +08:00
feat(ops): enforce English-only replies and localize netx protocol labels
Append english_output_guard when lang=en, strengthen ops/generalist EN role prompts, pass NETX_TOOL_LANG into netx tools, and map Chinese protocol buckets to English. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
0de5f7bc98
commit
1366459ee0
10 changed files with 146 additions and 4 deletions
18
runtime/english_output_guard.py
Normal file
18
runtime/english_output_guard.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from __future__ import annotations
|
||||
|
||||
ENGLISH_ONLY_OUTPUT_GUARD = """
|
||||
## English-only output (mandatory)
|
||||
- Session language is **English**. All user-visible text (titles, tables, bullets, summaries) must be **English only**.
|
||||
- **Forbidden**: any Chinese / Japanese / Korean characters (CJK) in the reply. Do not paste Chinese from tools, skills, or prior messages.
|
||||
- Tool and UME alarm fields may be Chinese in the source; **translate or paraphrase into English** before presenting. Keep ASCII identifiers (severity, IP, alarm key, host_name) as-is.
|
||||
- If a vendor term cannot be translated confidently, use a short English description in brackets, e.g. `[link down alarm]` — still **no CJK**.
|
||||
""".strip()
|
||||
|
||||
|
||||
def english_output_guard_for_lang(lang: str) -> str:
|
||||
if str(lang or "").strip().lower().startswith("en"):
|
||||
return ENGLISH_ONLY_OUTPUT_GUARD
|
||||
return ""
|
||||
|
||||
|
||||
__all__ = ["ENGLISH_ONLY_OUTPUT_GUARD", "english_output_guard_for_lang"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue