@exellix/ai-tasks 8.4.3 → 8.5.2

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 (90) hide show
  1. package/.docs/ai-tasks-model-profile-aliases-7x.md +27 -5
  2. package/CHANGELOG.md +16 -0
  3. package/README.md +5 -4
  4. package/RUNTASK_REQUEST.md +1 -1
  5. package/dist/core/task-sdk.d.ts.map +1 -1
  6. package/dist/core/task-sdk.js +56 -29
  7. package/dist/core/task-sdk.js.map +1 -1
  8. package/dist/errors/runTaskExecutionError.d.ts +1 -1
  9. package/dist/errors/runTaskExecutionError.d.ts.map +1 -1
  10. package/dist/errors/runTaskExecutionError.js +4 -1
  11. package/dist/errors/runTaskExecutionError.js.map +1 -1
  12. package/dist/errors/runTaskModelResolutionError.d.ts +39 -0
  13. package/dist/errors/runTaskModelResolutionError.d.ts.map +1 -0
  14. package/dist/errors/runTaskModelResolutionError.js +92 -0
  15. package/dist/errors/runTaskModelResolutionError.js.map +1 -0
  16. package/dist/execution-strategies/constants.d.ts +11 -4
  17. package/dist/execution-strategies/constants.d.ts.map +1 -1
  18. package/dist/execution-strategies/constants.js +11 -4
  19. package/dist/execution-strategies/constants.js.map +1 -1
  20. package/dist/execution-strategies/executionStrategyCatalogMetadata.d.ts +6 -3
  21. package/dist/execution-strategies/executionStrategyCatalogMetadata.d.ts.map +1 -1
  22. package/dist/execution-strategies/executionStrategyCatalogMetadata.js +36 -5
  23. package/dist/execution-strategies/executionStrategyCatalogMetadata.js.map +1 -1
  24. package/dist/execution-strategies/executionStrategyRequestPayload.d.ts +19 -0
  25. package/dist/execution-strategies/executionStrategyRequestPayload.d.ts.map +1 -0
  26. package/dist/execution-strategies/executionStrategyRequestPayload.js +21 -0
  27. package/dist/execution-strategies/executionStrategyRequestPayload.js.map +1 -0
  28. package/dist/execution-strategies/runExecutionStrategyViaXynthesis.d.ts +35 -0
  29. package/dist/execution-strategies/runExecutionStrategyViaXynthesis.d.ts.map +1 -0
  30. package/dist/execution-strategies/runExecutionStrategyViaXynthesis.js +129 -0
  31. package/dist/execution-strategies/runExecutionStrategyViaXynthesis.js.map +1 -0
  32. package/dist/index.d.ts +16 -4
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +15 -4
  35. package/dist/index.js.map +1 -1
  36. package/dist/internal/resolveLlmCallForXynthesis.d.ts.map +1 -1
  37. package/dist/internal/resolveLlmCallForXynthesis.js +6 -0
  38. package/dist/internal/resolveLlmCallForXynthesis.js.map +1 -1
  39. package/dist/internal/runPostStepLlmCall.d.ts.map +1 -1
  40. package/dist/internal/runPostStepLlmCall.js +4 -1
  41. package/dist/internal/runPostStepLlmCall.js.map +1 -1
  42. package/dist/logxer/aiTasksDiagnosticCodes.d.ts +3 -0
  43. package/dist/logxer/aiTasksDiagnosticCodes.d.ts.map +1 -1
  44. package/dist/logxer/aiTasksDiagnosticCodes.js +3 -0
  45. package/dist/logxer/aiTasksDiagnosticCodes.js.map +1 -1
  46. package/dist/observability/classifyRunTaskFailure.d.ts +1 -1
  47. package/dist/observability/classifyRunTaskFailure.d.ts.map +1 -1
  48. package/dist/observability/classifyRunTaskFailure.js +12 -0
  49. package/dist/observability/classifyRunTaskFailure.js.map +1 -1
  50. package/dist/observability/logRunTaskFailure.d.ts.map +1 -1
  51. package/dist/observability/logRunTaskFailure.js +26 -8
  52. package/dist/observability/logRunTaskFailure.js.map +1 -1
  53. package/dist/planWebScopeQuestions/index.d.ts +4 -8
  54. package/dist/planWebScopeQuestions/index.d.ts.map +1 -1
  55. package/dist/planWebScopeQuestions/index.js +114 -149
  56. package/dist/planWebScopeQuestions/index.js.map +1 -1
  57. package/dist/post-steps/audit/auditChecklistFuncxEnvelope.d.ts +57 -0
  58. package/dist/post-steps/audit/auditChecklistFuncxEnvelope.d.ts.map +1 -0
  59. package/dist/post-steps/audit/auditChecklistFuncxEnvelope.js +80 -0
  60. package/dist/post-steps/audit/auditChecklistFuncxEnvelope.js.map +1 -0
  61. package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts +21 -21
  62. package/dist/task-strategies/canonicalInputExecutionStrategies.js +12 -12
  63. package/dist/task-strategies/canonicalInputExecutionStrategies.js.map +1 -1
  64. package/dist/task-strategies/normalize.d.ts.map +1 -1
  65. package/dist/task-strategies/normalize.js +3 -0
  66. package/dist/task-strategies/normalize.js.map +1 -1
  67. package/dist/task-strategies/types.d.ts +4 -2
  68. package/dist/task-strategies/types.d.ts.map +1 -1
  69. package/dist/types/llmCall.d.ts +1 -1
  70. package/dist/types/llmCall.d.ts.map +1 -1
  71. package/dist/types/llmCall.js.map +1 -1
  72. package/dist/utils/concreteModelId.d.ts.map +1 -1
  73. package/dist/utils/concreteModelId.js +4 -1
  74. package/dist/utils/concreteModelId.js.map +1 -1
  75. package/dist/utils/resolveAiProfileModel.d.ts +6 -1
  76. package/dist/utils/resolveAiProfileModel.d.ts.map +1 -1
  77. package/dist/utils/resolveAiProfileModel.js +11 -2
  78. package/dist/utils/resolveAiProfileModel.js.map +1 -1
  79. package/dist/utils/resolveRunTaskModelReferences.d.ts.map +1 -1
  80. package/dist/utils/resolveRunTaskModelReferences.js +93 -30
  81. package/dist/utils/resolveRunTaskModelReferences.js.map +1 -1
  82. package/dist/validation/helpers.js +1 -1
  83. package/dist/validation/helpers.js.map +1 -1
  84. package/documenations/funcx-catalog-hosting-checklist.md +2 -2
  85. package/documenations/funcx-scoping-integration-gaps.md +8 -6
  86. package/documenations/upstream-feature-requests/README.md +10 -0
  87. package/documenations/upstream-feature-requests/funcx-generic-xynthesis-hosting.md +294 -0
  88. package/documenations/upstream-feature-requests/funcx-pre-post-sidekick-actions.md +301 -0
  89. package/documenations/upstream-feature-requests/xynthesis-execution-strategies-option-a.md +637 -0
  90. package/package.json +2 -10
