Revert "fix: ensure that tool attachments arent sent as user messages (#8944)"

This reverts commit 8fd1b92e6e.
This commit is contained in:
Aiden Cline
2026-01-16 15:49:39 -06:00
parent 6e00348bd7
commit f5a6a4af7f
3 changed files with 43 additions and 89 deletions

View File

@@ -597,7 +597,7 @@ export namespace SessionPrompt {
sessionID,
system: [...(await SystemPrompt.environment()), ...(await SystemPrompt.custom())],
messages: [
...MessageV2.toModelMessage(sessionMessages, { tools }),
...MessageV2.toModelMessage(sessionMessages),
...(isLastStep
? [
{
@@ -718,22 +718,8 @@ export namespace SessionPrompt {
},
toModelOutput(result) {
return {
type: "content",
value: [
{
type: "text",
text: result.output,
},
...(result.attachments?.map((attachment: MessageV2.FilePart) => {
const base64 = attachment.url.startsWith("data:") ? attachment.url.split(",", 2)[1] : attachment.url
return {
type: "media",
data: base64,
mediaType: attachment.mime,
}
}) ?? []),
],
type: "text",
value: result.output,
}
},
})
@@ -822,22 +808,8 @@ export namespace SessionPrompt {
}
item.toModelOutput = (result) => {
return {
type: "content",
value: [
{
type: "text",
text: result.output,
},
...(result.attachments?.map((attachment: MessageV2.FilePart) => {
const base64 = attachment.url.startsWith("data:") ? attachment.url.split(",", 2)[1] : attachment.url
return {
type: "media",
data: base64,
mediaType: attachment.mime,
}
}) ?? []),
],
type: "text",
value: result.output,
}
}
tools[key] = item