Commit ced378a
fix(copilot): address the confirmed review findings
Five findings from the review, each reproduced before being fixed and
mutation-checked after.
The nesting rule on the matched-pair path tested for anything tag-shaped while
the streaming path tested for the tag NAMES. Reasoning that mentioned `<div>` or
a generic was therefore released as visible prose — the model's thinking on
screen because of an incidental angle bracket. Both paths now share one
predicate, hasSpecialTagMarker, so they cannot disagree about whether a body was
ever a tag. The broad regex keeps its other job: on a JSON body an invented name
like `</workflow_resource>` really is stray content.
Not changed, and worth saying why: a `<thinking>` body containing a REAL nested
tag still releases and renders it. Suppressing it instead would mean the
streaming path shows a card and the close then retracts it, which is the defect
the previous commit fixed. Security rated the containment loss P2 while noting it
grants no capability the top-level path lacks — a stream that can nest a tag can
emit one at top level, which already rendered.
unclosedTagCannotResolve blanked a full window before viability rejected the body
on its first character, which is the common case of a tag name in prose. Testing
that first: 43ms per streaming parse at 84KB, now 2ms.
The unclosed path sliced the whole remaining buffer and then bounded it, copying
the rest of the message per opener per chunk. inspectFrom slices once, bounded.
A message that is ONLY a discarded payload rendered the raw JSON: discard emits
no segment by design, so it reached the empty-segments fallback, whose job is to
never blank a plain-text message. It now knows a discard happened. Pre-existing,
but discard only became a first-class outcome on this branch.
Three docstrings still pointed at resolveTagAt for decisions the refactor moved
into classifyBody and resumeForClass.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent bad05fe commit ced378a
2 files changed
Lines changed: 86 additions & 13 deletions
File tree
- apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
525 | 555 | | |
526 | 556 | | |
527 | 557 | | |
| |||
Lines changed: 56 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
| 400 | + | |
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
548 | | - | |
| 548 | + | |
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
646 | 659 | | |
647 | 660 | | |
648 | 661 | | |
649 | 662 | | |
650 | 663 | | |
651 | 664 | | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
657 | 674 | | |
658 | 675 | | |
659 | 676 | | |
| |||
701 | 718 | | |
702 | 719 | | |
703 | 720 | | |
704 | | - | |
| 721 | + | |
705 | 722 | | |
706 | 723 | | |
707 | 724 | | |
| |||
799 | 816 | | |
800 | 817 | | |
801 | 818 | | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
802 | 833 | | |
803 | 834 | | |
804 | 835 | | |
| |||
844 | 875 | | |
845 | 876 | | |
846 | 877 | | |
847 | | - | |
848 | | - | |
849 | | - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
850 | 884 | | |
851 | 885 | | |
852 | 886 | | |
| |||
938 | 972 | | |
939 | 973 | | |
940 | 974 | | |
941 | | - | |
| 975 | + | |
942 | 976 | | |
943 | 977 | | |
944 | 978 | | |
| |||
981 | 1015 | | |
982 | 1016 | | |
983 | 1017 | | |
| 1018 | + | |
984 | 1019 | | |
985 | 1020 | | |
986 | 1021 | | |
| |||
1029 | 1064 | | |
1030 | 1065 | | |
1031 | 1066 | | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
1032 | 1071 | | |
1033 | 1072 | | |
1034 | 1073 | | |
1035 | 1074 | | |
1036 | 1075 | | |
1037 | | - | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1038 | 1081 | | |
1039 | 1082 | | |
1040 | 1083 | | |
| |||
0 commit comments