Skip to content

fix(conversation): show command exit codes in timeline failures - #99

Merged
DimoADE merged 1 commit into
DimoADE:masterfrom
ArthurKing0629:fix/terminal-command-failure-diagnostics
Nov 18, 2026
Merged

DimoADE merged 1 commit into
DimoADE:masterfrom
ArthurKing0629:fix/terminal-command-failure-diagnostics

Conversation

@ArthurKing0629

@ArthurKing0629 ArthurKing0629 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When a terminal command reports a nonzero exit code, the collapsed conversation row currently says only “工具调用失败”. If the tool transport reports completed, the row can even appear successful while the expanded terminal reports a nonzero exit.

 TurnActivity → TurnToolChipRow
- failed tool → Tool call failed
- completed tool + exit 1 → complete
+ reported nonzero command exit → Command exited with code N (error)
+ failed tool without a nonzero code → Tool call failed

Use the existing structured command result for the timeline status and localized error summary. Preserve background handoff behavior, expandable command/stdout/stderr details, and generic fallback for unknown failures. Add Chinese/English strings and tabular numerals to the existing error label.

Refs #98 (partial fix). The exact command in the original collapsed screenshot remains unidentified. This fixes the reproduced presentation defect, not the underlying failing commands. Permission/timeout reason propagation remains open: toolBlockToNormalizedEntry currently reduces timeline statuses to created/success/failed, so this change deliberately does not guess causes from output text.

Evidence

  • Before: the real TurnActivity regression suite produced 3 failed / 4 passed: numeric exit summaries were missing in Chinese and English, and a completed transport with exit 1 used the wrong summary state. The DOM contained the same generic error badge as the report.
    After: 4 test files / 89 tests passed, including all 7 new regression cases. After correcting the test fixture timestamp type, the 7 new cases passed again.
  • The regression renders real block pairing, normalization, activity aggregation, chip rows, and expanded terminal details. Only unrelated configuration/panel hooks and text rendering are mocked.
  • Targeted ESLint, Prettier and git diff --check pass.
  • Full frontend tsc --noEmit --pretty false passes after hydrating the sparse checkout's example workflows and plugin declaration files from the pinned base commit.
  • Validation command (from frontend, Node 22.22.3): pnpm exec vitest run src/components/NormalizedConversation/TurnActivity.test.tsx src/components/NormalizedConversation/tools/ToolCards.test.tsx src/components/NormalizedConversation/TurnToolChips.test.tsx src/components/NormalizedConversation/messageTurnTool.test.ts --maxWorkers=1 --minWorkers=1.

Merge Danger

Door: two-way

Frontend-only and reversible; no schema, dependency, execution, credential, or permission changes.

Blast Radius: conversation

Terminal commands with nonzero structured exit codes now remain visible as errors even when the tool transport says completed. No desktop package was built or installed; visual layout has component DOM coverage, not a native screenshot check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants