openzoo 0.36.0 → 0.36.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.
Files changed (2) hide show
  1. package/lib/gui.html +15 -2
  2. package/package.json +1 -1
package/lib/gui.html CHANGED
@@ -172,10 +172,23 @@ async function send() {
172
172
  if (state.ctx) headers["x-hrr-context"] = state.ctx;
173
173
  const r = await fetch("/v1/chat/completions", {
174
174
  method: "POST", headers,
175
- body: JSON.stringify({ model: $("model").value, messages: state.messages, max_tokens: 2048 }),
175
+ // reasoning models bill their thinking inside max_tokens 2048 bought
176
+ // a whole essay of invisible reasoning and zero visible words (measured
177
+ // live: deepseek, finish_reason "length", empty content, $0.0172)
178
+ body: JSON.stringify({
179
+ model: $("model").value,
180
+ messages: state.messages,
181
+ max_tokens: /deepseek|grok|thinking|fable|sonnet-5|-r1|reason/i.test($("model").value) ? 16384 : 4096,
182
+ }),
176
183
  });
177
184
  const d = await r.json();
178
- const content = d.choices?.[0]?.message?.content || d.error?.message || JSON.stringify(d).slice(0, 300);
185
+ const ch = d.choices?.[0];
186
+ let content = ch?.message?.content || "";
187
+ if (!content && ch?.finish_reason === "length") {
188
+ content = "🦥 the animal thought so hard it ran out of room before saying anything. try again — the cage just got bigger.";
189
+ } else if (!content) {
190
+ content = d.error?.message || "🦉 the zoo returned something unusual: " + JSON.stringify(d).slice(0, 200);
191
+ }
179
192
  thinking.textContent = content;
180
193
  state.messages.push({ role: "assistant", content });
181
194
  const x = d.x402 || {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.36.0",
3
+ "version": "0.36.1",
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",