@abelxiaoxing/cadence 1.0.7 → 1.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/runtime.ts +13 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abelxiaoxing/cadence",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Prompts, skills, and a private orchestration extension exposing the Abel four-stage workflow (/abel-init, /abel-design, /abel-implement, /abel-diagnose) with package-owned professional Agents.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/runtime.ts CHANGED
@@ -1821,9 +1821,19 @@ export class Runtime {
1821
1821
  };
1822
1822
  }
1823
1823
  if (!task) {
1824
- const result = await this.dispatchChild(agent, envelope, ctx, signal);
1825
- this.captureUsage(context, "launch:0", result.usage);
1826
- return this.withUsage(context, result);
1824
+ const first = await this.dispatchChild(agent, envelope, ctx, signal);
1825
+ this.captureUsage(context, "launch:0", first.usage);
1826
+ const retryInvalidDesignResult =
1827
+ !signal.aborted &&
1828
+ envelope.stage === "abel-design" &&
1829
+ !first.ok &&
1830
+ first.failure?.kind === "artifact" &&
1831
+ first.failure.code === "invalid-structural-result";
1832
+ if (!retryInvalidDesignResult) return this.withUsage(context, first);
1833
+
1834
+ const second = await this.dispatchChild(agent, envelope, ctx, signal);
1835
+ this.captureUsage(context, "launch:1", second.usage);
1836
+ return this.withUsage(context, second);
1827
1837
  }
1828
1838
  if (task.workerIdentity !== workerIdentity(ctx.model)) {
1829
1839
  throw new Error("provider/model identity mismatch");