Commit eb7db1f
committed
fix(tui): display subagent todos and prevent HTTP 413 payload errors
This commit addresses two issues when running tasks via the Task tool:
1. Todo list display: When a subagent calls TodoWrite, the todos are now
parsed and forwarded to the UI via a new ToolEvent::TodoUpdated event.
The SubagentTaskDisplay in the TUI is then updated to show the todos
with their status (pending, in_progress, completed).
2. HTTP 413 Payload Too Large: Tool outputs from subagent tool calls are
now truncated to 32KB to prevent the cumulative context from exceeding
backend payload limits. This is especially important for tools like
Grep or Read that can return large outputs.
Changes:
- Add ToolEvent::TodoUpdated variant to events.rs
- Detect TodoWrite calls in spawn_subagent and send todo updates to UI
- Truncate tool outputs > 32KB with a clear truncation message
- Handle TodoUpdated event in handle_tool_event to update app_state1 parent 18de66e commit eb7db1f
2 files changed
+88
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
756 | 759 | | |
757 | 760 | | |
758 | 761 | | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
759 | 788 | | |
760 | 789 | | |
761 | 790 | | |
| |||
765 | 794 | | |
766 | 795 | | |
767 | 796 | | |
768 | | - | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
769 | 811 | | |
770 | 812 | | |
771 | 813 | | |
| |||
3384 | 3426 | | |
3385 | 3427 | | |
3386 | 3428 | | |
| 3429 | + | |
| 3430 | + | |
| 3431 | + | |
| 3432 | + | |
| 3433 | + | |
| 3434 | + | |
| 3435 | + | |
| 3436 | + | |
| 3437 | + | |
| 3438 | + | |
| 3439 | + | |
| 3440 | + | |
| 3441 | + | |
| 3442 | + | |
| 3443 | + | |
| 3444 | + | |
| 3445 | + | |
| 3446 | + | |
| 3447 | + | |
| 3448 | + | |
| 3449 | + | |
| 3450 | + | |
| 3451 | + | |
| 3452 | + | |
| 3453 | + | |
| 3454 | + | |
| 3455 | + | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + | |
| 3460 | + | |
| 3461 | + | |
| 3462 | + | |
| 3463 | + | |
| 3464 | + | |
| 3465 | + | |
3387 | 3466 | | |
3388 | 3467 | | |
3389 | 3468 | | |
| |||
0 commit comments