From 63c760860ed1f0c7d76a66d54f4137272bbde236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Tue, 30 Jun 2026 22:00:56 -0400 Subject: [PATCH] Tell agents about available external tools in system prompt When Composio tools are loaded for an agent run, the system prompt now mentions their count and purpose so the agent knows it can interact with external services like GitHub, Slack, and Gmail. --- AgentCompany-New/src/main/services/task-execution-service.ts | 2 +- AgentCompany-New/src/main/services/task-prompts.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/AgentCompany-New/src/main/services/task-execution-service.ts b/AgentCompany-New/src/main/services/task-execution-service.ts index 8d9aa9c8..aba970b9 100644 --- a/AgentCompany-New/src/main/services/task-execution-service.ts +++ b/AgentCompany-New/src/main/services/task-execution-service.ts @@ -135,7 +135,7 @@ export class TaskExecutionService { orgId, providerId: provider.id, workspaceId: task.workspace_id, - instructions: buildAgentInstructions({ agent, companyName: this.orgName(orgId), isCeo, hasReports }), + instructions: buildAgentInstructions({ agent, companyName: this.orgName(orgId), isCeo, hasReports, externalToolCount: externalTools.length }), initialUserTurn: buildTaskPrompt({ task, agent, diff --git a/AgentCompany-New/src/main/services/task-prompts.ts b/AgentCompany-New/src/main/services/task-prompts.ts index 931c4ca4..4a1f75bd 100644 --- a/AgentCompany-New/src/main/services/task-prompts.ts +++ b/AgentCompany-New/src/main/services/task-prompts.ts @@ -74,10 +74,9 @@ export interface ChatContextBlock { export interface AgentInstructionContext { agent: TaskExecutionAgentRow; companyName: string; - /** True when the agent sits at the top of the org (the CEO). */ isCeo: boolean; - /** True when the agent leads at least one direct report. */ hasReports: boolean; + externalToolCount: number; } /** @@ -92,7 +91,7 @@ export function buildAgentInstructions(input: AgentInstructionContext): string { `You are ${agent.name}, ${agent.title || agent.role} in ${agent.department} at ${input.companyName}. You are a real member of this company with your own judgment and voice — a colleague, not a generic assistant.`, roleVoice(input), "Work like a sharp person: take in what is actually in front of you, decide the smallest real next step, do it, then tell whoever needs to know. Do not narrate busywork.", - "Your tools are how you act: hire_agent builds your team, create_task delegates and assigns work by name, update_task_status tracks it, write_deliverable produces real files, create_document writes versioned company documents (PRDs, specs, memos, reports), read_messages catches you up on what teammates said, and send_message is how you talk to everyone.", + `Your tools are how you act: hire_agent builds your team, create_task delegates and assigns work by name, update_task_status tracks it, write_deliverable produces real files, create_document writes versioned company documents (PRDs, specs, memos, reports), read_messages catches you up on what teammates said, and send_message is how you talk to everyone.${input.externalToolCount > 0 ? ` You also have ${input.externalToolCount} external tools (composio_* prefixed) for interacting with services like GitHub, Slack, Gmail, etc. — use them when your work involves those platforms.` : ""}`, "Talk like a person on a team, not a status bot: address teammates by @name, say what you genuinely think, ask when you are unsure, and reply when someone asks you something. Before starting work, check your messages with read_messages to see if anyone needs you. Post where the work lives — 'engineering', 'product', or otherwise 'general' — and keep a back-and-forth in one thread by passing the thread_id a previous send_message returned. Hand work to a teammate with /handoff @Name and the file_id write_deliverable gives you.", ].join("\n"); }