Skip to content

Commit 5e661fc

Browse files
committed
fix(assistant-actions): return a fresh empty review result
1 parent 7b205fa commit 5e661fc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • apps/sim/lib/assistant-actions/application

‎apps/sim/lib/assistant-actions/application/review.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ interface ReviewInput {
3838
runId: string
3939
}
4040

41-
const NOTHING_TO_REVIEW = { runId: null, streamId: null, actions: [], nextCursor: null }
41+
function nothingToReview() {
42+
return { runId: null, streamId: null, actions: [], nextCursor: null }
43+
}
4244

4345
export const listOrganizationAssistantActions = defineAuthorizedOrganizationUseCase({
4446
operation: assistantActionOperations.list,
@@ -66,7 +68,7 @@ export const listOrganizationAssistantActions = defineAuthorizedOrganizationUseC
6668
)
6769
.orderBy(desc(copilotRuns.startedAt), desc(copilotRuns.id))
6870
.limit(1)
69-
if (!latest) return NOTHING_TO_REVIEW
71+
if (!latest) return nothingToReview()
7072
const runId = latest.id
7173
const run = await requireAssistantRun(principal, { ...input, runId }, context.userId).catch(
7274
(error: unknown) => {
@@ -75,7 +77,7 @@ export const listOrganizationAssistantActions = defineAuthorizedOrganizationUseC
7577
throw error
7678
}
7779
)
78-
if (!run) return NOTHING_TO_REVIEW
80+
if (!run) return nothingToReview()
7981
const records = await db
8082
.select()
8183
.from(copilotAsyncToolCalls)

0 commit comments

Comments
 (0)