Skip to content

Commit 46212f3

Browse files
committed
fix(copilot): match durable path — detect markdown by MIME type + name at the stream gate
The streaming gate checked isMarkdownFile with only the filename, while the durable merge uses type + name — so a text/markdown file without a .md extension was skipped mid-stream (it self-corrected at the durable write). Pass editIntent.contentType so streaming detects the same set of markdown files as the durable path.
1 parent 63a4681 commit 46212f3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/sim/lib/copilot/request/go/file-preview-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ export async function processFilePreviewStreamEvent(input: {
668668
// no-op — so a slow relay can't backlog stale snapshots or make the doc lag the stream.
669669
const dueForLiveMerge =
670670
nextSession.fileId !== undefined &&
671-
isMarkdownFile({ name: nextSession.fileName ?? '' }) &&
671+
isMarkdownFile({ type: editIntent.contentType, name: nextSession.fileName ?? '' }) &&
672672
(editIntent.operation === 'append' || editIntent.operation === 'patch') &&
673673
currentPreview.session.baseContent !== undefined &&
674674
!isLiveDocMergeInFlight(nextSession.fileId) &&

0 commit comments

Comments
 (0)