openzoo 0.48.35 → 0.48.36

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/proxy.js +14 -3
  2. package/package.json +1 -1
package/lib/proxy.js CHANGED
@@ -385,12 +385,23 @@ async function spillTranscript(body, log) {
385
385
  let bind;
386
386
  if (prior && corpus.startsWith(prior.corpus) && corpus.length > prior.corpus.length) {
387
387
  const delta = corpus.slice(prior.corpus.length);
388
- await bindCorpus(delta, {
388
+ // FIRE AND FORGET. This delta is history for FUTURE turns — the answer
389
+ // being generated right now is served from the tail plus what is already
390
+ // bound, so waiting on the upload buys nothing and costs the user the
391
+ // round trip on every single turn. The context id is already known, so
392
+ // nothing is lost by not waiting for it.
393
+ //
394
+ // The FIRST bind is deliberately NOT async: the request must carry
395
+ // x-hrr-context, and that id does not exist until the bind returns. Firing
396
+ // that one off would send the opening turn with no context at all — a
397
+ // silently worse answer traded for a shorter pause, which is the wrong way
398
+ // round.
399
+ void bindCorpus(delta, {
389
400
  appendTo: prior.contextId,
390
401
  onStage: (stage, info) => {
391
- if (stage === 'binding') log(`appending ${mb(info.bytes)}MB to ${prior.contextId} (delta only)`);
402
+ if (stage === 'binding') log(`appending ${mb(info.bytes)}MB to ${prior.contextId} (delta, background)`);
392
403
  },
393
- });
404
+ }).catch((e) => log(`append failed (history may lag one turn): ${e.message}`));
394
405
  bind = { contextId: prior.contextId, hash: prior.hash, reused: true, bytes: delta.length };
395
406
  } else {
396
407
  bind = await bindCorpus(corpus, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.48.35",
3
+ "version": "0.48.36",
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",