dsh-wsr-execution 0.2.7 → 0.2.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-wsr-execution",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "DeepSeek Harness adapter bundle for WSR Intake, Delivery resources, Session state, Actions, and final results.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -271,7 +271,16 @@ export async function createPluginRuntime(config, options = {}) {
271
271
  const ownerProjection = options.ownerProjection ?? api.getExecutionControlPlaneProjection(application);
272
272
  const bindingInventory = () => typeof control.bindingInventory === "function" ? control.bindingInventory() : control.list();
273
273
  const archiveTerminal = async (sessionKey, correlation, deliveryId) => {
274
- const snapshot = await ownerProjection.snapshot();
274
+ let snapshot;
275
+ for (let attempt = 0; attempt < 100; attempt += 1) {
276
+ try {
277
+ snapshot = await ownerProjection.snapshot();
278
+ break;
279
+ } catch (cause) {
280
+ if (cause?.code !== "DELIVERY_PROJECTION_STALE_BINDING" || attempt === 99) throw cause;
281
+ await new Promise((resolve) => setTimeout(resolve, 10));
282
+ }
283
+ }
275
284
  const matches = snapshot.deliveries.filter((delivery) => delivery.lifecycle === "TERMINAL"
276
285
  && delivery.navigation?.sessionCorrelation === correlation
277
286
  && (deliveryId === undefined || delivery.deliveryId === deliveryId));