@hyperdrive.bot/paseo-protocol 0.3.16 → 0.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/messages.js +12 -0
- package/package.json +1 -1
package/dist/messages.js
CHANGED
|
@@ -1058,7 +1058,19 @@ function normalizeAgentAttachments(input) {
|
|
|
1058
1058
|
const parsed = AgentAttachmentSchema.safeParse(item);
|
|
1059
1059
|
if (parsed.success) {
|
|
1060
1060
|
normalized.push(parsed.data);
|
|
1061
|
+
continue;
|
|
1061
1062
|
}
|
|
1063
|
+
// Never drop an attachment without saying so. A malformed entry used to
|
|
1064
|
+
// disappear here silently: `attachments` became `[]`, the downstream
|
|
1065
|
+
// fail-closed gate short-circuited on the empty list, and the agent got a
|
|
1066
|
+
// bare-text prompt with no hint that the user had attached anything. That
|
|
1067
|
+
// failure mode is indistinguishable from "the user attached nothing", so it
|
|
1068
|
+
// costs hours to diagnose from either end. Report the discriminator and the
|
|
1069
|
+
// Zod issues; the caller decides whether to reject.
|
|
1070
|
+
const attachmentType = typeof item === "object" && item !== null && "type" in item
|
|
1071
|
+
? String(item.type)
|
|
1072
|
+
: "<missing>";
|
|
1073
|
+
console.warn(`[protocol] dropping unparseable agent attachment (type: ${attachmentType}):`, parsed.error.issues);
|
|
1062
1074
|
}
|
|
1063
1075
|
return normalized;
|
|
1064
1076
|
}
|