diff --git a/static/src/components/chat/actions/ToolAction.vue b/static/src/components/chat/actions/ToolAction.vue index 8fd8090..6bf16d7 100644 --- a/static/src/components/chat/actions/ToolAction.vue +++ b/static/src/components/chat/actions/ToolAction.vue @@ -527,7 +527,8 @@ function renderReadFile(result: any, args: any): string { matches.forEach((match: any, idx: number) => { if (idx > 0) html += '
'; html += '
'; - html += `
行 ${match.line_number || '?'}
`; + const lineLabel = match.line_start === match.line_end ? `${match.line_start}` : `${match.line_start}-${match.line_end}`; + html += `
行 ${lineLabel}
`; html += `
${escapeHtml(match.snippet || match.content || '')}
`; html += '
'; }); diff --git a/static/src/components/chat/actions/toolRenderers.ts b/static/src/components/chat/actions/toolRenderers.ts index 685d426..3fc5620 100644 --- a/static/src/components/chat/actions/toolRenderers.ts +++ b/static/src/components/chat/actions/toolRenderers.ts @@ -479,7 +479,8 @@ function renderReadFile(result: any, args: any): string { matches.forEach((match: any, idx: number) => { if (idx > 0) html += '
'; html += '
'; - html += `
行 ${match.line_number || '?'}
`; + const lineLabel = match.line_start === match.line_end ? `${match.line_start}` : `${match.line_start}-${match.line_end}`; + html += `
行 ${lineLabel}
`; html += `
${escapeHtml(match.snippet || match.content || '')}
`; html += '
'; });