fix(agent): use current comment ID for media tools in subsequent turns of a session

This commit is contained in:
yiling
2026-06-05 23:41:58 +08:00
parent 49f010ca85
commit b56d880d33
4 changed files with 62 additions and 1 deletions
+4 -1
View File
@@ -25,6 +25,7 @@ export interface CreateAgentSessionParams {
allowedDomains: string[]
sessionId?: string
userId?: string
userCommentId?: string | null
customTools?: AgentTool[]
providers: Array<{
name: string
@@ -47,6 +48,7 @@ export async function createAgentSession(params: CreateAgentSessionParams) {
allowedDomains,
sessionId,
userId,
userCommentId: passedUserCommentId,
customTools = [],
} = params
@@ -156,7 +158,8 @@ export async function createAgentSession(params: CreateAgentSessionParams) {
const metadata = await storage.getMetadata()
const assetId = metadata.assetId
const userCommentId = metadata.userCommentId
const userCommentId =
passedUserCommentId !== undefined ? passedUserCommentId : metadata.userCommentId
const mediaTools: AgentTool[] = []
if (assetId) {