@tangle-network/agent-provider-tangle 3.6.7 → 3.6.9

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/README.md CHANGED
@@ -245,7 +245,7 @@ So `create()` can return a sandbox that reports `running` while the platform sti
245
245
 
246
246
  Composing an environment also reads the sandbox's deployment capability document once, and a sandbox that is not yet running cannot answer that read, so an environment composed during provisioning would claim nothing for the rest of its life.
247
247
 
248
- `readyTimeoutMs` bounds the wait and defaults to `DEFAULT_TANGLE_READY_TIMEOUT_MS` (120 seconds, the Sandbox SDK's own default).
248
+ `readyTimeoutMs` is passed to the HTTP `Sandbox.create` request, including a cold image pull, and also bounds the subsequent wait for `running`. It defaults to `DEFAULT_TANGLE_READY_TIMEOUT_MS` (120 seconds). A client whose `create` method ignores request options keeps its own create timeout; the provider still uses `readyTimeoutMs` for its later wait.
249
249
 
250
250
  ```ts
251
251
  const provider = createTangleProvider({
@@ -168,7 +168,7 @@ export function createTangleProvider(options) {
168
168
  throw new Error("Tangle native capture selected backend differs from the exact profile harness");
169
169
  }
170
170
  }
171
- const createPromise = options.client.create(createOptions, input.signal ? { signal: input.signal } : undefined);
171
+ const createPromise = options.client.create(createOptions, { timeoutMs: readyTimeoutMs, ...(input.signal ? { signal: input.signal } : {}) });
172
172
  let box;
173
173
  try {
174
174
  box = await awaitWithSignal(createPromise, input.signal);
@@ -416,7 +416,7 @@ export function createTangleProvider(options) {
416
416
  };
417
417
  }
418
418
  /**
419
- * Bring a suspended sandbox back before a reconnect reads its container.
419
+ * Wait for a usable sandbox before a reconnect reads its container.
420
420
  *
421
421
  * The platform suspends a sandbox after its idle timeout (30 minutes by
422
422
  * default) and nothing resumes it on access. A root turn stalled on an
@@ -425,10 +425,14 @@ export function createTangleProvider(options) {
425
425
  * the driver exhausts its attempts. After the resume the sidecar reports the
426
426
  * interrupted execution as a terminal failure, so the caller settles that
427
427
  * execution and replaces it once instead of dispatching beside it.
428
+ * A box can also report running while its replacement filesystem incarnation
429
+ * is still becoming ready. The same SDK wait closes that gap before backend
430
+ * status is read.
428
431
  */
429
432
  async function resumeForReconnect(box, client, timeoutMs, signal) {
430
- if (box.status === "running")
431
- return;
433
+ // A running lifecycle status can precede the filesystem incarnation and
434
+ // selected backend becoming readable after a container restart. The SDK's
435
+ // waitFor("running") also waits for that incarnation to be ready.
432
436
  if (box.status === "stopped") {
433
437
  if (!box.resume) {
434
438
  throw new Error(`Tangle sandbox ${box.id} is stopped and the linked client cannot resume it`);
@@ -815,9 +815,10 @@ export interface TangleProviderOptions {
815
815
  mapCreateInput?: (input: CreateAgentEnvironmentInput) => CreateSandboxOptions;
816
816
  exactProcess?: TangleExactProcessOptions;
817
817
  /**
818
- * How long `create()` waits for a new sandbox to reach `running` before it
819
- * fails. Defaults to `DEFAULT_TANGLE_READY_TIMEOUT_MS`, exported from this
820
- * package, which is the Sandbox SDK's own wait default of 120 seconds.
818
+ * Passed to the HTTP Sandbox creation request and the subsequent wait for
819
+ * `running`. A client that ignores create request options keeps its own
820
+ * create timeout. Defaults to `DEFAULT_TANGLE_READY_TIMEOUT_MS`, exported
821
+ * from this package (120 seconds).
821
822
  */
822
823
  readyTimeoutMs?: number;
823
824
  /** External provider-key and measurement verifier for confidential forks. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-provider-tangle",
3
- "version": "3.6.7",
3
+ "version": "3.6.9",
4
4
  "description": "AgentEnvironmentProvider adapter for Tangle sandboxes",
5
5
  "type": "module",
6
6
  "license": "MIT",