Skip to content

Commit

Permalink
Showing 2 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -24,4 +24,4 @@ jobs:
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.LECCA_IO_RELEASE_TOKEN }}
34 changes: 19 additions & 15 deletions apps/server/src/modules/core/tasks/tasks.controller.ts
Original file line number Diff line number Diff line change
@@ -95,21 +95,25 @@ export class AgentTasksController {
@Body() data: MessageTaskDto,
@Res() response: Response,
) {
const lastMessage = data.messages[data.messages.length - 1];

const result = await this.tasksService.messageTaskOrCreateTaskIfNotFound({
agentId,
taskId,
messages: [lastMessage],
requestingWorkspaceUserId: user.workspaceUserId,
workspaceId: user.workspaceId,
customIdentifier: undefined,
});

if (typeof result === 'string' || Array.isArray(result)) {
return response.status(200).json(result);
} else {
return result.pipeDataStreamToResponse(response);
try {
const lastMessage = data.messages[data.messages.length - 1];

const result = await this.tasksService.messageTaskOrCreateTaskIfNotFound({
agentId,
taskId,
messages: [lastMessage],
requestingWorkspaceUserId: user.workspaceUserId,
workspaceId: user.workspaceId,
customIdentifier: undefined,
});

if (typeof result === 'string' || Array.isArray(result)) {
return response.status(200).json(result);
} else {
return result.pipeDataStreamToResponse(response);
}
} catch (error) {
return response.status(500).json({ error: error.message });
}
}
}

0 comments on commit 206de7d

Please sign in to comment.