@@ -41,18 +41,39 @@ Unknown profile keys fail at **`resolveAIProfile`** with a clear error.
41
41
 
42
42
  ## Resolution boundaries
43
43
 
44
- | Path | Fields | Normalized by |
45
- |------|--------|---------------|
46
- | Xynthesis (PRE/POST/scoping/utilities) | `preActionModel`, `postActionModel`, step `llmCall.model` | `resolveModelReferenceForXynthesis` → `toStrictAiProfileResolveInput` |
47
- | ai-skills MAIN | `skillModel`, `RunTaskRequest.llmCall.model` | `resolveModelReference` → concrete `provider/model` |
44
+ | Path | Fields at ingress (before `resolveRunTaskModelReferences`) | Internal transform |
45
+ |------|----------------------------------------------------------|--------------------|
46
+ | **PRE / POST (xynthesis)** | `preActionModel`, `postActionModel`, step `llmCall.model` — **ai-profiles alias required** | `resolveModelReferenceForXynthesis` → `profile/choice` keys only |
47
+ | **MAIN (ai-skills)** | `skillModel`, root `llmCall.model` — alias **or** concrete provider id | `resolveModelReference` → concrete `provider/model` for gateway |
48
48
 
49
49
  Concrete ids (`openrouter/...`, `anthropic/claude-...`, `openai/gpt-5`) pass through on **`skillModel`** only. PRE/POST must stay ai-profiles aliases under `@exellix/xynthesis` ≥ 4.3.1.
50
50
 
