@askalf/dario 3.10.0 → 3.10.1
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/cc-template.js +20 -0
- package/package.json +1 -1
package/dist/cc-template.js
CHANGED
|
@@ -291,6 +291,26 @@ export function buildCCRequest(clientBody, billingTag, cache1h, identity, opts =
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
+
// ── Drop trailing empty/assistant turns ──
|
|
295
|
+
// An assistant turn that was thinking-only before the strip above becomes
|
|
296
|
+
// content: []. Forwarding that shape makes Anthropic interpret the request
|
|
297
|
+
// as a prefill ("continue from this assistant text"), which Opus 4.6 under
|
|
298
|
+
// adaptive thinking + the claude-code beta refuses with:
|
|
299
|
+
// "This model does not support assistant message prefill. The
|
|
300
|
+
// conversation must end with a user message."
|
|
301
|
+
// Clients that preserve full thinking in history (OpenClaw, Hermes) hit
|
|
302
|
+
// this any time a prior turn was interrupted mid-thinking. Drop trailing
|
|
303
|
+
// assistant/empty turns so the request ends on a user message.
|
|
304
|
+
while (messages.length > 0) {
|
|
305
|
+
const last = messages[messages.length - 1];
|
|
306
|
+
const contentEmpty = Array.isArray(last.content) && last.content.length === 0;
|
|
307
|
+
const isTrailingAssistant = last.role === 'assistant';
|
|
308
|
+
if (contentEmpty || isTrailingAssistant) {
|
|
309
|
+
messages.pop();
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
294
314
|
// ── Build tool mapping ──
|
|
295
315
|
// In preserveTools mode, skip the tool name/arg rewriting entirely.
|
|
296
316
|
// Tool routing in real agents requires bidirectional schema fidelity that
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.1",
|
|
4
4
|
"description": "A local LLM router. One endpoint, every provider — Claude subscriptions, OpenAI, OpenRouter, Groq, local LiteLLM, any OpenAI-compat endpoint — your tools don't need to change.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|