fix(session): use typed message reads in tools (#27280)

This commit is contained in:
Shoubhit Dash
2026-05-13 14:12:51 +05:30
committed by GitHub
parent 596f241db5
commit b0dc8e4638
3 changed files with 7 additions and 11 deletions

View File

@@ -86,7 +86,7 @@ export const TaskTool = Tool.define(
],
}))
const msg = yield* Effect.sync(() => MessageV2.get({ sessionID: ctx.sessionID, messageID: ctx.messageID }))
const msg = yield* MessageV2.getEffect({ sessionID: ctx.sessionID, messageID: ctx.messageID }).pipe(Effect.orDie)
if (msg.info.role !== "assistant") return yield* Effect.fail(new Error("Not an assistant message"))
const model = next.model ?? {