@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/index.js CHANGED
@@ -1307,10 +1307,14 @@ function buildRequestBody(context, modelDef) {
1307
1307
  visionFiltering
1308
1308
  };
1309
1309
  }
1310
- function buildProviderRequest(context, modelDef, signal) {
1310
+ function buildProviderRequest(context, modelDef, signal, user) {
1311
1311
  const { requestBody } = buildRequestBody(context, modelDef);
1312
1312
  return {
1313
1313
  ...requestBody,
1314
+ // Stable per-thread identity: providers that support it (OpenRouter's
1315
+ // provider-sticky routing) pin the thread to one upstream, which is what
1316
+ // makes prompt caching hit across consecutive steps.
1317
+ user,
1314
1318
  signal
1315
1319
  };
1316
1320
  }
@@ -1657,7 +1661,7 @@ var init_LLMRequest = __esm({
1657
1661
  parentSignal.addEventListener("abort", onParentAbort, { once: true });
1658
1662
  }
1659
1663
  }
1660
- const request = buildProviderRequest(context, modelDef, streamAbort.signal);
1664
+ const request = buildProviderRequest(context, modelDef, streamAbort.signal, state.threadId);
1661
1665
  let response;
1662
1666
  await state.stream.waitFor(
1663
1667
  async () => {