|
| 1 | +{ |
| 2 | + "additions": 944, |
| 3 | + "author": { "id": "MDQ6VXNlcjQ5MTAzMjQ3", "is_bot": false, "login": "hannesrudolph", "name": "Hannes Rudolph" }, |
| 4 | + "baseRefName": "main", |
| 5 | + "body": "Title: feat: improve error display with collapsible UI and contextual titles\n\nSummary\n- Collapsible, copyable error UI for generic errors:\n - Regular error messages now match the diff_error UX with a toggleable header, chevrons, and copy-to-clipboard.\n - Implemented in [webview-ui/src/components/chat/ChatRow.tsx](webview-ui/src/components/chat/ChatRow.tsx).\n- Contextual error titles:\n - Optional message.title plumbed end-to-end (schema, task, UI) so errors can show specific titles (e.g., “File Not Found”).\n - Tool errors now include the tool name via formatResponse.toolError(toolName): “Tool Call Error: \u003ctool\u003e”.\n - Implemented across [packages/types/src/message.ts](packages/types/src/message.ts), [src/core/task/Task.ts](src/core/task/Task.ts), [src/core/prompts/responses.ts](src/core/prompts/responses.ts), tool files under [src/core/tools/](src/core/tools/), and [src/core/assistant-message/presentAssistantMessage.ts](src/core/assistant-message/presentAssistantMessage.ts).\n- Backward compatibility maintained:\n - formatResponse.toolError still returns the generic “Tool Execution Error” when no toolName is provided.\n - UI falls back to t(\"chat:error\") when message.title is missing.\n- Comprehensive tests added:\n - New UI test suite for error UI behaviors in [webview-ui/src/components/chat/__tests__/ChatRow.spec.tsx](webview-ui/src/components/chat/__tests__/ChatRow.spec.tsx).\n - New response formatting tests in [src/core/prompts/__tests__/responses-tool-error.spec.ts](src/core/prompts/__tests__/responses-tool-error.spec.ts).\n\nFiles modified: 20\n- Types/plumbing:\n - [packages/types/src/message.ts](packages/types/src/message.ts) (added optional title field)\n - [src/core/task/Task.ts](src/core/task/Task.ts) (propagates options.title in say())\n - [src/core/assistant-message/presentAssistantMessage.ts](src/core/assistant-message/presentAssistantMessage.ts) (contextual tool error titles)\n- Prompts/formatting:\n - [src/core/prompts/responses.ts](src/core/prompts/responses.ts) (formatResponse.toolError(error, toolName))\n - [src/core/prompts/__tests__/responses-tool-error.spec.ts](src/core/prompts/__tests__/responses-tool-error.spec.ts) (5 tests)\n- Tools (pass tool name and add contextual titles):\n - [src/core/tools/applyDiffTool.ts](src/core/tools/applyDiffTool.ts)\n - [src/core/tools/askFollowupQuestionTool.ts](src/core/tools/askFollowupQuestionTool.ts)\n - [src/core/tools/attemptCompletionTool.ts](src/core/tools/attemptCompletionTool.ts)\n - [src/core/tools/executeCommandTool.ts](src/core/tools/executeCommandTool.ts)\n - [src/core/tools/fetchInstructionsTool.ts](src/core/tools/fetchInstructionsTool.ts)\n - [src/core/tools/insertContentTool.ts](src/core/tools/insertContentTool.ts)\n - [src/core/tools/newTaskTool.ts](src/core/tools/newTaskTool.ts)\n - [src/core/tools/searchAndReplaceTool.ts](src/core/tools/searchAndReplaceTool.ts)\n - [src/core/tools/switchModeTool.ts](src/core/tools/switchModeTool.ts)\n - [src/core/tools/updateTodoListTool.ts](src/core/tools/updateTodoListTool.ts)\n - [src/core/tools/useMcpToolTool.ts](src/core/tools/useMcpToolTool.ts)\n - [src/core/tools/writeToFileTool.ts](src/core/tools/writeToFileTool.ts)\n- UI:\n - [webview-ui/src/components/chat/ChatRow.tsx](webview-ui/src/components/chat/ChatRow.tsx)\n - [webview-ui/src/components/chat/__tests__/ChatRow.spec.tsx](webview-ui/src/components/chat/__tests__/ChatRow.spec.tsx)\n\nMajor features implemented (4)\n1) Collapsible error blocks for say(\"error\") with header chevrons and copy-to-clipboard parity with diff_error.\n2) Contextual error titles (message.title) with UI fallback to i18n t(\"chat:error\").\n3) Tool error title standardization: “Tool Call Error: \u003ctool\u003e” via formatResponse.toolError(error, toolName).\n4) End-to-end wiring and tests: schema, Task.say(), assistant presenter, tools, UI, and unit tests.\n\nBackward compatibility\n- Optional message.title maintains compatibility with all existing producers/consumers.\n- formatResponse.toolError without toolName remains unchanged for legacy usage.\n- UI title fallback to i18n t(\"chat:error\") preserves prior user-visible behavior.\n\nTests and results\n- New tests:\n - UI: [ChatRow.spec.tsx](webview-ui/src/components/chat/__tests__/ChatRow.spec.tsx) covers collapse/expand, copy feedback, custom/default titles, long and multi-line errors, consistency with diff_error.\n - Formatting: [responses-tool-error.spec.ts](src/core/prompts/__tests__/responses-tool-error.spec.ts) covers default, with toolName, undefined error message, and varied tool names.\n- How to run (per workspace rules):\n - UI tests: cd webview-ui \u0026\u0026 npx vitest run src/components/chat/__tests__/ChatRow.spec.tsx\n - Core tests: cd src \u0026\u0026 npx vitest run core/prompts/__tests__/responses-tool-error.spec.ts\n- Reported outcome (per local runs during development): all newly added tests pass.\n\nVerification steps\n- Visual/UX:\n - Trigger an error message (say(\"error\", ...)) and verify:\n - Header shows warning icon, contextual title (or “Error”), copy button, and chevron.\n - Block is collapsed by default; clicking toggles expansion.\n - Expanded content renders in a code block and copy shows temporary “check” icon feedback.\n - Trigger a diff_error and confirm parity of UX.\n - Provide a custom title via Task.say options and confirm it appears in the header.\n- Tool errors:\n - Cause a known tool error (e.g., invalid line number in insertContentTool) and confirm header shows “Tool Call Error: insert_content” or a contextual title where provided (e.g., “Invalid Line Number”).\n- i18n:\n - Confirm default title uses t(\"chat:error\").\n - Note: en/chat.json currently maps diff error title to “Edit Unsuccessful” while tests expect “Diff Error” (see Known follow-ups).\n\nPerformance and security\n- Rendering is collapsed by default; no significant performance changes.\n- Error content is displayed in a code block without additional execution; no new security exposure identified.\n\nKnown follow-ups / polish\n- Styling consistency: Convert inline style objects in [ChatRow.tsx](webview-ui/src/components/chat/ChatRow.tsx) to Tailwind utility classes to match project guidelines.\n- Accessibility: Add role=\"button\", tabIndex, aria-expanded, and keyboard handlers (Enter/Space) on collapsible headers.\n- i18n consistency:\n - Align “diffError.title” between tests and locales (tests expect “Diff Error”, en locale has “Edit Unsuccessful”).\n - Consider centralizing common error titles (“File Not Found”, “Parse Error”, etc.) into i18n and using t(...) when calling Task.say.\n- CodeBlock language: Generic errors may not be XML; consider using “text” by default or auto-detecting when \u003cerror\u003e tags are present.\n- Reuse: Extract a small shared CollapsibleHeader to reduce duplication between error and diff_error render paths.\n\nBreaking changes\n- None.\n\nMigration\n- None required. Optional adoption of contextual titles is available via options.title on Task.say().\n\nChangelog entry\n- feat(webview-ui): make error messages collapsible with copy-to-clipboard and parity with diff_error\n- feat(core): add contextual tool error titles and optional message.title plumbing\n- test: add ChatRow error UI and tool error formatting test suites\n\u003c!-- ELLIPSIS_HIDDEN --\u003e\n\n\n----\n\n\u003e [!IMPORTANT]\n\u003e Enhances error display with collapsible UI, copy-to-clipboard, and contextual titles, ensuring backward compatibility and adding comprehensive tests.\n\u003e \n\u003e - **Behavior**:\n\u003e - Adds collapsible error UI in `ChatRow.tsx` with copy-to-clipboard and chevrons, similar to `diff_error`.\n\u003e - Supports contextual error titles via `message.title`, with fallback to `t(\"chat:error\")`.\n\u003e - Tool errors include tool name in title using `formatResponse.toolError(toolName)`.\n\u003e - **Files**:\n\u003e - `ChatRow.tsx`: Implements collapsible error UI.\n\u003e - `CollapsibleErrorSection.tsx`: New component for collapsible error sections.\n\u003e - `ChatRow.spec.tsx`: Adds tests for error UI behaviors.\n\u003e - **Backward Compatibility**:\n\u003e - `formatResponse.toolError` defaults to \"Tool Execution Error\" if no toolName.\n\u003e - UI defaults to `t(\"chat:error\")` if `message.title` is missing.\n\u003e - **Tests**:\n\u003e - New tests in `ChatRow.spec.tsx` for error UI, including collapse/expand, copy feedback, and title handling.\n\u003e - Tests in `responses-tool-error.spec.ts` for `formatResponse.toolError` with/without toolName.\n\u003e \n\u003e \u003csup\u003eThis description was created by \u003c/sup\u003e[\u003cimg alt=\"Ellipsis\" src=\"https://img.shields.io/badge/Ellipsis-blue?color=175173\"\u003e](https://www.ellipsis.dev?ref=RooCodeInc%2FRoo-Code\u0026utm_source=github\u0026utm_medium=referral)\u003csup\u003e for 95913bd537362bba215e7e65b21fa7b8bf74d841. You can [customize](https://app.ellipsis.dev/RooCodeInc/settings/summaries) this summary. It will automatically update as commits are pushed.\u003c/sup\u003e\n\n\n\u003c!-- ELLIPSIS_HIDDEN --\u003e", |
| 6 | + "changedFiles": 40, |
| 7 | + "createdAt": "2025-08-25T22:51:50Z", |
| 8 | + "deletions": 136, |
| 9 | + "files": [ |
| 10 | + { "additions": 1, "deletions": 0, "path": "packages/types/src/message.ts" }, |
| 11 | + { "additions": 8, "deletions": 2, "path": "src/core/assistant-message/presentAssistantMessage.ts" }, |
| 12 | + { "additions": 51, "deletions": 0, "path": "src/core/prompts/__tests__/responses-tool-error.spec.ts" }, |
| 13 | + { "additions": 4, "deletions": 1, "path": "src/core/prompts/responses.ts" }, |
| 14 | + { "additions": 15, "deletions": 1, "path": "src/core/task/Task.ts" }, |
| 15 | + { "additions": 9, "deletions": 1, "path": "src/core/tools/__tests__/insertContentTool.spec.ts" }, |
| 16 | + { "additions": 18, "deletions": 3, "path": "src/core/tools/__tests__/useMcpToolTool.spec.ts" }, |
| 17 | + { "additions": 5, "deletions": 2, "path": "src/core/tools/applyDiffTool.ts" }, |
| 18 | + { "additions": 10, "deletions": 2, "path": "src/core/tools/askFollowupQuestionTool.ts" }, |
| 19 | + { "additions": 1, "deletions": 0, "path": "src/core/tools/attemptCompletionTool.ts" }, |
| 20 | + { "additions": 15, "deletions": 2, "path": "src/core/tools/executeCommandTool.ts" }, |
| 21 | + { "additions": 1, "deletions": 1, "path": "src/core/tools/fetchInstructionsTool.ts" }, |
| 22 | + { "additions": 7, "deletions": 3, "path": "src/core/tools/insertContentTool.ts" }, |
| 23 | + { "additions": 5, "deletions": 3, "path": "src/core/tools/newTaskTool.ts" }, |
| 24 | + { "additions": 7, "deletions": 3, "path": "src/core/tools/searchAndReplaceTool.ts" }, |
| 25 | + { "additions": 1, "deletions": 1, "path": "src/core/tools/switchModeTool.ts" }, |
| 26 | + { "additions": 7, "deletions": 2, "path": "src/core/tools/updateTodoListTool.ts" }, |
| 27 | + { "additions": 10, "deletions": 1, "path": "src/core/tools/useMcpToolTool.ts" }, |
| 28 | + { "additions": 4, "deletions": 1, "path": "src/core/tools/writeToFileTool.ts" }, |
| 29 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/ca/tools.json" }, |
| 30 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/de/tools.json" }, |
| 31 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/en/tools.json" }, |
| 32 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/es/tools.json" }, |
| 33 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/fr/tools.json" }, |
| 34 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/hi/tools.json" }, |
| 35 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/id/tools.json" }, |
| 36 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/it/tools.json" }, |
| 37 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/ja/tools.json" }, |
| 38 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/ko/tools.json" }, |
| 39 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/nl/tools.json" }, |
| 40 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/pl/tools.json" }, |
| 41 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/pt-BR/tools.json" }, |
| 42 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/ru/tools.json" }, |
| 43 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/tr/tools.json" }, |
| 44 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/vi/tools.json" }, |
| 45 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/zh-CN/tools.json" }, |
| 46 | + { "additions": 12, "deletions": 0, "path": "src/i18n/locales/zh-TW/tools.json" }, |
| 47 | + { "additions": 19, "deletions": 107, "path": "webview-ui/src/components/chat/ChatRow.tsx" }, |
| 48 | + { "additions": 73, "deletions": 0, "path": "webview-ui/src/components/chat/CollapsibleErrorSection.tsx" }, |
| 49 | + { "additions": 457, "deletions": 0, "path": "webview-ui/src/components/chat/__tests__/ChatRow.spec.tsx" } |
| 50 | + ], |
| 51 | + "headRefName": "feat/error-display-improvements", |
| 52 | + "headRefOid": "95913bd537362bba215e7e65b21fa7b8bf74d841", |
| 53 | + "isDraft": false, |
| 54 | + "mergeable": "MERGEABLE", |
| 55 | + "number": 7401, |
| 56 | + "state": "OPEN", |
| 57 | + "title": "feat: improve error display with collapsible UI and contextual titles", |
| 58 | + "updatedAt": "2025-08-26T00:02:55Z", |
| 59 | + "url": "https://github.com/RooCodeInc/Roo-Code/pull/7401" |
| 60 | +} |
0 commit comments