feat(logs): add Troubleshoot in Chat button for errored runs#5341
Conversation
Errored log runs now surface a "Troubleshoot in Chat" action in the log details panel. It tags the failed run as a logs context (executionId) and auto-sends a message to Chat asking Sim to investigate and fix the error, porting the old copilot "Fix in Chat" behavior to mothership and adding run-ID tagging. Cross-route handoff rides a one-shot MothershipHandoffStorage consumed once on the home surface mount, so the tagged run + prompt survive the navigation from Logs to Chat and the agent receives the full run error via the resolved logs context.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Cross-surface delivery: Includes unit tests for handoff store/consume (trim, one-shot, expiry, corruption). Log details overview rows get minor UI tweaks ( Reviewed by Cursor Bugbot for commit 462f4cd. Configure here. |
Review follow-ups:
- Same-route case (Cursor): LogDetailsContent is also embedded in the Chat
resource panel, where router.push('/home') doesn't remount Home, so the
mount-only handoff consume never fired. Generalize the existing
sendMothershipMessage event to carry contexts and be cancelable: deliver
straight to a mounted chat when one claims it, and only persist + navigate
when none is listening.
- Corrupted-entry tombstone (Greptile): consume now clears whenever any entry
exists, so a malformed/expired handoff can't linger across future mounts.
- Silent store failure (Greptile): only navigate when the handoff actually
stored, so a failed write never strands the user on an empty chat.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9a9a11a. Configure here.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a9b0812. Configure here.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4fad79e. Configure here.
Aligns the log-details panel's labeled action buttons (View Snapshot, Troubleshoot in Chat) with the settings design language by swapping the emcn Button for the canonical Chip pill. variant='primary' preserves the prior filled emphasis; leftIcon keeps the icons canonical.
|
@cursor review |
Gate the mount-time handoff consume on `!chatId` so an existing `/chat/[chatId]` mount can't claim a pending handoff if navigation races — a handoff always targets a fresh chat.
|
@cursor review |
The detail-card rows all hovered to --surface-2, but the card itself is --surface-2, so the hover was a no-op in light mode and only showed in dark. It also implied clickability on static readout rows. Now only the clickable Run ID row hovers, using the canonical --surface-active token; static rows carry no hover.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 398d954. Configure here.
Replaces the hand-rolled version span with the canonical Badge (variant='green' size='md', pixel-identical tokens), so all three detail badges (Level, Trigger, Version) render through the same component.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 462f4cd. Configure here.
Two concrete regressions from the earlier Chip conversion (#5341): - Both chips used variant='primary' (the solid inverse-fill treatment), the heaviest chrome in the design system, reserved for a single standout action per context (Save, Upgrade, Add key) — never a peer among several row actions. Two solid pills stacked in a narrow side panel read as oversized. Switched both to the bare (default) chip, matching every analogous row action in Settings. - The Version badge was size='md' while its siblings (Level, Trigger) are size='sm' — an inconsistency. Aligned to 'sm'. Also folded the floating 'Troubleshoot in Chat' chip into the Details card as its own row (matching 'Snapshot' exactly) instead of leaving it orphaned below Workflow Output — every row in the card now shares one shape (label left, trailing content right), consistent top to bottom.

Summary
executionId, not a Chat/mothership run).logscontext (executionId) and auto-sends a message to Chat asking Sim to investigate and fix the error — the server resolves the tagged run into the agent's context, so it sees the full error.MothershipHandoffStorage(localStorage) consumed exactly once on the home-surface mount, so the tagged run + prompt survive the Logs → Chat navigation. Consume clears atomically (fires once, even under StrictMode / reload).Type of Change
Testing
MothershipHandoffStorage(round-trip + trim, one-shot consume, empty-message guard, max-age expiry clears).type-check,biome,check:client-boundary, andcheck:api-validationall pass./homemount consumes →sendMessage(msg, undefined, contexts)→ POST/api/mothership/chatwithcreateNewChat: trueand the rawcontexts(envelope + context schema are.passthrough(), soexecutionIdsurvives) →processExecutionLogFromDb(executionId)injects the run error into the agent.Checklist