Skip to content

Commit 45eaa05

Browse files
committed
fix(scheduled-tasks): keep context double-cast adjacent to its boundary annotation
1 parent 75bd933 commit 45eaa05

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • apps/sim/app/api/mothership/execute

apps/sim/app/api/mothership/execute/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,16 @@ export const POST = withRouteHandler(async (req: NextRequest) => {
139139
executionId,
140140
})
141141
const lastUserMessage = messages.filter((m) => m.role === 'user').at(-1)?.content
142+
// double-cast-allowed: the contract validates contexts as open kind/label objects; processContextsServer narrows on `kind` at runtime
143+
const agentMentions = contexts as unknown as ChatContext[] | undefined
142144
const [workspaceContext, integrationTools, userSkillTool, userPermission, agentContexts] =
143145
await Promise.all([
144146
generateWorkspaceContext(workspaceId, userId),
145147
buildIntegrationToolSchemas(userId, messageId, undefined, workspaceId),
146148
buildUserSkillTool(workspaceId),
147149
getUserEntityPermissions(userId, 'workspace', workspaceId).catch(() => null),
148-
// double-cast-allowed: the contract validates contexts as open kind/label objects; processContextsServer narrows on `kind` at runtime
149150
processContextsServer(
150-
contexts as unknown as ChatContext[] | undefined,
151+
agentMentions,
151152
userId,
152153
lastUserMessage,
153154
workspaceId,

0 commit comments

Comments
 (0)