Skip to content

Commit 80d05b0

Browse files
committed
refactor: update messaging and improve tool descriptions
- Translated and refined messages in ask.service.ts for clarity and consistency. - Enhanced tool descriptions in tools.constants.ts to provide detailed output formats and insights. - Updated user prompts in frontend components for better user experience and engagement. - Improved loading state management in EditMemberModal, EditProfileModal, and TaskModal for better feedback during operations.
1 parent cac4f41 commit 80d05b0

File tree

14 files changed

+1045
-437
lines changed

14 files changed

+1045
-437
lines changed

backend/src/ai-agent/ask.service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class AskService {
3636
if (socket) {
3737
socket.emit("ai_thinking", {
3838
type: "tool_call",
39-
message: `🤖 CommitFlow memproses permintaan tool: ${tool}`,
39+
message: `🤖 CommitFlow is processing the tool request: ${tool}`,
4040
tool,
4141
args,
4242
});
@@ -51,7 +51,7 @@ export class AskService {
5151
if (socket) {
5252
socket.emit("ai_thinking", {
5353
type: "tool_result",
54-
message: `📊 Hasil tool ${tool} siap.`,
54+
message: `📊 Tool result for ${tool} is ready.`,
5555
tool,
5656
result,
5757
});
@@ -62,7 +62,7 @@ export class AskService {
6262
if (socket) {
6363
socket.emit("ai_thinking", {
6464
type: "done",
65-
message: `✅ Semua proses selesai.`,
65+
message: `✅ All processes completed.`,
6666
});
6767
}
6868
}
@@ -289,7 +289,7 @@ export class AskService {
289289

290290
messages.push({
291291
role: "system",
292-
content: "buatkan summary dari hasil tools call jika ada",
292+
content: "generate a summary of the tool call results if available",
293293
});
294294
// === At this point, modelMessage does NOT request tools anymore ===
295295
// Start SSE streaming final answer. Ensure we include tools & tool_choice
@@ -379,7 +379,7 @@ export class AskService {
379379
choices: [
380380
{
381381
delta: {
382-
content: `Terjadi kesalahan: ${
382+
content: `An error occurred: ${
383383
error?.message || String(error)
384384
}`,
385385
},

backend/src/ai-agent/project.service.ts

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -90,38 +90,19 @@ function baseTaskInclude() {
9090
};
9191
}
9292

93-
async function buildTaskWhere(
94-
userId: string,
95-
projectId?: string,
96-
status?: string
97-
) {
98-
const team = await prisma.teamMember.findMany({
99-
where: {
100-
userId,
101-
},
102-
});
103-
const workspaceIds = team.map((item: any) => item.workspaceId);
104-
const whereProject: any = {
105-
workspaceId: {
106-
in: workspaceIds,
107-
},
108-
};
93+
function buildTaskWhere(userId: string, projectId?: string, status?: string) {
94+
// Only filter by project (no cross-workspace lookup)
95+
const where: any = { isTrash: false };
96+
10997
if (projectId) {
110-
whereProject.id = projectId;
98+
// Directly filter tasks by the given project id
99+
where.projectId = projectId;
111100
}
112101

113-
const projects = await prisma.project.findMany({
114-
where: whereProject,
115-
});
116-
117-
const projectIds = projects.map((item: any) => item.id);
102+
if (status) {
103+
where.status = status;
104+
}
118105

119-
const where: any = { isTrash: false };
120-
if (projectId)
121-
where.projectId = {
122-
in: projectIds,
123-
};
124-
if (status) where.status = status;
125106
return where;
126107
}
127108

0 commit comments

Comments
 (0)