fix(team-mode): keep member communication tools visible

This commit is contained in:
YeonGyu-Kim
2026-05-10 12:54:16 +09:00
parent 1e4a51e21b
commit b36389ef2c
5 changed files with 82 additions and 37 deletions
+15 -5
View File
@@ -28,6 +28,7 @@ export function isAgentNotFoundError(error: unknown): boolean {
export function buildFallbackBody(
originalBody: Record<string, unknown>,
fallbackAgent: string,
options: { includeTeamToolDenylist?: boolean } = {},
): Record<string, unknown> {
return {
...originalBody,
@@ -36,7 +37,7 @@ export function buildFallbackBody(
task: false,
call_omo_agent: true,
question: false,
...getAgentToolRestrictions(fallbackAgent),
...getAgentToolRestrictions(fallbackAgent, options),
},
}
}
@@ -60,6 +61,7 @@ export function createTask(input: LaunchInput): BackgroundTask {
agent: input.agent,
parentSessionId: input.parentSessionId,
parentMessageId: input.parentMessageId,
teamRunId: input.teamRunId,
parentModel: input.parentModel,
parentAgent: input.parentAgent,
model: input.model,
@@ -160,7 +162,9 @@ export async function startTask(
task: false,
call_omo_agent: true,
question: false,
...getAgentToolRestrictions(normalizedAgent),
...getAgentToolRestrictions(normalizedAgent, {
includeTeamToolDenylist: input.teamRunId === undefined,
}),
},
parts: [createInternalAgentTextPart(input.prompt)],
}
@@ -179,7 +183,9 @@ export async function startTask(
try {
await promptWithModelSuggestionRetry(client, {
path: { id: sessionID },
body: buildFallbackBody(promptBody, FALLBACK_AGENT),
body: buildFallbackBody(promptBody, FALLBACK_AGENT, {
includeTeamToolDenylist: input.teamRunId === undefined,
}),
})
task.agent = FALLBACK_AGENT
return
@@ -294,7 +300,9 @@ export async function resumeTask(
task: false,
call_omo_agent: true,
question: false,
...getAgentToolRestrictions(task.agent),
...getAgentToolRestrictions(task.agent, {
includeTeamToolDenylist: task.teamRunId === undefined,
}),
},
parts: [createInternalAgentTextPart(input.prompt)],
}
@@ -312,7 +320,9 @@ export async function resumeTask(
try {
await promptWithModelSuggestionRetry(client, {
path: { id: task.sessionId! },
body: buildFallbackBody(resumeBody, FALLBACK_AGENT),
body: buildFallbackBody(resumeBody, FALLBACK_AGENT, {
includeTeamToolDenylist: task.teamRunId === undefined,
}),
})
task.agent = FALLBACK_AGENT
return