Show tool execution messages in AI agent chat (#13117)

https://github.com/user-attachments/assets/c0a42726-50ac-496e-a993-9d6076a84a6a

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
Abdul Rahman
2025-07-10 11:15:05 +05:30
committed by GitHub
parent e6cdae5c27
commit 8310b4ff01
62 changed files with 1304 additions and 227 deletions
@@ -616,14 +616,16 @@ export class WorkflowVersionStepWorkspaceService {
};
}
case WorkflowActionType.AI_AGENT: {
const newAgent = await this.agentService.createOneAgent(
const newAgent = await this.agentService.createOneAgentAndFirstThread(
{
name: 'AI Agent Workflow Step',
label: 'AI Agent Workflow Step',
name: 'ai-agent-workflow',
description: 'Created automatically for workflow step',
prompt: '',
modelId: 'gpt-4o',
modelId: 'auto',
},
workspaceId,
this.scopedWorkspaceContextFactory.create().userWorkspaceId,
);
if (!isDefined(newAgent)) {
@@ -636,15 +638,13 @@ export class WorkflowVersionStepWorkspaceService {
const userWorkspaceId =
this.scopedWorkspaceContextFactory.create().userWorkspaceId;
if (!userWorkspaceId) {
throw new WorkflowVersionStepException(
'User workspace ID not found',
WorkflowVersionStepExceptionCode.FAILURE,
if (userWorkspaceId) {
await this.agentChatService.createThread(
newAgent.id,
userWorkspaceId,
);
}
await this.agentChatService.createThread(newAgent.id, userWorkspaceId);
return {
id: newStepId,
name: 'AI Agent',