fix: explain run failures in Chinese and English instead of raw codes

Several codes that end an Agent turn or a whole run had no translation,
so the timeline showed a generic error or the raw code (for example
LOCAL_RUN_PERSIST_FAILED), and users could not tell why a discussion
stopped. The round-limit notice also claimed "no consensus" although
natural discussions have no consensus step.

- Map access-denied, session-invalid, output-limit, send-failed,
  refused, permission race, version/capability/protocol mismatch,
  task-decision and receipt errors, context overflow, persistence
  failures and the circuit breaker to zh/en messages.
- The round-limit notice now says the latest replies are the current
  result and how to continue (backend fallback text updated too).

Checks: npm --prefix frontend test (325 pass); updated assertions that
expected the raw code and the old round-limit wording.
This commit is contained in:
Ryder Sun committed 2026-10-15 17:40:04 +08:00
1 parent 35ed0d4e4a
commit 5fc70afde9
6 files changed
+46 -7

No files matched your search

@@ -4979,7 +4979,7 @@ class LocalWorkspaceAutoRunner {
this.addMessage(
group.id,
'system',
`Automatic discussion reached the ${controller.maxRounds || 6}-round safety limit without consensus.`,
`Automatic discussion reached its ${controller.maxRounds || 6}-round limit. The latest replies above are the current result.`,
'',
threadRootId,
{ key: 'system.autoRoundLimit', params: { rounds: controller.maxRounds || 6 } },
@@ -5874,7 +5874,7 @@ class LocalWorkspaceAutoRunner {
this.addMessage(
group.id,
'system',
`Automatic discussion reached the ${maxRounds}-round safety limit without consensus.`,
`Automatic discussion reached its ${maxRounds}-round limit. The latest replies above are the current result.`,
'',
threadRootId,
{ key: 'system.autoRoundLimit', params: { rounds: maxRounds } },
@@ -68,7 +68,7 @@ describe('Meldwork workbench', () => {
expect(panel.text()).toContain(status === 'completed' ? '· Completed' : '· Partially completed')
expect(panel.find('.solo-run-status').exists()).toBe(false)
expect(wrapper.get('.turn-rail button').attributes('data-status')).toBe(status)
expect(wrapper.text()).toContain('LOCAL_RUN_PERSIST_FAILED')
expect(wrapper.text()).toContain('Meldwork could not save this run')
setLocale('zh')
await flushPromises()
expect(panel.text()).toContain(status === 'completed' ? '已完成' : '部分完成')
+2 -2
View File
@@ -191,14 +191,14 @@ describe('Meldwork i18n', () => {
setLocale('en')
expect(translateSystemMessage(roundLimit))
.toBe('Automatic discussion reached the 3-round limit without reaching consensus.')
.toBe('Automatic discussion reached its 3-round limit. The latest replies above are the current result; raise the round limit or send a follow-up to continue.')
expect(translateSystemMessage(timeout))
.toBe('Automatic discussion stopped after a runtime timeout before consensus.')
expect(translateSystemMessage(timeout)).not.toContain('30')
expect(translateSystemMessage(unknown)).toBe(unknown.content)
setLocale('zh')
expect(translateSystemMessage(roundLimit)).toBe('自动讨论已达到 3 轮上限,尚未达成共识。')
expect(translateSystemMessage(roundLimit)).toBe('自动讨论已达到 3 轮上限,以上最新回复即为当前结果;如需继续,可调高轮数上限或追加消息。')
expect(translateSystemMessage(timeout)).toBe('自动讨论在达成共识前因运行超时而停止。')
expect(translateSystemMessage(timeout)).not.toContain('30')
expect(translateSystemMessage(unknown)).toBe(unknown.content)
+17
View File
@@ -90,6 +90,23 @@ export const DESKTOP_ERROR_MESSAGE_KEYS = Object.freeze({
CODEX_SANDBOX_UNSUPPORTED: 'error.codexSandboxUnsupported',
LOCAL_AGENT_KIND_UNSUPPORTED: 'error.agentKindUnsupported',
LOCAL_AGENT_AUTH_REQUIRED: 'error.agentAuthRequired',
LOCAL_AGENT_ACCESS_DENIED: 'error.agentAccessDenied',
LOCAL_AGENT_SESSION_INVALID: 'error.agentSessionInvalid',
LOCAL_AGENT_OUTPUT_LIMIT: 'error.agentOutputLimit',
LOCAL_AGENT_SEND_FAILED: 'error.agentSendFailed',
LOCAL_AGENT_REFUSED: 'error.agentRefused',
LOCAL_AGENT_PERMISSION_TERMINAL_RACE: 'error.agentPermissionRace',
LOCAL_AGENT_VERSION_UNSUPPORTED: 'agent.incompatibleVersion',
LOCAL_AGENT_REQUIRED_CAPABILITY_MISSING: 'agent.incompatibleCapability',
LOCAL_AGENT_PROTOCOL_UNAVAILABLE: 'agent.incompatibleProtocol',
LOCAL_RUN_TASK_DECISION_INVALID: 'error.taskDecisionInvalid',
LOCAL_RUN_COLLABORATION_RECEIPT_INVALID: 'error.collaborationReceiptInvalid',
LOCAL_RUN_COLLABORATION_RECEIPT_REQUIRED: 'error.collaborationReceiptInvalid',
LOCAL_RUN_COLLABORATION_RECEIPT_MISMATCH: 'error.collaborationReceiptInvalid',
LOCAL_RUN_REQUIRED_CONTEXT_OVERFLOW: 'error.contextOverflow',
LOCAL_RUN_PERSIST_FAILED: 'error.runPersistFailed',
LOCAL_RUN_TERMINAL_PERSIST_FAILED: 'error.runPersistFailed',
LOCAL_RUN_CIRCUIT_BREAKER: 'error.runCircuitBreaker',
LOCAL_AGENT_PROCESS_FAILED: 'error.agentProcessFailed',
LOCAL_AGENT_EXITED: 'error.agentExited',
LOCAL_AGENT_EMPTY_RESPONSE: 'error.agentEmptyResponse',
+12 -1
View File
@@ -688,7 +688,7 @@ export default {
'system.agentInterrupted': '{agent} was interrupted when Meldwork restarted.',
'system.autoStopped': 'Automatic discussion stopped: {reason}',
'system.autoDiscussionStalled': 'Automatic discussion stopped because repeated handoffs produced no new contribution.',
'system.autoRoundLimit': 'Automatic discussion reached the {rounds}-round limit without reaching consensus.',
'system.autoRoundLimit': 'Automatic discussion reached its {rounds}-round limit. The latest replies above are the current result; raise the round limit or send a follow-up to continue.',
'system.autoCrossReview': 'The delivery owner signaled completion before peer discussion; one cross-review round runs first.',
'system.autoTaskDecisionMissing': 'Discussion stopped without a valid task completion decision.',
'system.autoTaskBlocked': 'Task blocked: {reason}',
@@ -747,6 +747,17 @@ export default {
'error.cliWrapperUnsupported': 'This Agent launcher is not supported.',
'error.codexSandboxUnsupported': 'The requested Codex permission mode is not supported.',
'error.agentKindUnsupported': 'This local Agent type is not supported.',
'error.agentAccessDenied': 'The model provider refused the request (for example HTTP 403, a proxy, or a region block). Meldwork retried once; check the Agent\'s network or account permissions.',
'error.agentSessionInvalid': 'This Agent\'s saved session could not be continued. Meldwork started a fresh session with the recent conversation; send the message again if it did not recover.',
'error.agentOutputLimit': 'This Agent produced more output than one reply can hold. Ask for a shorter answer or for the result to be written to a file.',
'error.agentSendFailed': 'The Agent process closed before it received the request. Check that the CLI still starts in a terminal, then try again.',
'error.agentRefused': 'The Agent declined this request.',
'error.agentPermissionRace': 'The Agent finished while a permission request was still open. Try again.',
'error.taskDecisionInvalid': 'The Agent\'s collaboration receipt could not be read, so its task decision was ignored.',
'error.collaborationReceiptInvalid': 'The Agent replied without a readable collaboration receipt.',
'error.contextOverflow': 'The current request is too long to send to the Agent. Shorten it or attach the content as a file.',
'error.runPersistFailed': 'Meldwork could not save this run. Check free disk space, then try again.',
'error.runCircuitBreaker': 'This run stopped after too many failed attempts.',
'error.agentAuthRequired': 'Sign in to this Agent or configure its credentials, then try again.',
'error.agentProcessFailed': 'The Agent process failed before completing the task.',
'error.customAgentLimit': 'You can connect up to 32 custom Agents.',
+12 -1
View File
@@ -688,7 +688,7 @@ export default {
'system.agentInterrupted': 'Meldwork 重启时,{agent} 的运行已中断。',
'system.autoStopped': '自动讨论已停止:{reason}',
'system.autoDiscussionStalled': '自动讨论因重复转交且没有新增内容而停止。',
'system.autoRoundLimit': '自动讨论已达到 {rounds} 轮上限,尚未达成共识。',
'system.autoRoundLimit': '自动讨论已达到 {rounds} 轮上限,以上最新回复即为当前结果;如需继续,可调高轮数上限或追加消息。',
'system.autoCrossReview': '交付负责人在同伴讨论前判断任务完成;将先进行一轮交叉审查。',
'system.autoTaskDecisionMissing': '讨论已停止,尚无有效的任务完成判断。',
'system.autoTaskBlocked': '任务受阻:{reason}',
@@ -747,6 +747,17 @@ export default {
'error.cliWrapperUnsupported': '当前不支持该 Agent 启动程序。',
'error.codexSandboxUnsupported': '当前不支持所请求的 Codex 权限模式。',
'error.agentKindUnsupported': '当前不支持该本地 Agent 类型。',
'error.agentAccessDenied': '模型服务商拒绝了请求(例如 HTTP 403、代理或地区限制)。Meldwork 已自动重试一次,请检查该 Agent 的网络或账号权限。',
'error.agentSessionInvalid': '无法继续该 Agent 已保存的会话。Meldwork 已用最近的对话重新建立会话;如仍未恢复,请重新发送消息。',
'error.agentOutputLimit': '该 Agent 的输出超过了单条回复的上限。请让它精简回答,或把结果写入文件。',
'error.agentSendFailed': 'Agent 进程在收到请求前就退出了。请确认该 CLI 能在终端正常启动后再试。',
'error.agentRefused': '该 Agent 拒绝了这个请求。',
'error.agentPermissionRace': 'Agent 在权限请求尚未处理时就结束了,请重试。',
'error.taskDecisionInvalid': '无法读取该 Agent 的协作回执,它的任务判断已被忽略。',
'error.collaborationReceiptInvalid': '该 Agent 的回复缺少可读取的协作回执。',
'error.contextOverflow': '当前请求过长,无法发送给 Agent。请精简内容,或改为以附件形式提供。',
'error.runPersistFailed': 'Meldwork 无法保存本次运行,请检查磁盘空间后重试。',
'error.runCircuitBreaker': '失败次数过多,本次运行已停止。',
'error.agentAuthRequired': '请先登录该 Agent 或完成凭据配置后再试。',
'error.agentProcessFailed': 'Agent 进程在任务完成前执行失败。',
'error.customAgentLimit': '最多可接入 32 个自定义 Agent。',