feat(i18n) Internationalize hardcoded status messages in run_agent.py - #21639
feat(i18n) Internationalize hardcoded status messages in run_agent.py#21639loongfay wants to merge 1 commit into
Conversation
|
waiting |
|
Thanks for the careful work on this — the implementation is clean (32 keys × 8 locales kept in sync, all Closing as out of scope, though — not because the change is wrong but because Hermes' i18n layer is intentionally a thin slice. The current scope policy is documented in
And Teknium's foundation PR #20231 (which set the i18n layer up) is explicit about why
The If you'd like agent telemetry in another language end-to-end, the supported path is to ask the agent to respond in your language in your prompt — the model controls the response language directly, which is more natural than catalogging every internal status string. Thanks again for the contribution and for the clean implementation work — closing as out of scope rather than as a quality issue. |
okay, got it. |
🌐 Internationalize hardcoded status messages in
run_agent.pySummary
All
_emit_status()calls inrun_agent.pypreviously used hardcoded English strings for runtime status messages (e.g. connection drops, retries, fallback switches). This made the agent output English-only even when the user's locale was set to another language like Chinese.Changes
from agent.i18n import timport torun_agent.py_emit_status(...)calls witht("status.xxx", ...)using the project's existing i18n frameworkstatus:section in all 8 locale files (locales/{en,zh,ja,de,es,fr,tr,uk}.yaml)Translation keys added
no_response_streaming,no_response_nonstreaming,connection_dropped_toolcall,connection_dropped,reconnected,connection_failed,switching_fallback,stale_connections_cleaned,preflight_compression,context_reduced,rate_limited_fallback,empty_response_fallback,max_retries_fallback,max_retries_failed,payload_too_large,context_too_large,compressed_retrying,non_retryable_error_fallback,non_retryable_error,max_retries_exhausted_fallback,rate_limited_final,api_failed_final,rate_limited_waiting,retrying,guardrail_halted,stream_interrupted_using_content,empty_after_tools_using_prior,empty_after_tools_nudging,thinking_only_prefilling,empty_response_retrying,empty_response_switching_fallback,switched_to_fallbackExample
Files modified
run_agent.pylocales/en.yamllocales/zh.yamllocales/ja.yamllocales/de.yamllocales/es.yamllocales/fr.yamllocales/tr.yamllocales/uk.yamlVerification
run_agent.pypassesast.parsesyntax check