Skip to content

Commit 6fbd399

Browse files
j15zclaude
andcommitted
docs(copilot): state the actual bound on the thinking nesting rule
The docstring implied generics are excluded from the marker check. They are not: the match is a substring test, so `Promise<void>` is safe only because `void` is not a tag name, while `Promise<options>` does match and would release a thinking body as text. Says so plainly now, with why it is left as-is: the boundary check that would narrow it wants a lookbehind, which is Safari 16.4+ and would be a parse-time SyntaxError on the versions this app still supports — a dead client chunk is a worse outcome than the bug. Reaching it also needs an inline `<thinking>` body, which the agent no longer emits, discussing a type named exactly after a tag. Comment only; no behaviour change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 47e1f2f commit 6fbd399

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags

apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags/special-tags.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,13 @@ function isViableJsonPrefixOf(scannable: string): boolean {
639639
* would itself act on proves the enclosing opener was text. Shared so the
640640
* streaming and matched-pair paths cannot answer the same question differently
641641
* — them disagreeing is what let a late close swallow content already on screen.
642+
*
643+
* The match is by substring, so a generic is safe only when its parameter is not
644+
* itself a tag name: `Promise<void>` does not match, `Promise<options>` does. The
645+
* narrowing is not worth its cost — it needs a `<thinking>` body, which the agent
646+
* no longer emits (reasoning arrives as structured thinking blocks), discussing a
647+
* type named exactly after a tag; and the boundary check that would fix it wants a
648+
* lookbehind, unavailable on the Safari versions this app still supports.
642649
*/
643650
function hasSpecialTagMarker(text: string): boolean {
644651
return SPECIAL_TAG_NAMES.some((name) => text.includes(`</${name}>`) || text.includes(`<${name}>`))

0 commit comments

Comments
 (0)