@askalf/dario 5.5.74 → 5.5.75
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/proxy.js +17 -1
- package/package.json +1 -1
package/dist/proxy.js
CHANGED
|
@@ -662,8 +662,24 @@ export function sanitizeMessages(body, preserveTags) {
|
|
|
662
662
|
// drop below would expose an assistant turn, we put the original content
|
|
663
663
|
// back rather than ship a prefill (dario#1033) — see the guard after the
|
|
664
664
|
// filter for the reasoning.
|
|
665
|
+
//
|
|
666
|
+
// MUST be a deep clone when content is an array (dario#1117). `tail` is one
|
|
667
|
+
// of `messages`, and the per-block mutation loop just below rewrites each
|
|
668
|
+
// block's `.text` IN PLACE — so a bare `tail.content` reference here points
|
|
669
|
+
// at the SAME block objects the loop is about to scrub. "Restoring" it
|
|
670
|
+
// later then restores nothing: the array's length survives (the guard's
|
|
671
|
+
// `tailHadContent` check is length-based and stays fooled), but every
|
|
672
|
+
// block's text is already the post-scrub value, and any `cache_control` on
|
|
673
|
+
// that block rides along untouched. The restored tail then carries an empty
|
|
674
|
+
// text block WITH a live `cache_control` — a shape dario's own drop-filter
|
|
675
|
+
// exists to remove, and one Anthropic rejects outright with "cache_control
|
|
676
|
+
// cannot be set for empty text blocks", or (depending on what else sits in
|
|
677
|
+
// that position) a role-ordering 400 instead. Reproduced live against a
|
|
678
|
+
// background-subagent completion turn: dario#1117.
|
|
665
679
|
const tail = messages.length > 0 ? messages[messages.length - 1] : undefined;
|
|
666
|
-
const tailContentBeforeScrub = tail
|
|
680
|
+
const tailContentBeforeScrub = tail
|
|
681
|
+
? (Array.isArray(tail.content) ? structuredClone(tail.content) : tail.content)
|
|
682
|
+
: undefined;
|
|
667
683
|
for (const msg of messages) {
|
|
668
684
|
if (typeof msg.content === 'string') {
|
|
669
685
|
msg.content = sanitizeContent(msg.content, patterns);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.75",
|
|
4
4
|
"description": "Use your Claude Pro/Max subscription in any tool — Cursor, Cline, Aider, the Agent SDK, your scripts — at subscription pricing, not per-token API bills. One local Anthropic + OpenAI-compatible endpoint.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|