openzoo 0.50.81 → 0.50.82

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.
@@ -1633,6 +1633,19 @@ function entryPlainText(v) {
1633
1633
  * Lossless fold: texts joined with a blank line; tool turns never crossed.
1634
1634
  */
1635
1635
  export function foldSameRole(messages) {
1636
+ // Assistant turns stored from the raw upstream object carry refusal:null,
1637
+ // reasoning, annotations… Bisected 2026-09-02: that one message drew
1638
+ // "Invalid model provider request" from the abliteration lane with every
1639
+ // other message shrunk to 300 chars. Keep the four keys every provider takes.
1640
+ const ASSISTANT_KEYS = new Set(['role', 'content', 'tool_calls', 'name']);
1641
+ messages = (Array.isArray(messages) ? messages : []).map((m) => {
1642
+ if (!m || m.role !== 'assistant') return m;
1643
+ const out = {};
1644
+ for (const [k, v] of Object.entries(m)) if (ASSISTANT_KEYS.has(k)) out[k] = v;
1645
+ if (out.content === undefined && !out.tool_calls) out.content = '';
1646
+ if (out.content === null && out.tool_calls) delete out.content;
1647
+ return out;
1648
+ });
1636
1649
  const out = [];
1637
1650
  // An assistant entry with no content and no tool_calls (a failed/empty turn
1638
1651
  // recorded on the canvas) is invalid for every OpenAI-compatible provider:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.50.81",
3
+ "version": "0.50.82",
4
4
  "description": "Local x402-paying proxy + MCP server for openzoo.fun — point any OpenAI-compatible harness (Cursor, Claude Code, aider, SDKs) at localhost and it pays per call from a local burner wallet. Solana and Base rails live; Robinhood experimental.",
5
5
  "license": "MIT",
6
6
  "type": "module",