feat: update style for oss of the failed task in the task panel#1647
Conversation
WalkthroughThis PR refactors task failure handling across the frontend to distinguish "total failure" (all files failed) from partial failure. It introduces utility helpers for counting successful/failed files, adds error display normalization, updates task completion analytics based on failure classification, refactors task error content UI with controlled accordion state and per-file error cards, and synchronizes notification menu rendering with the new failure states via icon and badge updates. ChangesTask Failure State Detection and Handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
frontend/tests/core/tasks-unified-panel.spec.ts (1)
80-94: 💤 Low valueConsider renaming the helper to reflect its conditional behavior.
The
expandFirstFailureAccordionhelper now returns early if the expected error text is already visible, without actually expanding the accordion. While this is a reasonable optimization, the function name implies it will always perform the expansion action.Suggested name alternatives
Consider renaming to better reflect the conditional behavior:
ensureFailureErrorVisiblerevealFailureErrorshowFirstFailureErrorOr add a comment explaining the early-return optimization.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/tests/core/tasks-unified-panel.spec.ts` around lines 80 - 94, The helper expandFirstFailureAccordion returns early when expectedError is already visible, so rename it to a name that reflects this conditional behavior (e.g., ensureFailureErrorVisible or revealFailureError) and update all call sites to use the new name; alternatively add a short doc comment above the function explaining that it only expands the accordion if the expected error text is not already visible. Ensure the function signature (expandFirstFailureAccordion(page: Page, expectedError?: string)) and the role-button selector behavior remain unchanged so callers keep the same parameters and behavior.frontend/components/task-error-content.tsx (1)
99-101: ⚡ Quick winSimplify the accordion value change handler.
The conditional logic in
onValueChangeis redundant. Radix Accordion withcollapsiblealready returns an empty string when toggling a currently-open item closed. You can pass the setter directly.♻️ Simplified implementation
- onValueChange={(value) => - setAccordionValue(value === "failed-files" ? "failed-files" : "") - } + onValueChange={setAccordionValue}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/components/task-error-content.tsx` around lines 99 - 101, The inline conditional in the Accordion's onValueChange is redundant; update the handler to call setAccordionValue directly (replace the arrow function that tests value === "failed-files" with just setAccordionValue) so the Accordion's native collapsible behavior (returning "" when closed) is preserved; this change should be made where onValueChange is defined for the Accordion component and references setAccordionValue.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/components/task-error-content.tsx`:
- Around line 112-123: The "Report incident" button currently only stops
propagation but provides no reporting behavior; update the onClick handler for
the button in TaskErrorContent (the button rendering the IncidentReporter icon)
to call a real reporting action instead of just preventing default: either call
a new function like openIncidentModal(taskId) or reportIncident({ taskId,
errorSummary }) that you implement (or dispatch a Redux/Context action) and then
show user feedback (e.g., showToast or a success/error state) while still
calling event.preventDefault()/stopPropagation(); if the incident feature isn’t
ready, hide the button or render null for the IncidentReporter to avoid
confusing users. Ensure the handler references the task identifier available in
the component props/state and keep the onPointerDown stopPropagation behavior to
prevent accordion toggling.
In `@frontend/contexts/task-context.tsx`:
- Around line 336-337: currentTask.failed_files falls back to 0 causing
isTotalFailure to be wrong when the backend omits that field; change the logic
that sets failedFiles in the task context to use currentTask.failed_files if
it's a number, otherwise derive it from currentTask.files by counting file
entries that indicate failure (e.g., file.status === 'failed' or file.success
=== false), then compute isTotalFailure (failedFiles > 0 && successfulFiles ===
0) using that derived value; update the code around currentTask, failedFiles,
successfulFiles, and isTotalFailure accordingly.
In `@frontend/package.json`:
- Line 20: Package entry for `@carbon/icons-react`@11.81.0 is valid (latest
published) and has no reported vulnerabilities; keep the dependency and version
in frontend/package.json but reassess the consolidation rationale: inspect
usages of ErrorFilled and IncidentReporter in
frontend/components/task-notification-menu.tsx and
frontend/components/task-error-content.tsx and evaluate whether equivalent icons
exist in lucide-react (used elsewhere for AlertTriangle, X, etc.); if
lucide-react provides suitable equivalents, replace the imports/usages in those
components and remove `@carbon/icons-react`, otherwise retain `@carbon/icons-react`
to avoid breaking the two components.
---
Nitpick comments:
In `@frontend/components/task-error-content.tsx`:
- Around line 99-101: The inline conditional in the Accordion's onValueChange is
redundant; update the handler to call setAccordionValue directly (replace the
arrow function that tests value === "failed-files" with just setAccordionValue)
so the Accordion's native collapsible behavior (returning "" when closed) is
preserved; this change should be made where onValueChange is defined for the
Accordion component and references setAccordionValue.
In `@frontend/tests/core/tasks-unified-panel.spec.ts`:
- Around line 80-94: The helper expandFirstFailureAccordion returns early when
expectedError is already visible, so rename it to a name that reflects this
conditional behavior (e.g., ensureFailureErrorVisible or revealFailureError) and
update all call sites to use the new name; alternatively add a short doc comment
above the function explaining that it only expands the accordion if the expected
error text is not already visible. Ensure the function signature
(expandFirstFailureAccordion(page: Page, expectedError?: string)) and the
role-button selector behavior remain unchanged so callers keep the same
parameters and behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8c9cfc18-b246-43be-90a0-e71e83b26711
⛔ Files ignored due to path filters (1)
frontend/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (9)
frontend/components/task-collapsible-section.tsxfrontend/components/task-error-content.tsxfrontend/components/task-notification-menu.tsxfrontend/components/tasks_details.tsxfrontend/contexts/task-context.tsxfrontend/lib/task-utils.tsfrontend/package.jsonfrontend/tailwind.config.tsfrontend/tests/core/tasks-unified-panel.spec.ts
…fallbacks of isTotalFailure
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/components/icons/incident-reporter-icon.tsx (1)
17-17: 💤 Low valueConsider explicit
aria-hidden="true"for clarity.While
aria-hidden(boolean shorthand) is valid JSX and works correctly, ARIA attributes conventionally use explicit string values since both"true"and"false"are semantically meaningful.🎨 Suggested refinement
- aria-hidden + aria-hidden="true"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/components/icons/incident-reporter-icon.tsx` at line 17, The JSX uses the boolean shorthand aria-hidden; update the IncidentReporterIcon (or the component containing the SVG/element with aria-hidden) to use the explicit string value aria-hidden="true" (or "false" if applicable) instead of the shorthand, so replace aria-hidden with aria-hidden="true" on the SVG/element to make the ARIA intent explicit.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@frontend/components/icons/incident-reporter-icon.tsx`:
- Line 17: The JSX uses the boolean shorthand aria-hidden; update the
IncidentReporterIcon (or the component containing the SVG/element with
aria-hidden) to use the explicit string value aria-hidden="true" (or "false" if
applicable) instead of the shorthand, so replace aria-hidden with
aria-hidden="true" on the SVG/element to make the ARIA intent explicit.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b5e57c1a-1ca8-46b4-bfd3-54ab30aa4326
📒 Files selected for processing (1)
frontend/components/icons/incident-reporter-icon.tsx
* update style for oss of the failed task in the task panel * keep logic on click, remove unecessary useeffect * fix padding * wip implementing Saas style * utils to reshape error until backend provide info we need * utils to reshape error until backend provide info we need * utils to reshape error until backend provide info we need and fixinf fallbacks of isTotalFailure * utils to reshape error until backend provide into * have Saas style for failed and complete labelstatus and width and border * few style adjustment to follow codebase pattern * adjust succeed and partially succeed case * adding comment for TODO implementation or more clarity * remove carbon icon package and replace carbon icon * add incident-reporter-icon --------- Co-authored-by: Olfa Maslah <[email protected]>
* update style for oss of the failed task in the task panel * keep logic on click, remove unecessary useeffect * fix padding * wip implementing Saas style * utils to reshape error until backend provide info we need * utils to reshape error until backend provide info we need * utils to reshape error until backend provide info we need and fixinf fallbacks of isTotalFailure * utils to reshape error until backend provide into * have Saas style for failed and complete labelstatus and width and border * few style adjustment to follow codebase pattern * adjust succeed and partially succeed case * adding comment for TODO implementation or more clarity * remove carbon icon package and replace carbon icon * add incident-reporter-icon --------- Co-authored-by: Olfa Maslah <[email protected]>
* fix: Ensure SUCCESS status requires fetchable result in DoclingPollingService * style: ruff autofix (auto) * fix: Catch specific DoclingServeError when fetching task result after SUCCESS status * feat: update style for oss of the failed task in the task panel (#1647) * update style for oss of the failed task in the task panel * keep logic on click, remove unecessary useeffect * fix padding * wip implementing Saas style * utils to reshape error until backend provide info we need * utils to reshape error until backend provide info we need * utils to reshape error until backend provide info we need and fixinf fallbacks of isTotalFailure * utils to reshape error until backend provide into * have Saas style for failed and complete labelstatus and width and border * few style adjustment to follow codebase pattern * adjust succeed and partially succeed case * adding comment for TODO implementation or more clarity * remove carbon icon package and replace carbon icon * add incident-reporter-icon --------- Co-authored-by: Olfa Maslah <[email protected]> * fix: Encode IBM API key as Basic auth header (#1664) * Encode IBM API key as Basic auth header Add base64 encoding for the IBM auth path: import base64, construct a Basic auth token from X-Username and X-Api-Key (username:apikey), and store it in user.jwt_token and user.opensearch_credentials. Also set request.state.user before attaching the DB user ID so downstream code can access the created user object. * style: ruff autofix (auto) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: restart deployment if env changes (#1665) * restart deployment if env changes * unit test * lint * fix: Ensure Langflow .env variable definitions from LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT (#1667) * Ensure we dynamically update the list of Langflow .env environment variables with default values when the comma separated list defined in LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT changes * fix tests * fix additional linting errors --------- Co-authored-by: rodageve <[email protected]> * chore: Retire openrag-mcp; switch docs to streamable HTTP (#1668) * Retire openrag-mcp; switch docs to streamable HTTP Remove the stdio-based MCP server and all in-repo MCP tooling, and update README to mark the package as retired. Deleted module files include the MCP entrypoint, server, config, registry and individual tools (chat, search, documents, settings). The README was rewritten to announce that openrag-mcp is retired, explain migration to the built-in streamable-HTTP /mcp endpoint, update Cursor/Claude examples to use URL+headers auth, list the new v1 API tools, and note that the last PyPI release is final. This change consolidates MCP functionality into the OpenRAG core and removes the subprocess/stdio implementation and its source code. * Mark MCP SDK retired and clean package metadata Update package metadata to reflect retirement and integration into the OpenRAG backend. Bump version to 0.3.0 and replace the project description with a retirement/migration note. Set Development Status to Inactive, remove explicit Python version classifiers, and clear runtime dependencies and the CLI script entrypoint. Also remove the hatch env pip-args setting; build-system and wheel package target remain unchanged. * chore: update uv.lock files after version bump * Update uv.lock --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix: connector sync and override feature (#1663) * Add filename-based duplicate handling for connectors Add end-to-end support for filename-based duplicate handling on connector ingests. Frontend: send a new replace_duplicates flag with connector sync requests, perform a pre-sync duplicate check, and show a DuplicateHandlingDialog that lets users overwrite or skip duplicates when uploading from provider UI. Backend: propagate replace_duplicates through connector_router, request models, and connector services into the file processors. ConnectorFileProcessor and LangflowConnectorFileProcessor now check whether a filename already exists in the index and either fail the file task or delete the existing document before ingesting when replace_duplicates is true. Utilities/tests: clean_connector_filename now preserves original spacing/slashes and only enforces MIME-mapped extensions; get_filename_aliases adds underscore/sanitized variants so lookups match connector-indexed names. Add unit tests covering filename dedupe logic and filename alias behavior. * Use duplicateNames list and display names Replace numeric duplicateCount with a duplicateNames string[] across upload and dropdown flows so the UI can show the actual file names that would be overwritten. The duplicate-handling dialog now accepts duplicateNames, derives an effective count, and lists up to 5 duplicate filenames with an "… and N more" indicator; message labels and button text use the effective count. Toast messages and pending state in upload/[provider]/page.tsx and knowledge-dropdown.tsx were updated to pass and consume duplicateNames and to use duplicateNames.length for counts. * Update page.tsx * style: ruff autofix (auto) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: update OAuth prompt to consent for connector mutation (#1657) * fix: implement transient error handling for Docling result fetch * style: ruff autofix (auto) * refactor: remove unused import of Optional in docling_polling_service.py * refactor: change PollOutcome to use StrEnum for better type safety * refactor: enhance task status endpoints with structured failure metadata * style: ruff autofix (auto) * revert "style: ruff autofix (auto)" This reverts commit bc8be33. * style: ruff autofix (auto) * fix: Ensure SUCCESS status requires fetchable result in DoclingPollingService * style: ruff autofix (auto) * fix: Catch specific DoclingServeError when fetching task result after SUCCESS status * fix: implement transient error handling for Docling result fetch * style: ruff autofix (auto) * refactor: remove unused import of Optional in docling_polling_service.py * refactor: change PollOutcome to use StrEnum for better type safety * refactor: enhance task status endpoints with structured failure metadata * style: ruff autofix (auto) * revert "style: ruff autofix (auto)" This reverts commit bc8be33. * style: ruff autofix (auto) * Update tests/unit/test_task_service_get_task_status2.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * style: ruff autofix (auto) * fix: handle timeout during Docling result fetch after SUCCESS status * fix: update task status checks to use enum values for consistency * fix: enhance failure metadata for duplicate file errors in ingestion * style: ruff autofix (auto) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Wallgau <[email protected]> Co-authored-by: Olfa Maslah <[email protected]> Co-authored-by: Edwin Jose <[email protected]> Co-authored-by: ming <[email protected]> Co-authored-by: rodageve <[email protected]> Co-authored-by: rodageve <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Screen.Recording.2026-05-21.at.10.07.32.AM.mov
Summary by CodeRabbit
New Features
Style
Tests