51
+ ### Ingress rule for hosts (graph-engine, studio BFF)
52
+
53
+ > **Do not** pre-resolve `preActionModel` or `postActionModel` to OpenRouter/OpenAI model ids. Pass through profile keys, `profile/choice`, or shortcut keys (e.g. `cheap`, `cheap/default`).
54
+
55
+ > **`skillModel`** may still be a concrete provider id at ingress.
56
+
57
+ ### Internal rule (ai-tasks)
58
+
59
+ > `resolveRunTaskModelReferences` is the **only** place that transforms aliases on xynthesis paths at `runTask` entry. If a concrete id is detected on a xynthesis slot, ai-tasks fails with stable code **`XYNTHESIS_CONCRETE_MODEL_REJECTED`** (typed `RunTaskModelResolutionError`, not a generic wrapper).
60
+
61
+ ### Stable pre-MAIN error codes
62
+
63
+ | Condition | `error.code` |
64
+ |-----------|--------------|
65
+ | Concrete id on xynthesis slot | `XYNTHESIS_CONCRETE_MODEL_REJECTED` |
66
+ | Unknown / unresolvable alias | `XYNTHESIS_ALIAS_RESOLUTION_FAILED` |
67
+ | PRE synthesis enabled but required paths empty | `SYNTHESIS_INPUT_EMPTY` |
68
+
69
+ Failures emit logxer diagnostics with `failureClassification.role: "cause"` and event ids such as `xynthesis_concrete_model_rejected`. Hosts (graph-engine CR-7) should preserve `error.code` and `failureClassification` on attempt records instead of collapsing to `TASK_RUN_FAILED` / `classification: other`.
70
+
51
71
  ## graph-engine guidance
52
72
 
53
73
  - Send the triplet on every node/task compile — no env defaults, no `"balanced"` fallback.
54
74
  - Prefer explicit **`profile/choice`** keys in compiled payloads; bare profile keys are OK (ai-tasks normalizes before xynthesis).
55
- - Optional: pre-resolve aliases in graph-engine for diagnostics; ai-tasks re-resolves at invoke (idempotent for concrete ids).
75
+ - **Do not** pre-resolve `preActionModel` / `postActionModel` to concrete provider ids — pass aliases and let ai-tasks normalize at `runTask` entry (see ingress rule above).
76
+ - Optional: pre-resolve **`skillModel`** aliases for diagnostics; ai-tasks re-resolves at invoke (idempotent for concrete ids).
56
77
  - Do **not** npm-override `@x12i/ai-profiles` or pin `<2.1`.
57
78
 
58
79
  ## Stack minimums
@@ -69,6 +90,7 @@ Concrete ids (`openrouter/...`, `anthropic/claude-...`, `openai/gpt-5`) pass thr
69
90
  - `toStrictAiProfileResolveInput` — bare profile → `profile/default`
70
91
  - `resolveModelReference` / `resolveModelReferenceForXynthesis`
71
92
  - `isResolvableModelAlias` — true for known **`profile/choice`** keys only
93
+ - `RunTaskModelResolutionError`, `isRunTaskModelResolutionError` — stable pre-MAIN model slot failures
72
94
  - `listAiTasksProfileChoices`, `listAiTasksProfiles`, `listAiTasksProfileChoiceKeys`
73
95
 
