Skip to content

Commit 372b9f5

Browse files
authored
fix: reduce markdown streaming lag (#9097)
* fix: reduce markdown streaming lag * refactor: centralize markdown live node limit
1 parent 41f8960 commit 372b9f5

6 files changed

Lines changed: 90 additions & 61 deletions

File tree

dashboard/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
"katex": "^0.16.27",
3232
"lodash": "4.17.23",
3333
"markdown-it": "^14.1.1",
34-
"markstream-vue": "1.0.1-beta.1",
34+
"markstream-vue": "1.0.5-beta.0",
3535
"mermaid": "^11.12.2",
3636
"monaco-editor": "^0.52.2",
3737
"pinia": "2.1.6",
3838
"pinyin-pro": "^3.26.0",
3939
"qrcode": "^1.5.4",
40-
"shiki": "^3.20.0",
41-
"stream-markdown": "^0.0.15",
40+
"shiki": "^3.23.0",
41+
"stream-markdown": "^0.0.16",
4242
"vee-validate": "4.11.3",
4343
"vite-plugin-vuetify": "2.1.3",
4444
"vue": "3.3.4",

dashboard/pnpm-lock.yaml

Lines changed: 80 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dashboard/src/components/chat/ThreadedMarkdownMessagePart.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
:smooth-streaming="isStreaming ? 'auto' : false"
99
:fade="false"
1010
:typewriter="false"
11-
:max-live-nodes="0"
11+
:max-live-nodes="MARKDOWN_RENDER_MAX_LIVE_NODES"
1212
/>
1313
</template>
1414

1515
<script setup lang="ts">
1616
import { computed, provide } from "vue";
1717
import { MarkdownRender } from "markstream-vue";
18+
import { MARKDOWN_RENDER_MAX_LIVE_NODES } from "@/components/chat/markdownRenderConfig";
1819
import type { ChatThread } from "@/composables/useMessages";
1920
2021
const props = defineProps<{
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const MARKDOWN_RENDER_MAX_LIVE_NODES = 320;

dashboard/src/components/chat/message_list_comps/MarkdownMessagePart.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
:smooth-streaming="isStreaming ? 'auto' : false"
1010
:fade="false"
1111
:typewriter="false"
12-
:max-live-nodes="0"
12+
:max-live-nodes="MARKDOWN_RENDER_MAX_LIVE_NODES"
1313
/>
1414
</div>
1515
</template>
1616

1717
<script setup lang="ts">
1818
import { computed, provide } from "vue";
1919
import { MarkdownRender } from "markstream-vue";
20+
import { MARKDOWN_RENDER_MAX_LIVE_NODES } from "@/components/chat/markdownRenderConfig";
2021
2122
const props = defineProps<{
2223
content: string;

dashboard/src/components/chat/message_list_comps/ReasoningTimeline.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
:fade="false"
2828
:typewriter="false"
2929
:is-dark="isDark"
30-
:max-live-nodes="0"
30+
:max-live-nodes="MARKDOWN_RENDER_MAX_LIVE_NODES"
3131
/>
3232

3333
<div v-else-if="entry.tool" class="reasoning-tool-call-block">
@@ -62,6 +62,7 @@
6262
<script setup lang="ts">
6363
import { computed } from "vue";
6464
import { MarkdownRender } from "markstream-vue";
65+
import { MARKDOWN_RENDER_MAX_LIVE_NODES } from "@/components/chat/markdownRenderConfig";
6566
import IPythonToolBlock from "@/components/chat/message_list_comps/IPythonToolBlock.vue";
6667
import ToolCallCard from "@/components/chat/message_list_comps/ToolCallCard.vue";
6768
import ToolCallItem from "@/components/chat/message_list_comps/ToolCallItem.vue";

0 commit comments

Comments
 (0)