Skip to content

Commit 71d4b49

Browse files
committed
fix(lint): fix lint
1 parent 336480e commit 71d4b49

2 files changed

Lines changed: 14 additions & 18 deletions

File tree

apps/sim/lib/copilot/chat/effective-transcript.test.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,11 @@ describe('tool ownership is call-frame authoritative', () => {
417417
const blocks = (result[1].contentBlocks ?? []) as Array<Record<string, unknown>>
418418
const tool = blocks.find((b) => b.type === MothershipStreamV1EventType.tool)
419419
const tc = tool?.toolCall as Record<string, unknown> | undefined
420-
return { calledBy: tc?.calledBy, parentToolCallId: tool?.parentToolCallId, spanId: tool?.spanId }
420+
return {
421+
calledBy: tc?.calledBy,
422+
parentToolCallId: tool?.parentToolCallId,
423+
spanId: tool?.spanId,
424+
}
421425
}
422426

423427
it('an unscoped main call clears provisional subagent attribution', () => {
@@ -427,10 +431,7 @@ describe('tool ownership is call-frame authoritative', () => {
427431
messages: [buildUserMessage('stream-1', 'Hello')],
428432
activeStreamId: 'stream-1',
429433
streamSnapshot: {
430-
events: [
431-
toolEvent(1, 'result', 'fc_1', superagentScope),
432-
toolEvent(2, 'call', 'fc_1'),
433-
],
434+
events: [toolEvent(1, 'result', 'fc_1', superagentScope), toolEvent(2, 'call', 'fc_1')],
434435
previewSessions: [],
435436
status: 'active',
436437
},
@@ -446,10 +447,7 @@ describe('tool ownership is call-frame authoritative', () => {
446447
messages: [buildUserMessage('stream-1', 'Hello')],
447448
activeStreamId: 'stream-1',
448449
streamSnapshot: {
449-
events: [
450-
toolEvent(1, 'call', 'fc_1'),
451-
toolEvent(2, 'result', 'fc_1', superagentScope),
452-
],
450+
events: [toolEvent(1, 'call', 'fc_1'), toolEvent(2, 'result', 'fc_1', superagentScope)],
453451
previewSessions: [],
454452
status: 'active',
455453
},
@@ -464,10 +462,7 @@ describe('tool ownership is call-frame authoritative', () => {
464462
messages: [buildUserMessage('stream-1', 'Hello')],
465463
activeStreamId: 'stream-1',
466464
streamSnapshot: {
467-
events: [
468-
toolEvent(1, 'call', 'fc_2', superagentScope),
469-
toolEvent(2, 'result', 'fc_2'),
470-
],
465+
events: [toolEvent(1, 'call', 'fc_2', superagentScope), toolEvent(2, 'result', 'fc_2')],
471466
previewSessions: [],
472467
status: 'active',
473468
},

apps/sim/lib/copilot/chat/effective-transcript.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ function buildLiveAssistantMessage(params: {
173173
state?: string
174174
isCallFrame?: boolean
175175
}): RawPersistedBlock => {
176-
const ownershipWritable = input.isCallFrame === true || !toolOwnershipSettled.has(input.toolCallId)
176+
const ownershipWritable =
177+
input.isCallFrame === true || !toolOwnershipSettled.has(input.toolCallId)
177178
if (input.isCallFrame) toolOwnershipSettled.add(input.toolCallId)
178179
const existingIndex = toolIndexById.get(input.toolCallId)
179180
if (existingIndex !== undefined) {
@@ -208,10 +209,10 @@ function buildLiveAssistantMessage(params: {
208209
// subagent attribution so the tool renders under Sim, not the
209210
// forwarding caller.
210211
const tc = asPayloadRecord(existing.toolCall)
211-
if (tc) delete tc.calledBy
212-
delete existing.parentToolCallId
213-
delete existing.spanId
214-
delete existing.parentSpanId
212+
if (tc) tc.calledBy = undefined
213+
existing.parentToolCallId = undefined
214+
existing.spanId = undefined
215+
existing.parentSpanId = undefined
215216
}
216217
}
217218
return existing

0 commit comments

Comments
 (0)