@askalf/dario 5.5.52 → 5.5.53

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.
@@ -1619,6 +1619,26 @@ export function buildCCRequest(clientBody, billingTag, cacheControl, identity, o
1619
1619
  messages.splice(i, 1);
1620
1620
  }
1621
1621
  }
1622
+ // A TRAILING assistant turn the filter emptied is dropped too — content: []
1623
+ // at the end reads as a prefill upstream, which Opus under adaptive thinking
1624
+ // + the claude-code beta refuses outright. This is a copy of the trailing
1625
+ // drop further down (which must ALSO stay there, running after the general
1626
+ // path's thinking strip — the shape it was written for); the copy exists so
1627
+ // the genuine-CC early return inherits it (dario#1077 follow-up: stage 3 of
1628
+ // 3, the "failure moves rather than disappears" case). Same constraints as
1629
+ // the original: assistant turns ONLY — popping an empty final user turn
1630
+ // would convert an honest "content must contain at least one block" into a
1631
+ // misleading prefill rejection (dario#1033), and popping a NON-empty
1632
+ // trailing assistant is the OpenClaw runaway loop (#37). Idempotent, so
1633
+ // running it twice on the general path changes nothing.
1634
+ while (messages.length > 0) {
1635
+ const last = messages[messages.length - 1];
1636
+ if (last.role === 'assistant' && Array.isArray(last.content) && last.content.length === 0) {
1637
+ messages.pop();
1638
+ continue;
1639
+ }
1640
+ break;
1641
+ }
1622
1642
  // ── Genuine Claude Code client → byte-faithful passthrough ──
1623
1643
  // A real CC request already IS the CC wire shape. Replacing its system
1624
1644
  // prompt with the template (prepending ~25KB per request shape) and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askalf/dario",
3
- "version": "5.5.52",
3
+ "version": "5.5.53",
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": {