Commit bca7f2c
authored
feat(logs): add Troubleshoot in Chat button for errored runs (#5341)
* feat(logs): add Troubleshoot in Chat button for errored runs
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.
* fix(logs): deliver troubleshoot to a mounted chat + harden handoff
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.
* docs(logs): convert inline comments to TSDoc on declarations
* style(logs): match Troubleshoot button icon gap to View Snapshot sibling
* improvement(logs): use Chip for log-detail action buttons
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.
* fix(chat): only consume troubleshoot handoff on the new-chat surface
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.
* fix(logs): hover only the interactive Run ID row in log details
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.
* improvement(logs): use emcn Badge for the version pill
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.1 parent 507cee1 commit bca7f2c
5 files changed
Lines changed: 244 additions & 31 deletions
File tree
- apps/sim
- app/workspace/[workspaceId]
- home
- logs/components/log-details
- lib
- core/utils
- mothership
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
316 | 323 | | |
317 | 324 | | |
318 | | - | |
319 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
320 | 329 | | |
321 | 330 | | |
322 | 331 | | |
323 | 332 | | |
324 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
325 | 350 | | |
326 | 351 | | |
327 | 352 | | |
| |||
Lines changed: 71 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| |||
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| 60 | + | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| |||
275 | 281 | | |
276 | 282 | | |
277 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
278 | 287 | | |
279 | 288 | | |
280 | 289 | | |
| |||
382 | 391 | | |
383 | 392 | | |
384 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
385 | 426 | | |
386 | 427 | | |
387 | 428 | | |
| |||
434 | 475 | | |
435 | 476 | | |
436 | 477 | | |
437 | | - | |
| 478 | + | |
438 | 479 | | |
439 | 480 | | |
440 | 481 | | |
| |||
450 | 491 | | |
451 | 492 | | |
452 | 493 | | |
453 | | - | |
| 494 | + | |
454 | 495 | | |
455 | 496 | | |
456 | 497 | | |
457 | 498 | | |
458 | 499 | | |
459 | 500 | | |
460 | 501 | | |
461 | | - | |
| 502 | + | |
462 | 503 | | |
463 | 504 | | |
464 | 505 | | |
| |||
472 | 513 | | |
473 | 514 | | |
474 | 515 | | |
475 | | - | |
| 516 | + | |
476 | 517 | | |
477 | 518 | | |
478 | 519 | | |
| |||
483 | 524 | | |
484 | 525 | | |
485 | 526 | | |
486 | | - | |
| 527 | + | |
487 | 528 | | |
488 | 529 | | |
489 | 530 | | |
490 | 531 | | |
491 | | - | |
| 532 | + | |
492 | 533 | | |
493 | | - | |
| 534 | + | |
494 | 535 | | |
495 | 536 | | |
496 | 537 | | |
497 | 538 | | |
498 | 539 | | |
499 | 540 | | |
500 | | - | |
| 541 | + | |
501 | 542 | | |
502 | 543 | | |
503 | 544 | | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
508 | 549 | | |
509 | 550 | | |
510 | | - | |
511 | 551 | | |
512 | | - | |
| 552 | + | |
513 | 553 | | |
514 | 554 | | |
515 | 555 | | |
| |||
541 | 581 | | |
542 | 582 | | |
543 | 583 | | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
544 | 597 | | |
545 | 598 | | |
546 | 599 | | |
547 | 600 | | |
548 | 601 | | |
549 | 602 | | |
550 | 603 | | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
| 604 | + | |
555 | 605 | | |
556 | 606 | | |
557 | 607 | | |
| |||
560 | 610 | | |
561 | 611 | | |
562 | 612 | | |
563 | | - | |
| 613 | + | |
564 | 614 | | |
565 | 615 | | |
566 | 616 | | |
| |||
569 | 619 | | |
570 | 620 | | |
571 | 621 | | |
572 | | - | |
| 622 | + | |
573 | 623 | | |
574 | 624 | | |
575 | 625 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
0 commit comments