Skip to content

Commit 540667a

Browse files
j15zclaude
andcommitted
test(copilot): pin the blanking rule with a body staging cannot recover
CI runs the merge with staging, and staging's desktop PR (#5998) taught `parseSpecialTagData` to recover a failed `<question>` body's prompt and render it as text instead of returning null. That recovery lands before `classifyBody` is ever consulted, so this fixture — whose quoted `</options>` sat inside its `prompt` — stopped exercising the blanking rule and started asserting the recovery. Merged, it rendered "A use </options> here? B" instead of "A B". Moving the quoted marker to a non-`prompt` field restores what the test is for: a marker inside a JSON string must be blanked before the scan, or a broken payload gets classified as literal text and its raw JSON is shown. A body with no recoverable prompt reaches `discard` on both sides of the merge, matching the prompt-less fixture the sibling test above already uses. Behaviour is unchanged on either branch alone; only the fixture moved. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 2972209 commit 540667a

1 file changed

Lines changed: 9 additions & 4 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.test.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,16 @@ describe('parseSpecialTags with <question>', () => {
303303

304304
it('drops that same payload even when its JSON quotes tag syntax', () => {
305305
// The marker scan must blank JSON strings the way the streaming path does.
306-
// Scanning the raw body sees `</options>` inside the prompt, calls the span
307-
// literal text, and renders the raw payload — the outcome `discard` exists
308-
// to prevent.
306+
// Scanning the raw body sees `</options>` inside the payload, calls the span
307+
// literal text, and renders the raw JSON — the outcome `discard` exists to
308+
// prevent.
309+
//
310+
// The quoted marker deliberately sits in a field OTHER than `prompt`: a
311+
// recoverable prompt is surfaced as text before this path is reached, so a
312+
// fixture carrying one would assert the recovery rather than the blanking
313+
// this test exists for. Matches the prompt-less body used above.
309314
const { segments } = parseSpecialTags(
310-
'A <question>[{"type":"single_select","prompt":"use </options> here?"}]</question> B',
315+
'A <question>[{"type":"single_select","title":"use </options> here?"}]</question> B',
311316
false
312317
)
313318
expect(renderedText(segments)).toBe('A B')

0 commit comments

Comments
 (0)