openzoo 0.48.65 → 0.48.66

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/anthropic.js +20 -0
  2. package/package.json +1 -1
package/lib/anthropic.js CHANGED
@@ -240,6 +240,26 @@ export function streamOpenAIToAnthropic(res, upstream, requestedModel, onReceipt
240
240
  if (!ch) return;
241
241
  start();
242
242
  const delta = ch.delta ?? {};
243
+ // A REASONING CHUNK IS NOT A SILENT CHUNK.
244
+ //
245
+ // Only `delta.content` produced output here, so a reasoning model emitted
246
+ // NOTHING on the socket for the whole time it was thinking. fable reasons
247
+ // before it answers — measured at 53 completion tokens to say one word — so
248
+ // a real turn is minutes of zero bytes, and any hop in between is entitled
249
+ // to drop a connection that has gone idle.
250
+ //
251
+ // OBSERVED: a fable turn rendering as "I'll ground this in your own context
252
+ // first (holo), scout the monorepo layout, then f" and stopping mid-word.
253
+ // Claude Code 2.1.232 PRESERVES partial responses on a mid-stream drop
254
+ // instead of erroring, which is why this reads as "empty/truncated output"
255
+ // rather than as the connection failure it is.
256
+ //
257
+ // `ping` is in Anthropic's own SSE grammar and carries no content, so a
258
+ // client either ignores it or treats it as liveness — never as text.
259
+ if (!(typeof delta.content === 'string' && delta.content.length)
260
+ && !(delta.tool_calls ?? []).length) {
261
+ ev('ping', {});
262
+ }
243
263
  if (typeof delta.content === 'string' && delta.content.length) {
244
264
  if (textIndex < 0) {
245
265
  textIndex = nextIndex++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.48.65",
3
+ "version": "0.48.66",
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",