Repository navigation
Commit ae01098
authored
fix(tui): correct Dynamic Workflow row rendering and progress (#24)
## Related Issue
No issue filed — the problem is described below.
## Problem
The Dynamic Workflow mission-control card renders raw model output
without validating it, so a workflow called with object items (`{prompt,
description}` instead of strings) produced a garbled card:
- Rows 001–006 showed `[object Object]`, because completed `items` were
mapped through `String`.
- Rows 007+ were phantoms: the streaming-arguments scanner treated every
quoted string after `"items": [` as an item, so object keys and nested
values each became their own row (`prompt`, `description`, the values…).
They were never removed once the real arguments arrived.
- Streamed model text was concatenated onto the tool-activity label with
no separator, producing lines like `Using ReadI've read the first 5
files…`.
Separately, member progress crept toward a 99% ceiling on every streamed
token. A subagent reached 99% within seconds and sat there for the rest
of an 8-minute run, so the number carried no information.
## What changed
- Object items render a readable field (`prompt` / `description` /
`title` / `task`) instead of `[object Object]`.
- The streaming scanner tracks brace/bracket depth, so only top-level
array members count as items; a nested member occupies exactly one row.
- Model text after a tool call starts a new line instead of fusing with
the tool label.
- Accepting the tool input drops surplus rows that streaming
over-counted and that no agent claimed.
- Member progress reflects the observed stage only (started / model text
/ tool call / terminal). The creep constants are removed; elapsed time
and the latest line already carry liveness.
The tool call itself still fails validation for object items — that is
the schema working as intended. This change only stops the card from
displaying garbage while it happens.
Tests: two creep-specific tests were rewritten for stage-only progress,
and three tests added for the tool-label separator, object item labels,
and phantom-row pruning. `test/tui` passes (2340 tests).
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/Pythoughts-labs/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [x] I have linked a related issue, or explained the problem above.
- [x] I have added tests that prove my feature works.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Dynamic Workflow cards now display object items with readable content
instead of `[object Object]`.
* Removed phantom agent rows created during streaming.
* Tool activity labels are separated from streamed text.
* Workflow progress now remains accurate during active stages and no
longer stalls at 99%.
* **Tests**
* Added coverage for workflow progress, row rendering, and tool/model
output separation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 407878b commit ae01098
5 files changed
Lines changed: 117 additions & 54 deletions
File tree
- .changeset
- apps/pythinker-code
- src/tui
- components/messages
- constant
- test/tui/components/messages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 54 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
204 | 213 | | |
205 | 214 | | |
206 | 215 | | |
| |||
249 | 258 | | |
250 | 259 | | |
251 | 260 | | |
| 261 | + | |
| 262 | + | |
252 | 263 | | |
253 | 264 | | |
254 | 265 | | |
255 | 266 | | |
256 | 267 | | |
257 | 268 | | |
258 | 269 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
282 | 277 | | |
283 | 278 | | |
284 | 279 | | |
| |||
711 | 706 | | |
712 | 707 | | |
713 | 708 | | |
714 | | - | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
715 | 726 | | |
716 | 727 | | |
717 | | - | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
718 | 733 | | |
719 | | - | |
| 734 | + | |
720 | 735 | | |
721 | 736 | | |
| 737 | + | |
722 | 738 | | |
723 | 739 | | |
724 | | - | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
725 | 751 | | |
726 | 752 | | |
727 | | - | |
| 753 | + | |
728 | 754 | | |
729 | 755 | | |
730 | 756 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 34 | | |
43 | 35 | | |
44 | 36 | | |
| |||
Lines changed: 53 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
| |||
598 | 604 | | |
599 | 605 | | |
600 | 606 | | |
601 | | - | |
| 607 | + | |
602 | 608 | | |
603 | 609 | | |
604 | 610 | | |
605 | 611 | | |
606 | 612 | | |
607 | 613 | | |
608 | 614 | | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | 615 | | |
618 | | - | |
| 616 | + | |
619 | 617 | | |
620 | | - | |
621 | | - | |
622 | | - | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
623 | 621 | | |
624 | 622 | | |
625 | 623 | | |
626 | 624 | | |
627 | 625 | | |
628 | | - | |
| 626 | + | |
629 | 627 | | |
630 | 628 | | |
631 | 629 | | |
| |||
635 | 633 | | |
636 | 634 | | |
637 | 635 | | |
638 | | - | |
639 | | - | |
640 | | - | |
| 636 | + | |
| 637 | + | |
641 | 638 | | |
642 | 639 | | |
643 | 640 | | |
644 | | - | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
645 | 680 | | |
646 | 681 | | |
647 | 682 | | |
| |||
0 commit comments