@askalf/dario 5.5.73 → 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.
@@ -496,7 +496,7 @@ export declare function detectDrift(t: TemplateData, installedOverride?: string
496
496
  */
497
497
  export declare const SUPPORTED_CC_RANGE: {
498
498
  readonly min: "1.0.0";
499
- readonly maxTested: "2.1.246";
499
+ readonly maxTested: "2.1.247";
500
500
  };
501
501
  /**
502
502
  * Compare two dotted-numeric version strings. Returns negative if `a<b`,
@@ -1194,7 +1194,7 @@ export function detectDrift(t, installedOverride) {
1194
1194
  */
1195
1195
  export const SUPPORTED_CC_RANGE = {
1196
1196
  min: '1.0.0',
1197
- maxTested: '2.1.246',
1197
+ maxTested: '2.1.247',
1198
1198
  };
1199
1199
  /**
1200
1200
  * Compare two dotted-numeric version strings. Returns negative if `a<b`,
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 ? tail.content : undefined;
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.73",
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": {