@standardagents/builder 0.24.3 → 0.24.4

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/runtime.js CHANGED
@@ -1298,10 +1298,14 @@ function buildRequestBody(context, modelDef) {
1298
1298
  visionFiltering
1299
1299
  };
1300
1300
  }
1301
- function buildProviderRequest(context, modelDef, signal) {
1301
+ function buildProviderRequest(context, modelDef, signal, user) {
1302
1302
  const { requestBody } = buildRequestBody(context, modelDef);
1303
1303
  return {
1304
1304
  ...requestBody,
1305
+ // Stable per-thread identity: providers that support it (OpenRouter's
1306
+ // provider-sticky routing) pin the thread to one upstream, which is what
1307
+ // makes prompt caching hit across consecutive steps.
1308
+ user,
1305
1309
  signal
1306
1310
  };
1307
1311
  }
@@ -1648,7 +1652,7 @@ var init_LLMRequest = __esm({
1648
1652
  parentSignal.addEventListener("abort", onParentAbort, { once: true });
1649
1653
  }
1650
1654
  }
1651
- const request = buildProviderRequest(context, modelDef, streamAbort.signal);
1655
+ const request = buildProviderRequest(context, modelDef, streamAbort.signal, state.threadId);
1652
1656
  let response;
1653
1657
  await state.stream.waitFor(
1654
1658
  async () => {