Skip to content

fix: surface insight generation errors in the UI#201

Merged
wesm merged 5 commits intomainfrom
fix/broken-insights
Mar 19, 2026
Merged

fix: surface insight generation errors in the UI#201
wesm merged 5 commits intomainfrom
fix/broken-insights

Conversation

@wesm
Copy link
Copy Markdown
Owner

@wesm wesm commented Mar 19, 2026

Summary

  • Send actual error details (e.g. "claude CLI not found", "gemini
    failed: exit status 1") to the client instead of the generic
    "X generation failed" message. Stderr dumps are stripped from the
    short message since they're already visible in the log stream.
  • Show task error details and execution logs in the main content pane
    instead of cramming them into the narrow sidebar. On error, the
    failed task is auto-selected so the user immediately sees an error
    banner and full log output.
  • Sidebar task items are now clickable to view their details in the
    main pane (both during generation and after errors).
image

Closes #175

Generated with Claude Code

wesm and others added 2 commits March 19, 2026 08:10
The insight generation SSE error event was sending a generic
"X generation failed" message, hiding the actual error from
users. Now the real error (e.g. "claude CLI not found",
"gemini failed: exit status 1") is sent to the client, with
stderr dumps stripped for brevity (full logs are already
visible in the task log stream).

Also expands the task-logs panel on error (240px vs 132px)
with a red-tinted border so failures are more visible.

Closes #175

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Task items in the sidebar are now clickable — selecting one
shows its error details and full execution log in the main
content area instead of cramming them into the narrow sidebar.
On error, the failed task is auto-selected so the user
immediately sees the error banner and log output.

The sidebar task item keeps a short error summary line but
the full log viewer has moved to the main pane with proper
scrolling (50vh max) and formatting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Mar 19, 2026

roborev: Combined Review (f0b0fad)

Verdict: One medium severity issue found regarding task cancellation logic; all other findings are low severity or safe.

Medium

  • Location: frontend/src/lib/components/insights/InsightsPage.svelte:411

Problem: The header action for a selected task always calls dismissTask(task.clientId), even when the task is still generating. That removes the task from the UI but does not abort the underlying generation, unlike the sidebar action, so work continues in the background and can later update state for a task the
user thought they had canceled.

  • Fix: Make the main-pane button follow the same branch as the sidebar button: call cancelTask() for active tasks and dismissTask() only for errored tasks, and update the button title/label to match.

Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

wesm and others added 2 commits March 19, 2026 08:51
The main-pane close button was always calling dismissTask(),
which removes the task from the UI without aborting the
underlying generation. Now it calls cancelTask() for active
tasks and dismissTask() only for errored ones, matching the
sidebar behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ignore keydown events bubbling from the nested dismiss button
so keyboard activation of the inner button doesn't also trigger
selectTask(). Add test coverage for the \nraw: stripping path
in insightGenerateClientMessage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Mar 19, 2026

roborev: Combined Review (a39853b)

Summary Verdict: The changes implement task selection and error surfacing, but introduce a build-breaking syntax error and a keyboard event handling issue that require fixes.

High Severity

  • Location: frontend/src/lib/components/insights/InsightsPage.svelte:397
  • Problem: Svelte syntax error. The Svelte compiler strictly requires {@const without spaces. The space before @const in { @const task = insights.selectedTask} causes Svelte to parse the block as a JavaScript expression, which will throw a syntax error ("Unexpected token @") and break the frontend build.
  • Fix: Remove the space after the brace: {@const task = insights.selectedTask}

Medium Severity

  • Location: frontend/src /lib/components/insights/InsightsPage.svelte:286-293
  • Problem: The new onkeydown handler on .task-item receives bubbled Enter/Space events from the nested dismiss/cancel <button>. Keyboard-activating that button now
    selects the task first, which is inconsistent with the mouse path. Furthermore, the Space key action does not call preventDefault(), causing the page to scroll when pressed.
  • Fix: Guard the handler so it only runs when e.target === e.currentTarget, and call e.preventDefault() before handling
    Enter/Space; alternatively, move task selection onto a dedicated button element and keep the dismiss button separate.

Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Mar 19, 2026

roborev: Combined Review (c35a2b1)

Summary Verdict: The PR successfully improves insight task UX and error handling, but contains a high-severity Svelte template compilation error that must be resolved.

High

  • Location: frontend/src/lib/components/insights/InsightsPage.svelte, line 397
  • Problem: Svelte tag syntax does not allow a space between the opening brace { and the tag name @const. { @const task ...} will cause a template compilation
    /parsing error.
  • Fix: Remove the space: {@const task = insights.selectedTask}.

Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Mar 19, 2026

roborev: Combined Review (9c72769)

Summary Verdict: All reviewers agree the code is clean and no issues were found.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@wesm wesm merged commit e44904c into main Mar 19, 2026
10 checks passed
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.

Insights tries to run agents in rogue folders

1 participant