Skip to content

Commit 0de8565

Browse files
committed
perf: add explicit type check after heuristic line selection for firstUserMessage
1 parent 15255df commit 0de8565

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/core/src/services/chatRecordingService.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,11 @@ export async function loadConversationRecord(
188188
if (userLine) {
189189
try {
190190
const record = JSON.parse(userLine) as unknown;
191-
if (hasProperty(record, 'content')) {
191+
if (
192+
hasProperty(record, 'type') &&
193+
record.type === 'user' &&
194+
hasProperty(record, 'content')
195+
) {
192196
const content = record.content;
193197
if (Array.isArray(content)) {
194198
firstUserMessage = content

0 commit comments

Comments
 (0)