Add messages support to runAgent for multi-turn bot conversations (#23395)

- Extend `runAgent` so callers can pass either a one-shot prompt or a
multi-turn messages array (user / assistant text), matching AI SDK’s XOR
shape — for Slack/Discord/Teams bots that need thread history.
- Enforce exactly one of prompt | messages in AgentRunService; map
messages 1:1 to AI SDK ModelMessages in AgentAsyncExecutorService
- Update shared types, GraphQL/SDK inputs, docs (skills-and-agents), and
regenerate metadata clients; existing prompt-only callers stay unchanged

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/23395?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
This commit is contained in:
Abdul Rahman
2026-08-05 13:50:12 +05:30
committed by GitHub
parent 0b817e3bc0
commit ded3f1efb3
17 changed files with 394 additions and 67 deletions
@@ -4703,7 +4703,18 @@ input CreateEmailingDomainInput {
input RunAgentInput {
agentUniversalIdentifier: String!
prompt: String!
prompt: String
messages: [RunAgentMessageInput!]
}
input RunAgentMessageInput {
role: RunAgentMessageRole!
content: String!
}
enum RunAgentMessageRole {
user
assistant
}
input CreateWebhookInput {
@@ -3189,6 +3189,8 @@ export interface Mutation {
export type FileFolder = 'CorePicture' | 'AgentChat' | 'BuiltLogicFunction' | 'BuiltFrontComponent' | 'PublicAsset' | 'Source' | 'FilesField' | 'Dependencies' | 'Workflow' | 'EmailAttachment' | 'AppTarball' | 'GeneratedSdkClient' | 'Dpa'
export type RunAgentMessageRole = 'user' | 'assistant'
export type AnalyticsType = 'PAGEVIEW' | 'TRACK'
export interface Subscription {
@@ -6897,7 +6899,9 @@ export interface UpdateEmailGroupChannelInput {id: Scalars['UUID'],displayName?:
export interface CreateEmailingDomainInput {domain: Scalars['String']}
export interface RunAgentInput {agentUniversalIdentifier: Scalars['String'],prompt: Scalars['String']}
export interface RunAgentInput {agentUniversalIdentifier: Scalars['String'],prompt?: (Scalars['String'] | null),messages?: (RunAgentMessageInput[] | null)}
export interface RunAgentMessageInput {role: RunAgentMessageRole,content: Scalars['String']}
export interface CreateWebhookInput {id?: (Scalars['UUID'] | null),targetUrl: Scalars['String'],operations: Scalars['String'][],description?: (Scalars['String'] | null),secret?: (Scalars['String'] | null)}
@@ -9860,6 +9864,11 @@ export const enumFileFolder = {
Dpa: 'Dpa' as const
}
export const enumRunAgentMessageRole = {
user: 'user' as const,
assistant: 'assistant' as const
}
export const enumAnalyticsType = {
PAGEVIEW: 'PAGEVIEW' as const,
TRACK: 'TRACK' as const
@@ -89,7 +89,8 @@ export default {
372,
379,
380,
512
492,
514
],
"types": {
"BillingProductDTO": {
@@ -8836,7 +8837,7 @@ export default {
308,
{
"input": [
491,
493,
"CreateWebhookInput!"
]
}
@@ -8845,7 +8846,7 @@ export default {
308,
{
"input": [
492,
494,
"UpdateWebhookInput!"
]
}
@@ -8863,7 +8864,7 @@ export default {
349,
{
"input": [
494,
496,
"UpdateMessageFolderInput!"
]
}
@@ -8872,7 +8873,7 @@ export default {
349,
{
"input": [
496,
498,
"UpdateMessageFoldersInput!"
]
}
@@ -8881,7 +8882,7 @@ export default {
344,
{
"input": [
497,
499,
"UpdateCalendarChannelInput!"
]
}
@@ -8890,7 +8891,7 @@ export default {
342,
{
"input": [
499,
501,
"SetAppKeyValueInput!"
]
}
@@ -8911,7 +8912,7 @@ export default {
341,
{
"input": [
500,
502,
"EnqueueJobInput!"
]
}
@@ -8941,7 +8942,7 @@ export default {
1
],
"fileAttachments": [
501,
503,
"[FileAttachmentInput!]"
]
}
@@ -8970,7 +8971,7 @@ export default {
"UUID!"
],
"answers": [
502,
504,
"[AgentChatQuestionAnswerInput!]!"
],
"modelId": [
@@ -9048,7 +9049,7 @@ export default {
327,
{
"input": [
503,
505,
"CreateSkillInput!"
]
}
@@ -9057,7 +9058,7 @@ export default {
327,
{
"input": [
504,
506,
"UpdateSkillInput!"
]
}
@@ -9115,7 +9116,7 @@ export default {
255,
{
"input": [
505,
507,
"GetAuthorizationUrlForSSOInput!"
]
}
@@ -9281,7 +9282,7 @@ export default {
258,
{
"input": [
506
508
]
}
],
@@ -9456,7 +9457,7 @@ export default {
3,
{
"input": [
507,
509,
"UpdateWorkspaceMemberSettingsInput!"
]
}
@@ -9490,7 +9491,7 @@ export default {
213,
{
"input": [
508,
510,
"SetupOIDCSsoInput!"
]
}
@@ -9499,7 +9500,7 @@ export default {
213,
{
"input": [
509,
511,
"SetupSAMLSsoInput!"
]
}
@@ -9508,7 +9509,7 @@ export default {
209,
{
"input": [
510,
512,
"DeleteSsoInput!"
]
}
@@ -9517,7 +9518,7 @@ export default {
210,
{
"input": [
511,
513,
"EditSsoInput!"
]
}
@@ -9546,7 +9547,7 @@ export default {
323,
{
"type": [
512,
514,
"AnalyticsType!"
],
"name": [
@@ -9589,7 +9590,7 @@ export default {
313,
{
"input": [
513,
515,
"CreateCalendarEventInput!"
]
}
@@ -9598,7 +9599,7 @@ export default {
322,
{
"input": [
514,
516,
"SendEmailInput!"
]
}
@@ -9620,7 +9621,7 @@ export default {
"String!"
],
"connectionParameters": [
516,
518,
"EmailAccountConnectionParameters!"
],
"id": [
@@ -9632,7 +9633,7 @@ export default {
173,
{
"input": [
518,
520,
"UpdateLabPublicFeatureFlagInput!"
]
}
@@ -12037,10 +12038,25 @@ export default {
"prompt": [
1
],
"messages": [
491
],
"__typename": [
1
]
},
"RunAgentMessageInput": {
"role": [
492
],
"content": [
1
],
"__typename": [
1
]
},
"RunAgentMessageRole": {},
"CreateWebhookInput": {
"id": [
4
@@ -12066,7 +12082,7 @@ export default {
4
],
"update": [
493
495
],
"__typename": [
1
@@ -12094,7 +12110,7 @@ export default {
4
],
"update": [
495
497
],
"__typename": [
1
@@ -12113,7 +12129,7 @@ export default {
4
],
"update": [
495
497
],
"__typename": [
1
@@ -12124,7 +12140,7 @@ export default {
4
],
"update": [
498
500
],
"__typename": [
1
@@ -12409,7 +12425,7 @@ export default {
1
],
"files": [
515
517
],
"__typename": [
1
@@ -12431,13 +12447,13 @@ export default {
1
],
"IMAP": [
517
519
],
"SMTP": [
517
519
],
"CALDAV": [
517
519
],
"__typename": [
1
@@ -12488,7 +12504,7 @@ export default {
243,
{
"input": [
520,
522,
"LogicFunctionLogsInput!"
]
}