74
96
  See [README — Model profile aliases](../README.md#model-profile-aliases-x12iai-profiles).
package/CHANGELOG.md CHANGED
@@ -4,6 +4,22 @@ All notable changes to `@exellix/ai-tasks` are documented here.
4
4
 
5
5
  The published **npm version** always matches **`version`** in [`package.json`](package.json). If this file skips a semver, treat [`BREAKING-CHANGES.md`](BREAKING-CHANGES.md) and [`RUNTASK_REQUEST.md`](RUNTASK_REQUEST.md) as the source of truth for cross-version upgrades.
6
6
 
7
+ ## [8.5.0] - 2026-06-03
8
+
9
+ ### Changed (breaking)
10
+
11
+ - **Execution strategies:** planner/optimizer invoke **`@exellix/xynthesis` ≥ 4.4.0** (`execution-plan`, `execution-evaluate-result`) with `modelConfig.preActionModel` / `postActionModel`. Removed direct `@x12i/funcx` `run()` from ai-tasks.
12
+ - **`runPlanWebScopeQuestions`:** xynthesis `plan-web-scope-questions` only; removed `backend: "funcx"`.
13
+ - **Catalog:** `runtimeKind: "xynthesis-action"`, `defaultSidekickAction` on planner/optimizer rows.
14
+
15
+ ### Added
16
+
17
+ - `runPlannerViaXynthesis`, `runOptimizerViaXynthesis`, `setExecutionStrategyActionInvoker`, `setPlanWebScopeQuestionsActionInvoker`, `resolveSafeExecutionStrategyCatalogDefaultSidekickAction`.
18
+
19
+ ### Removed
20
+
21
+ - `setFuncxExecutionStrategyInvoker`, `setResearchPlanQuestionsFuncxInvoker`, direct `@x12i/funcx` dependency.
22
+
7
23
  ## [Unreleased]
8
24
 
9
25
  ### Changed (breaking)
package/README.md CHANGED
@@ -1123,10 +1123,11 @@ Concrete ids (`openrouter/...`, `anthropic/claude-sonnet-4`, `openai/gpt-5`, …
1123
1123
 
1124
1124
  **Client impact:**
1125
1125
 
1126
- - **No change** if you already send concrete provider model ids.
1127
- - **New:** you may send ai-profiles aliases on `modelConfig`, `llmCall.model`, and pipeline step configs graph-engine no longer has to pre-resolve every alias before `runTask` (hosts that already resolve can keep doing so; double resolution is a no-op for concrete ids).
1128
- - **Validation:** alias tokens on `modelConfig` slots are accepted; unknown aliases fail at resolution with a clear error.
1129
- - **Helpers:** `resolveModelReference`, `resolveRunTaskModelReferences`, `isResolvableModelAlias` (true only for **`profile/choice`** keys bare profile keys are resolved at invoke, not sync-listed).
1126
+ - **`skillModel` / MAIN `llmCall.model`:** concrete provider ids pass through unchanged (alias or concrete accepted).
1127
+ - **`preActionModel` / `postActionModel`:** must be ai-profiles aliases — **do not** send concrete OpenRouter/OpenAI ids (rejected with `XYNTHESIS_CONCRETE_MODEL_REJECTED`).
1128
+ - **New:** you may send ai-profiles aliases on `modelConfig`, `llmCall.model`, and pipeline step configs graph-engine must not pre-resolve xynthesis slots to concrete ids.
1129
+ - **Validation:** alias tokens on `modelConfig` slots are accepted; unknown aliases fail at resolution with `XYNTHESIS_ALIAS_RESOLUTION_FAILED`.
1130
+ - **Helpers:** `resolveModelReference`, `resolveRunTaskModelReferences`, `isRunTaskModelResolutionError`, `isResolvableModelAlias` (true only for **`profile/choice`** keys — bare profile keys are resolved at invoke, not sync-listed).
1130
1131
 
1131
1132
  Resolution uses the ai-profiles registry (`auto`: remote refresh with bundled fallback). See [`.docs/ai-tasks-model-profile-aliases-7x.md`](.docs/ai-tasks-model-profile-aliases-7x.md).
1132
1133
 
@@ -95,7 +95,7 @@ Properties are classified for **default MAIN path** unless noted. Inherited **`R
95
95
  | `inputs` | Optional plural task payload (`string` or object). Dual-root parity with `input`; smart-input **`inputs.*`** resolves here (not `executionMemory.inputs`). |
96
96
  | `variables` | Job/graph template bucket; forwarded as-is on MAIN (see [Canonical input bucket](#canonical-input-bucket)). |
97
97
  | `jobMemory`, `taskMemory` | Enriched and forwarded; see executor payload. |
98
- | `modelConfig` | **Canonical slots:** `preActionModel` + `skillModel` + `postActionModel`. **Aliases accepted on wire** (ai-profiles names + legacy tiers); resolved inside `runTask()` via [`resolveRunTaskModelReferences`](src/utils/resolveRunTaskModelReferences.ts). **`skillModel`** → concrete id for ai-skills MAIN; **`preActionModel`** / **`postActionModel`** → **alias only** for xynthesis PRE/POST (concrete ids rejected under `@exellix/xynthesis` ≥4). Legacy `model` and **`xynthesisModel`** rejected. |
98
+ | `modelConfig` | **Canonical slots:** `preActionModel` + `skillModel` + `postActionModel`. **Aliases accepted on wire** (ai-profiles names + legacy tiers); resolved inside `runTask()` via [`resolveRunTaskModelReferences`](src/utils/resolveRunTaskModelReferences.ts). **`skillModel`** → concrete id for ai-skills MAIN; **`preActionModel`** / **`postActionModel`** → **alias only** for xynthesis PRE/POST (concrete ids rejected under `@exellix/xynthesis` ≥4 with code **`XYNTHESIS_CONCRETE_MODEL_REJECTED`**). Legacy `model` and **`xynthesisModel`** rejected. See [`.docs/ai-tasks-model-profile-aliases-7x.md`](.docs/ai-tasks-model-profile-aliases-7x.md). |
99
99
  | `llmCall` | **MAIN override only** at root (`llmCall.model` wins over `skillModel` unless it duplicates `preActionModel` while `skillModel` differs — see collision guard). Not copied into PRE synthesis compile; use `preActionModel` or `executionPipeline[pre].config.llmCall` for PRE. Merged into ai-skills `modelConfig` at MAIN execution boundary. |
100
100
  | `timeoutMs` | Forwarded when set (also overlaid from `llmCall.timeoutMs`). |
101
101
  | `coreSkillId` | Maps to `skillId` on `RunSkillRequest` for gateway. |
@@ -1 +1 @@
1
- {"version":3,"file":"task-sdk.d.ts","sourceRoot":"","sources":["../../src/core/task-sdk.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAazD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAuB,MAAM,mBAAmB,CAAC;AA2BzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AA2OxD,KAAK,iBAAiB,GAAG,mBAAmB,CAAC;AA0S7C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,+FAA+F;IAC/F,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B,CAAC;AAEF,qBAAa,gBAAgB;IAIzB,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,iBAAiB;IAClD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJ3B,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC;gBAGjC,YAAY,EAAE,iBAAiB,EACjC,QAAQ,EAAE;QACzB,OAAO,CAAC,OAAO,GAAG,GAAG,EACnB,KAAK,EAAE,GAAG,EACV,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GACzC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;KACtC,EACD,OAAO,CAAC,EAAE,uBAAuB;IAQ7B,OAAO,CAAC,OAAO,GAAG,GAAG,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IA6kDtF;;OAEG;YACW,6BAA6B;IAshB3C;;;;;OAKG;YACW,cAAc;CAyR7B"}
1
+ {"version":3,"file":"task-sdk.d.ts","sourceRoot":"","sources":["../../src/core/task-sdk.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAazD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAuB,MAAM,mBAAmB,CAAC;AA2BzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AA4OxD,KAAK,iBAAiB,GAAG,mBAAmB,CAAC;AA0S7C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,+FAA+F;IAC/F,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B,CAAC;AAEF,qBAAa,gBAAgB;IAIzB,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,iBAAiB;IAClD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJ3B,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC;gBAGjC,YAAY,EAAE,iBAAiB,EACjC,QAAQ,EAAE;QACzB,OAAO,CAAC,OAAO,GAAG,GAAG,EACnB,KAAK,EAAE,GAAG,EACV,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GACzC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;KACtC,EACD,OAAO,CAAC,EAAE,uBAAuB;IAQ7B,OAAO,CAAC,OAAO,GAAG,GAAG,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAkmDtF;;OAEG;YACW,6BAA6B;IAshB3C;;;;;OAKG;YACW,cAAc;CAyR7B"}
@@ -2,8 +2,9 @@
2
2
  import { randomUUID } from "crypto";
3
3
  import { resolveRunTaskRuntimeKnobs, } from "../internal/resolveRunTaskRuntimeKnobs.js";
4
4
  import { applyOptimizerFeedbackToRequest, applyPlannerOutputToRequest } from "../execution-strategies/applyExecutionStrategyOutputs.js";
5
- import { buildExecutionStrategyRequestPayload, runOptimizerFuncx, runPlannerFuncx, } from "../execution-strategies/runFuncxExecutionStrategy.js";
6
- import { resolveSafeExecutionStrategyCatalogDefaultFunctionId } from "../execution-strategies/executionStrategyCatalogMetadata.js";
5
+ import { buildExecutionStrategyRequestPayload } from "../execution-strategies/executionStrategyRequestPayload.js";
6
+ import { runOptimizerViaXynthesis, runPlannerViaXynthesis, } from "../execution-strategies/runExecutionStrategyViaXynthesis.js";
7
+ import { resolveSafeExecutionStrategyCatalogDefaultSidekickAction } from "../execution-strategies/executionStrategyCatalogMetadata.js";
7
8
  import { SYNTHESIZED_CONTEXT } from "../types/index.js";
8
9
  import { runAuditPostStep } from "../post-steps/audit/runAudit.js";
9
10
  import { buildRunTaskResultMetaFromModelId } from "../invocation/buildRunTaskResultMeta.js";
@@ -46,6 +47,7 @@ import { llmCallEnvPrefix, resolveLlmCall } from "../post-steps/resolvePostStepC
46
47
  import { buildXynthesisWorkScopeIdentity } from "../internal/buildXynthesisWorkScopeIdentity.js";
47
48
  import { getPostActionModelFromSlots, resolvePreActionModel } from "../utils/routeModelConfigSlots.js";
48
49
  import { assertPhaseModelAlias } from "../errors/modelConfigRequiredError.js";
50
+ import { isRunTaskModelResolutionError } from "../errors/runTaskModelResolutionError.js";
49
51
  import { resolveRunTaskModelReferences } from "../utils/resolveRunTaskModelReferences.js";
50
52
  import { runPostStepLlmCall } from "../internal/runPostStepLlmCall.js";
51
53
  registerBuiltInLocalTasks();
@@ -438,11 +440,6 @@ export class WorexClientTasks {
438
440
  }
439
441
  }
440
442
  async runTask(input) {
441
- const compiled = compileTaskConfigurationOnRunTaskRequest(input);
442
- input = await resolveRunTaskModelReferences(compiled.request);
443
- emitRunTaskRequestWarnings(input);
444
- assertRequiredRunSkillCorrelation(input);
445
- assertValidSmartInputConfig(input.smartInput, input.skillKey);
446
443
  const traceCollector = input.executionMode === "trace" ? createDebugTraceCollector() : null;
447
444
  const withTrace = (result) => {
448
445
  if (!traceCollector)
@@ -453,16 +450,21 @@ export class WorexClientTasks {
453
450
  };
454
451
  };
455
452
  return runAiTasksWithObservabilityContext({ logging: this.stackLogging }, async () => {
456
- const failContext = () => ({
457
- skillKey: input.skillKey,
458
- jobId: input.jobId,
459
- taskId: input.taskId,
460
- graphId: input.graphId,
461
- nodeId: input.nodeId,
462
- agentId: input.agentId,
463
- modelConfig: input.modelConfig,
453
+ const failContext = (req) => ({
454
+ skillKey: req.skillKey,
455
+ jobId: req.jobId,
456
+ taskId: req.taskId,
457
+ graphId: req.graphId,
458
+ nodeId: req.nodeId,
459
+ agentId: req.agentId,
460
+ modelConfig: req.modelConfig,
464
461
  });
465
462
  try {
463
+ const compiled = compileTaskConfigurationOnRunTaskRequest(input);
464
+ input = await resolveRunTaskModelReferences(compiled.request);
465
+ emitRunTaskRequestWarnings(input);
466
+ assertRequiredRunSkillCorrelation(input);
467
+ assertValidSmartInputConfig(input.smartInput, input.skillKey);
466
468
  // `@exellix/ai-skills` requires stable ids on each gateway request; callers may omit for simple runs.
467
469
  const taskId = input.taskId?.trim() ? input.taskId : randomUUID();
468
470
  const jobId = input.jobId?.trim() ? input.jobId : randomUUID();
@@ -718,33 +720,45 @@ export class WorexClientTasks {
718
720
  coreSkillId: working.coreSkillId,
719
721
  includeContextInPrompt: working.includeContextInPrompt,
720
722
  });
721
- const catalogDefaultFunctionId = resolveSafeExecutionStrategyCatalogDefaultFunctionId(req.executionStrategyCatalogItems, spec);
722
- const plannerOut = await runPlannerFuncx({
723
+ const catalogDefaultSidekickAction = resolveSafeExecutionStrategyCatalogDefaultSidekickAction(req.executionStrategyCatalogItems, spec);
724
+ const plannerOut = await runPlannerViaXynthesis({
723
725
  args: spec.args,
724
726
  requestPayload: payload,
725
- defaultFunctionId: catalogDefaultFunctionId,
727
+ modelConfig: req.modelConfig,
728
+ jobId: working.jobId,
729
+ taskId: working.taskId,
730
+ agentId: working.agentId,
731
+ workScopeIdentity: buildXynthesisWorkScopeIdentity({
732
+ jobId: working.jobId,
733
+ taskId: working.taskId,
734
+ agentId: working.agentId,
735
+ graphId: working.graphId,
736
+ nodeId: working.nodeId,
737
+ prevNodeId: working.prevNodeId,
738
+ coreSkillId: working.coreSkillId,
739
+ }),
726
740
  });
727
741
  working = applyPlannerOutputToRequest(working, plannerOut, pi);
728
742
  prefixSteps.push({
729
743
  step: prefixSteps.length + 1,
730
744
  id: `executionStrategy.planner.${pi}`,
731
745
  ok: true,
732
- summary: "FuncX planner (execution/plan)",
746
+ summary: "xynthesis planner (execution-plan)",
733
747
  outputExcerpt: {
734
748
  hasInstructions: typeof plannerOut.instructions === "string",
735
749
  hasPrompt: typeof plannerOut.prompt === "string",
736
750
  variableKeys: plannerOut.variables ? Object.keys(plannerOut.variables).slice(0, 20) : [],
737
- functionIdSource: typeof spec.args?.functionId === "string"
738
- ? "invocation"
739
- : catalogDefaultFunctionId
740
- ? "catalog"
741
- : "code-default",
751
+ sidekickActionSource: catalogDefaultSidekickAction
752
+ ? "catalog"
753
+ : spec.strategyKey === "planner"
754
+ ? "execution-plan"
755
+ : "execution-evaluate-result",
742
756
  },
743
757
  });
744
758
  if (traceCollector) {
745
759
  traceCollector.push({
746
760
  taskType: "pre-execution",
747
- details: "execution strategy planner (FuncX)",
761
+ details: "execution strategy planner (xynthesis)",
748
762
  metadata: {
749
763
  ...baseTraceMeta(),
750
764
  phase: "execution_strategy_planner",
@@ -776,9 +790,21 @@ export class WorexClientTasks {
776
790
  skillKey: last.skillKey,
777
791
  metadata: last.metadata ? summarizeForOuter(last.metadata, 6_000) : undefined,
778
792
  };
779
- const evalOut = await runOptimizerFuncx({
793
+ const evalOut = await runOptimizerViaXynthesis({
780
794
  args: primary.args,
781
- defaultFunctionId: resolveSafeExecutionStrategyCatalogDefaultFunctionId(req.executionStrategyCatalogItems, primary),
795
+ modelConfig: req.modelConfig,
796
+ jobId: working.jobId,
797
+ taskId: working.taskId,
798
+ agentId: working.agentId,
799
+ workScopeIdentity: buildXynthesisWorkScopeIdentity({
800
+ jobId: working.jobId,
801
+ taskId: working.taskId,
802
+ agentId: working.agentId,
803
+ graphId: working.graphId,
804
+ nodeId: working.nodeId,
805
+ prevNodeId: working.prevNodeId,
806
+ coreSkillId: working.coreSkillId,
807
+ }),
782
808
  requestPayload: buildExecutionStrategyRequestPayload({
783
809
  skillKey: working.skillKey,
784
810
  input: working.input,
@@ -802,7 +828,7 @@ export class WorexClientTasks {
802
828
  if (traceCollector) {
803
829
  traceCollector.push({
804
830
  taskType: "ai-task",
805
- details: "execution strategy optimizer (FuncX)",
831
+ details: "execution strategy optimizer (xynthesis)",
806
832
  metadata: {
807
833
  ...baseTraceMeta(),
808
834
  phase: "execution_strategy_optimizer",
@@ -1776,7 +1802,8 @@ export class WorexClientTasks {
1776
1802
  catch (error) {
1777
1803
  throw logAndEnrichRunTaskFailure({
1778
1804
  cause: error,
1779
- ...failContext(),
1805
+ ...(isRunTaskModelResolutionError(error) ? { phase: "model-resolution" } : {}),
1806
+ ...failContext(input),
1780
1807
  });
1781
1808
  }
1782
1809
  });