Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 3ad23d5

Browse files
Fix: calling execute tasks is failing in AI agent
1 parent fa172bd commit 3ad23d5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

apps/webapp/src/modules/ai/conversation-item.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { defaultExtensions } from '@tegonhq/ui/components/ui/editor/editor-exten
44
import { AI } from '@tegonhq/ui/icons';
55
import { Editor } from '@tiptap/core';
66
import { observer } from 'mobx-react-lite';
7+
import getConfig from 'next/config';
78
import React, { useEffect, useRef } from 'react';
89

910
import type { ConversationHistoryType } from 'common/types';
@@ -20,6 +21,8 @@ interface AIConversationItemProps {
2021
conversationHistory: ConversationHistoryType;
2122
}
2223

24+
const { publicRuntimeConfig } = getConfig();
25+
2326
export const ConversationItem = observer(
2427
({ conversationHistory }: AIConversationItemProps) => {
2528
const { user } = useUserData(conversationHistory.userId);
@@ -74,6 +77,7 @@ export const ConversationItem = observer(
7477
variant="secondary"
7578
onClick={() => {
7679
runTasks({
80+
baseHost: publicRuntimeConfig.NEXT_PUBLIC_AI_HOST,
7781
conversationId: conversationHistory.conversationId,
7882
conversationHistoryId: conversationHistory.id,
7983
workspaceId: workspace.id,

apps/webapp/src/services/conversations/run-tasks.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ interface MutationParams {
88
onError?: (error: any) => void;
99
}
1010
interface RunTasksProps {
11+
baseHost: string;
1112
conversationId: string;
1213
conversationHistoryId: string;
1314
taskIds: string[];
1415
workspaceId: string;
1516
}
1617

1718
const runTasks = async ({
19+
baseHost,
1820
conversationId,
1921
conversationHistoryId,
2022
taskIds,
2123
workspaceId,
2224
}: RunTasksProps) => {
2325
return axios({
24-
url: `http://localhost:2000/chat`,
26+
url: `${baseHost}/chat`,
2527
withCredentials: true,
2628
method: 'Post',
2729
data: {

0 commit comments

Comments
 (0)