@exellix/ai-tasks 9.1.0 → 10.0.0

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 (252) hide show
  1. package/CHANGELOG.md +34 -4
  2. package/README.md +2 -2
  3. package/RUNTASK_REQUEST.md +32 -17
  4. package/dist/builders/task-request-builder.d.ts.map +1 -1
  5. package/dist/builders/task-request-builder.js +2 -1
  6. package/dist/builders/task-request-builder.js.map +1 -1
  7. package/dist/compile/compileTaskConfiguration.d.ts.map +1 -1
  8. package/dist/compile/compileTaskConfiguration.js +3 -0
  9. package/dist/compile/compileTaskConfiguration.js.map +1 -1
  10. package/dist/core/task-sdk.d.ts.map +1 -1
  11. package/dist/core/task-sdk.js +148 -180
  12. package/dist/core/task-sdk.js.map +1 -1
  13. package/dist/errors/runTaskExecutionError.d.ts.map +1 -1
  14. package/dist/errors/runTaskExecutionError.js +0 -2
  15. package/dist/errors/runTaskExecutionError.js.map +1 -1
  16. package/dist/index.d.ts +0 -4
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +0 -4
  19. package/dist/index.js.map +1 -1
  20. package/dist/invocation/types.d.ts +1 -1
  21. package/dist/narrix/applyWebScopeToRequest.d.ts +9 -0
  22. package/dist/narrix/applyWebScopeToRequest.d.ts.map +1 -0
  23. package/dist/narrix/applyWebScopeToRequest.js +156 -0
  24. package/dist/narrix/applyWebScopeToRequest.js.map +1 -0
  25. package/dist/narrix/narrixUnitExecution.d.ts.map +1 -1
  26. package/dist/narrix/narrixUnitExecution.js +8 -3
  27. package/dist/narrix/narrixUnitExecution.js.map +1 -1
  28. package/dist/node-execution/buildRequestFromNodePlan.d.ts +6 -0
  29. package/dist/node-execution/buildRequestFromNodePlan.d.ts.map +1 -1
  30. package/dist/node-execution/buildRequestFromNodePlan.js +4 -16
  31. package/dist/node-execution/buildRequestFromNodePlan.js.map +1 -1
  32. package/dist/node-execution/compileProfessionalAnswerRequest.d.ts +2 -0
  33. package/dist/node-execution/compileProfessionalAnswerRequest.d.ts.map +1 -0
  34. package/dist/node-execution/compileProfessionalAnswerRequest.js +4 -0
  35. package/dist/node-execution/compileProfessionalAnswerRequest.js.map +1 -0
  36. package/dist/node-execution/createNodeExecutionHost.d.ts.map +1 -1
  37. package/dist/node-execution/createNodeExecutionHost.js +97 -26
  38. package/dist/node-execution/createNodeExecutionHost.js.map +1 -1
  39. package/dist/node-execution/dispatchExecutionUnit.d.ts.map +1 -1
  40. package/dist/node-execution/dispatchExecutionUnit.js +4 -2
  41. package/dist/node-execution/dispatchExecutionUnit.js.map +1 -1
  42. package/dist/node-execution/orchestration/runPostOrchestration.d.ts +11 -0
  43. package/dist/node-execution/orchestration/runPostOrchestration.d.ts.map +1 -0
  44. package/dist/node-execution/orchestration/runPostOrchestration.js +123 -0
  45. package/dist/node-execution/orchestration/runPostOrchestration.js.map +1 -0
  46. package/dist/node-execution/orchestration/runPreOrchestration.d.ts +3 -0
  47. package/dist/node-execution/orchestration/runPreOrchestration.d.ts.map +1 -0
  48. package/dist/node-execution/orchestration/runPreOrchestration.js +110 -0
  49. package/dist/node-execution/orchestration/runPreOrchestration.js.map +1 -0
  50. package/dist/node-execution/orchestration/shardContext.d.ts +12 -0
  51. package/dist/node-execution/orchestration/shardContext.d.ts.map +1 -0
  52. package/dist/node-execution/orchestration/shardContext.js +71 -0
  53. package/dist/node-execution/orchestration/shardContext.js.map +1 -0
  54. package/dist/node-execution/orchestration/types.d.ts +21 -0
  55. package/dist/node-execution/orchestration/types.d.ts.map +1 -0
  56. package/dist/node-execution/orchestration/types.js +2 -0
  57. package/dist/node-execution/orchestration/types.js.map +1 -0
  58. package/dist/node-execution/rejectForbiddenWireFields.d.ts +2 -0
  59. package/dist/node-execution/rejectForbiddenWireFields.d.ts.map +1 -1
  60. package/dist/node-execution/rejectForbiddenWireFields.js +42 -7
  61. package/dist/node-execution/rejectForbiddenWireFields.js.map +1 -1
  62. package/dist/observability/classifyRunTaskFailure.d.ts.map +1 -1
  63. package/dist/observability/classifyRunTaskFailure.js +4 -3
  64. package/dist/observability/classifyRunTaskFailure.js.map +1 -1
  65. package/dist/observability/logRunTaskFailure.d.ts.map +1 -1
  66. package/dist/observability/logRunTaskFailure.js +0 -2
  67. package/dist/observability/logRunTaskFailure.js.map +1 -1
  68. package/dist/post-steps/audit/auditChecklistFuncxEnvelope.d.ts +19 -3
  69. package/dist/post-steps/audit/auditChecklistFuncxEnvelope.d.ts.map +1 -1
  70. package/dist/post-steps/audit/auditChecklistFuncxEnvelope.js +7 -1
  71. package/dist/post-steps/audit/auditChecklistFuncxEnvelope.js.map +1 -1
  72. package/dist/post-steps/audit/loadAuditTemplates.d.ts +2 -55
  73. package/dist/post-steps/audit/loadAuditTemplates.d.ts.map +1 -1
  74. package/dist/post-steps/audit/loadAuditTemplates.js +3 -38
  75. package/dist/post-steps/audit/loadAuditTemplates.js.map +1 -1
  76. package/dist/post-steps/audit/parseAuditFuncxOutput.d.ts +8 -0
  77. package/dist/post-steps/audit/parseAuditFuncxOutput.d.ts.map +1 -0
  78. package/dist/post-steps/audit/parseAuditFuncxOutput.js +62 -0
  79. package/dist/post-steps/audit/parseAuditFuncxOutput.js.map +1 -0
  80. package/dist/post-steps/audit/parseAuditOutput.d.ts +2 -0
  81. package/dist/post-steps/audit/parseAuditOutput.d.ts.map +1 -1
  82. package/dist/post-steps/audit/parseAuditOutput.js +56 -0
  83. package/dist/post-steps/audit/parseAuditOutput.js.map +1 -1
  84. package/dist/post-steps/audit/runAudit.d.ts.map +1 -1
  85. package/dist/post-steps/audit/runAudit.js +53 -113
  86. package/dist/post-steps/audit/runAudit.js.map +1 -1
  87. package/dist/post-steps/audit/runAuditFuncxCall.d.ts +18 -0
  88. package/dist/post-steps/audit/runAuditFuncxCall.d.ts.map +1 -0
  89. package/dist/post-steps/audit/runAuditFuncxCall.js +59 -0
  90. package/dist/post-steps/audit/runAuditFuncxCall.js.map +1 -0
  91. package/dist/synthesis/resolveSourceMaterial.d.ts.map +1 -1
  92. package/dist/synthesis/resolveSourceMaterial.js +14 -0
  93. package/dist/synthesis/resolveSourceMaterial.js.map +1 -1
  94. package/dist/synthesis/runStructuredSynthesisRobust.d.ts.map +1 -1
  95. package/dist/synthesis/runStructuredSynthesisRobust.js +24 -4
  96. package/dist/synthesis/runStructuredSynthesisRobust.js.map +1 -1
  97. package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.d.ts +3 -0
  98. package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.d.ts.map +1 -1
  99. package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.js +28 -4
  100. package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.js.map +1 -1
  101. package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts +4 -4
  102. package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts.map +1 -1
  103. package/dist/task-strategies/canonicalInputExecutionStrategies.js +2 -1
  104. package/dist/task-strategies/canonicalInputExecutionStrategies.js.map +1 -1
  105. package/dist/task-strategies/canonicalOrchestrationStrategies.d.ts +42 -0
  106. package/dist/task-strategies/canonicalOrchestrationStrategies.d.ts.map +1 -0
  107. package/dist/task-strategies/canonicalOrchestrationStrategies.js +47 -0
  108. package/dist/task-strategies/canonicalOrchestrationStrategies.js.map +1 -0
  109. package/dist/task-strategies/canonicalTaskStrategies.d.ts +2 -1
  110. package/dist/task-strategies/canonicalTaskStrategies.d.ts.map +1 -1
  111. package/dist/task-strategies/canonicalTaskStrategies.js +2 -1
  112. package/dist/task-strategies/canonicalTaskStrategies.js.map +1 -1
  113. package/dist/task-strategies/constants.d.ts +9 -1
  114. package/dist/task-strategies/constants.d.ts.map +1 -1
  115. package/dist/task-strategies/constants.js +9 -1
  116. package/dist/task-strategies/constants.js.map +1 -1
  117. package/dist/task-strategies/index.d.ts +5 -3
  118. package/dist/task-strategies/index.d.ts.map +1 -1
  119. package/dist/task-strategies/index.js +4 -3
  120. package/dist/task-strategies/index.js.map +1 -1
  121. package/dist/task-strategies/listAiTaskStrategies.d.ts +10 -1
  122. package/dist/task-strategies/listAiTaskStrategies.d.ts.map +1 -1
  123. package/dist/task-strategies/listAiTaskStrategies.js +17 -2
  124. package/dist/task-strategies/listAiTaskStrategies.js.map +1 -1
  125. package/dist/types/task-types.d.ts +4 -11
  126. package/dist/types/task-types.d.ts.map +1 -1
  127. package/dist/utils/bridgeRunSkillGatewayMemory.d.ts.map +1 -1
  128. package/dist/utils/bridgeRunSkillGatewayMemory.js +1 -0
  129. package/dist/utils/bridgeRunSkillGatewayMemory.js.map +1 -1
  130. package/dist/utils/executionMemoryInputRecord.d.ts +12 -0
  131. package/dist/utils/executionMemoryInputRecord.d.ts.map +1 -0
  132. package/dist/utils/executionMemoryInputRecord.js +28 -0
  133. package/dist/utils/executionMemoryInputRecord.js.map +1 -0
  134. package/dist/utils/resolveAiProfileModel.d.ts +1 -1
  135. package/dist/utils/resolveAiProfileModel.d.ts.map +1 -1
  136. package/dist/utils/resolveRunTaskModelReferences.d.ts.map +1 -1
  137. package/dist/utils/resolveRunTaskModelReferences.js +0 -32
  138. package/dist/utils/resolveRunTaskModelReferences.js.map +1 -1
  139. package/dist/utils/runTaskRequestShape.d.ts.map +1 -1
  140. package/dist/utils/runTaskRequestShape.js +4 -26
  141. package/dist/utils/runTaskRequestShape.js.map +1 -1
  142. package/dist/utils/skillTemplateVariables.d.ts +3 -2
  143. package/dist/utils/skillTemplateVariables.d.ts.map +1 -1
  144. package/dist/utils/skillTemplateVariables.js +3 -2
  145. package/dist/utils/skillTemplateVariables.js.map +1 -1
  146. package/dist/validation/validateProfessionalAnswerContract.d.ts +8 -0
  147. package/dist/validation/validateProfessionalAnswerContract.d.ts.map +1 -0
  148. package/dist/validation/validateProfessionalAnswerContract.js +45 -0
  149. package/dist/validation/validateProfessionalAnswerContract.js.map +1 -0
  150. package/dist/validation/validateRunTaskConfig.d.ts.map +1 -1
  151. package/dist/validation/validateRunTaskConfig.js +3 -66
  152. package/dist/validation/validateRunTaskConfig.js.map +1 -1
  153. package/documenations/record-and-template-variables.md +21 -13
  154. package/documenations/run-task-execution-flow.md +1 -1
  155. package/documenations/skill-orchestration-strategy-cr-fr.md +147 -0
  156. package/documenations/upstream-feature-requests/README.md +9 -5
  157. package/documenations/upstream-feature-requests/ai-skills-orchestrator-invoke-contract-5.9.md +1 -1
  158. package/documenations/upstream-feature-requests/funcx-4.9.13-open-items.md +62 -0
  159. package/documenations/upstream-feature-requests/funcx-gap-analysis-cr-fr.md +401 -0
  160. package/documenations/upstream-feature-requests/funcx-pre-post-sidekick-actions.md +1 -0
  161. package/documenations/upstream-feature-requests/graph-engine-runtask-contract-alignment-investigation.md +370 -0
  162. package/documenations/upstream-feature-requests/xynthesis-ai-profiles-2.1-import-break.md +2 -2
  163. package/documenations/upstream-feature-requests/xynthesis-openrouter-wire-model-double-prefix-bug.md +1 -1
  164. package/documenations/upstream-feature-requests/xynthesis-orchestrator-invoke-contract-4.2.md +1 -1
  165. package/package.json +10 -9
  166. package/.docs/DOWNSTREAM_ENV.md +0 -42
  167. package/.docs/FEEDBACK_TO_CLIENT_DOWNSTREAM_FIXES.md +0 -64
  168. package/.docs/INTERMEDIATE_STEPS.md +0 -82
  169. package/.docs/activity-structure.md +0 -31
  170. package/.docs/ai-task-ai-scoping-spec.md +0 -338
  171. package/.docs/ai-tasks-model-profile-aliases-7x.md +0 -96
  172. package/.docs/blockers-and-issues.md +0 -346
  173. package/.docs/building-runTask-sdk.md +0 -659
  174. package/.docs/building-skill-execution-orchestrator.md +0 -968
  175. package/.docs/code-used-before/run-task.txt +0 -39
  176. package/.docs/code-used-before/task-executor.ts.old +0 -57
  177. package/.docs/code-used-before/test-run-task.ts.old +0 -42
  178. package/.docs/code-used-before/types.txt +0 -23
  179. package/.docs/env-ready-policy.md +0 -40
  180. package/.docs/flow-io/flow-README.md +0 -76
  181. package/.docs/flow-io/narrix.md +0 -124
  182. package/.docs/flow-io/web-scoping.md +0 -135
  183. package/.docs/flow-io/xynthesis-post.md +0 -154
  184. package/.docs/flow-io/xynthesis-pre.md +0 -181
  185. package/.docs/gap-analysis.md +0 -201
  186. package/.docs/integration-facts-ai-tasks.md +0 -109
  187. package/.docs/investigation/ai-skills.md +0 -170
  188. package/.docs/investigation/external-packages-assignments.md +0 -66
  189. package/.docs/investigation/integration-summary.md +0 -20
  190. package/.docs/investigation/narrix-catalox.md +0 -29
  191. package/.docs/investigation/workplan-close-graph-engine-gaps.md +0 -101
  192. package/.docs/logging-stack.md +0 -30
  193. package/.docs/memory-narrix-adapter-developer-guide.md +0 -402
  194. package/.docs/memory-narrix-adapter-requirements.md +0 -112
  195. package/.docs/narrix-context-consumption-gap.md +0 -184
  196. package/.docs/narrix-context-downstream-report.md +0 -30
  197. package/.docs/narrix-ingest-and-packs-library-spec.md +0 -240
  198. package/.docs/narrix-record-input-current-design.md +0 -48
  199. package/.docs/pacakge.md +0 -48
  200. package/.docs/possible-components/README.md +0 -11
  201. package/.docs/possible-components/integration/README.md +0 -10
  202. package/.docs/possible-components/integration/gaps-when-merging.md +0 -16
  203. package/.docs/possible-components/integration/platform.md +0 -54
  204. package/.docs/possible-components/integration/reintegrate-into-ai-tasks.md +0 -26
  205. package/.docs/possible-components/integration/roadmap-and-checklists.md +0 -54
  206. package/.docs/possible-components/post-component/README.md +0 -18
  207. package/.docs/possible-components/post-component/builder-guide.md +0 -175
  208. package/.docs/possible-components/post-component/gaps-and-artifacts.md +0 -52
  209. package/.docs/possible-components/post-component/handler-audit.md +0 -47
  210. package/.docs/possible-components/post-component/handler-polish.md +0 -41
  211. package/.docs/possible-components/post-component/unified-protocol.md +0 -59
  212. package/.docs/possible-components/pre-component/README.md +0 -22
  213. package/.docs/possible-components/pre-component/builder-guide.md +0 -127
  214. package/.docs/possible-components/pre-component/gaps-and-artifacts.md +0 -35
  215. package/.docs/possible-components/pre-component/handler-ai-scoping.md +0 -45
  216. package/.docs/possible-components/pre-component/handler-narrix-preprocessor.md +0 -49
  217. package/.docs/possible-components/pre-component/handler-narrix-system2.md +0 -35
  218. package/.docs/possible-components/pre-component/handler-synthesized-context.md +0 -65
  219. package/.docs/possible-components/pre-component/handler-web-scope.md +0 -29
  220. package/.docs/possible-components/pre-component/unified-protocol.md +0 -89
  221. package/.docs/prefer-openrouter-routing-policy.md +0 -114
  222. package/.docs/questions-for-ai-skills.md +0 -123
  223. package/.docs/realtime-narrixing-gap-analysis.md +0 -40
  224. package/.docs/realtime-narrixing.md +0 -433
  225. package/.docs/run-context-object.md +0 -32
  226. package/.docs/session-id-usage.md +0 -26
  227. package/.docs/skill-library-spec.md +0 -249
  228. package/.docs/synthesized-context-strategy-spec.md +0 -906
  229. package/.docs/upstream-issue/2026-03-21_woroces-ai-tasks_ISSUE-006_web-scope-question-from-cni-entity.md +0 -46
  230. package/.docs/web-scopper-embed.md +0 -93
  231. package/.docs/xynthesis-wiring-and-io.md +0 -12
  232. package/documenations/activix-feature-request-identity.md +0 -123
  233. package/documenations/bug-report-xynthesis-and-synthesis-call.md +0 -217
  234. package/documenations/feature-request-ai-skills-raw-template-access.md +0 -82
  235. package/documenations/feature-request-athenix-core-directive.md +0 -145
  236. package/documenations/feature-request-athenix-token-extraction.md +0 -124
  237. package/documenations/funcx-upstream-github-issues-draft.md +0 -153
  238. package/documenations/identity-metadata-contract.md +0 -165
  239. package/documenations/run-task-single-run-checklist.md +0 -109
  240. package/documenations/sessions/2026-06-08-subnets-model-resolution/CR-1-no-concrete-wire-in-graph-plans.md +0 -93
  241. package/documenations/sessions/2026-06-08-subnets-model-resolution/CR-2-skillModel-profile-only-at-storage.md +0 -88
  242. package/documenations/sessions/2026-06-08-subnets-model-resolution/CR-3-reject-concrete-models-in-catalog-rows.md +0 -76
  243. package/documenations/sessions/2026-06-08-subnets-model-resolution/FR-1-suggested-profile-in-catalogs.md +0 -96
  244. package/documenations/sessions/2026-06-08-subnets-model-resolution/FR-2-graph-engine-failure-phase-attribution.md +0 -92
  245. package/documenations/sessions/2026-06-08-subnets-model-resolution/INVESTIGATION-original-bug.md +0 -182
  246. package/documenations/sessions/2026-06-08-subnets-model-resolution/PROBLEM.md +0 -236
  247. package/documenations/sessions/2026-06-08-subnets-model-resolution/README.md +0 -11
  248. package/documenations/sessions/2026-06-08-subnets-model-resolution/funcx-test-resolveModel.cheapDefaultWireSlug.test.ts +0 -117
  249. package/documenations/upstream-feature-requests/ai-tasks-wrap-up-after-upstream.md +0 -129
  250. package/documenations/upstream-feedback-request-shape-clarification.md +0 -101
  251. package/documenations/web-context-precedence.md +0 -33
  252. package/documenations/xynthesis-activix-telemetry.md +0 -28
@@ -1,182 +0,0 @@
1
- # Investigation: `Unknown model "google/gemini-2.5-flash-lite"`
2
-
3
- Status: **runtime / consumer deps** (skill catalog ruled out)
4
- Filed: 2026-06-08
5
- Repro: `worox-graphs-playground` — `graph:subnets-analysis`, `node:inbound-reachability`, `skillKey=professional-answer`
6
- Verified: 2026-06-08 — **no models in skill/funcx content catalog**; runtime `cheap/default` → wire slug is correct.
7
-
8
- ---
9
-
10
- ## Executive summary
11
-
12
- | Question | Answer |
13
- |----------|--------|
14
- | Was `google/gemini-2.5-flash-lite` the authored input? | **No** — runtime uses `cheap/default`. |
15
- | Is `cheap/default` → `google/gemini-2.5-flash-lite` correct? | **Yes** — expected OpenRouter slug from `@x12i/ai-profiles` at **invoke time**. |
16
- | Did it come from the skill catalog? | **No** — Catalox skill rows store no model; verified. |
17
- | Which phase failed? | Almost certainly **PRE or POST xynthesis** (funcx), **not** MAIN `professional-answer` (ai-gateway). |
18
- | Why does the error say `skillKey=professional-answer`? | Graph-engine wraps the whole `runTask` failure under the node task key. |
19
-
20
- **Conclusion:** Runtime profile resolution is fine. If the error persists, it is **funcx + `@x12i/ai-tools` package catalog lookup** at invoke (or misleading phase in the error wrapper) — **not** skill catalog data and not wrong input from `cheap/default`.
21
-
22
- ### “Catalog” disambiguation
23
-
24
- | Name | Role in this incident |
25
- |------|----------------------|
26
- | Catalox **ai-skills** catalog | Templates + Optimixer only — **not involved** |
27
- | **Runtime** `modelConfig` / graph plan | Source of `cheap/default` — **correct** |
28
- | `@x12i/ai-tools` **models catalog** (inside funcx) | Validates `google/gemini-2.5-flash-lite` at `ask()` — **only place “catalog-resolvable” applies** |
29
-
30
- ---
31
-
32
- ## Observed error
33
-
34
- ```json
35
- {
36
- "nodeId": "node:inbound-reachability",
37
- "error": {
38
- "message": "runTask failed (skillKey=professional-answer nodeId=node:inbound-reachability graphId=graph:subnets-analysis): Unknown model \"google/gemini-2.5-flash-lite\". Pass a catalog-resolvable model slug (e.g. \"deepseek/deepseek-v4-flash\")."
39
- }
40
- }
41
- ```
42
-
43
- Stack: `@exellix/graph-engine` → `runTask` → root error from `@x12i/funcx` `requireCatalogModel()`.
44
-
45
- Exact funcx message shape (from `@x12i/funcx` ≥4.3):
46
-
47
- ```text
48
- Unknown model "<slug>". Pass a catalog-resolvable model slug (e.g. "deepseek/deepseek-v4-flash").
49
- ```
50
-
51
- ai-gateway / ai-tools `ModelResolutionError` uses a **different** message (`Could not resolve model "..." (provider: "...")`). So this failure is **not** the MAIN gateway path.
52
-
53
- ---
54
-
55
- ## Resolution chain (verified in mono-repo)
56
-
57
- ### 1. ai-profiles: `cheap/default`
58
-
59
- Bundled registry (`@x12i/ai-profiles`):
60
-
61
- - Profile `cheap`, choice `default`
62
- - `provider: google`, `modelId: gemini-2.5-flash-lite`
63
- - OpenRouter invocation: `google/gemini-2.5-flash-lite`
64
-
65
- ### 2. xynthesis: alias → bare OpenRouter slug
66
-
67
- `resolveXynthesisModel("cheap/default")` → `wireModelId: "google/gemini-2.5-flash-lite"`
68
- Used by `FuncxInvoker.client.ask({ model: wireModelId })`.
69
-
70
- ### 3. ai-tasks PRE step
71
-
72
- When `taskConfiguration.aiTaskStrategies.pre` includes synthesis, `_runSynthesizedContextPreStep` reads `modelConfig.preActionModel` (typically `cheap/default` for subnet-style graphs).
73
-
74
- Fixture pattern in this repo:
75
-
76
- ```json
77
- "modelConfig": {
78
- "preActionModel": "cheap/default",
79
- "postActionModel": "cheap/default",
80
- "skillModel": "<MAIN profile or concrete — separate from PRE>"
81
- }
82
- ```
83
-
84
- ### 4. MAIN professional-answer (different path)
85
-
86
- `skillModel` resolves to **gateway** wire id, e.g. `openrouter/google/gemini-2.5-flash-lite` — not the bare slug in the error.
87
-
88
- ---
89
-
90
- ## Failure hypothesis (ranked)
91
-
92
- ### H1 — Stale `@x12i/ai-tools` / `@x12i/funcx` in `worox-graphs-playground` (most likely)
93
-
94
- funcx `requireCatalogModel()` calls ai-tools `createModelNameResolver(catalog).resolve()`. If the installed catalog predates `gemini-2.5-flash-lite`, or OpenRouter lane index is incomplete, `found: false` → this exact error.
95
-
96
- **Mono-repo reference versions (known good):**
97
-
98
- | Package | Version in `ai-tasks` |
99
- |---------|----------------------|
100
- | `@exellix/ai-tasks` | 9.0.3 |
101
- | `@exellix/xynthesis` | 4.6.4 |
102
- | `@x12i/funcx` (override) | ^4.6.0 |
103
- | `@x12i/ai-profiles` | ^3.3.0 |
104
-
105
- ### H2 — funcx ai-tools client disabled or throws in catalog load
106
-
107
- funcx `resolveModelSlug` catches all errors and returns `found: false` — surfaces as "Unknown model" even when the slug is valid.
108
-
109
- Check env / config: FuncX ai-tools `enabled=false`, broken catalog fetch, etc.
110
-
111
- ### H3 — Compile-time concrete slug injection (secondary)
112
-
113
- If graph plan has `resolvedInvocationSnapshot.modelId: "google/gemini-2.5-flash-lite"` on a PRE unit, behavior is the same at funcx — but **authoring** was still `cheap/default`. See CR-1.
114
-
115
- ### H4 — Wrong phase in operator UI (symptom only)
116
-
117
- Operator reads "professional-answer failed" and assumes MAIN model is wrong. PRE failed before MAIN ran. See FR-2.
118
-
119
- ---
120
-
121
- ## Investigation checklist (`worox-graphs-playground`)
122
-
123
- Run in the consumer repo (not this mono-repo unless linked):
124
-
125
- - [ ] **1. Confirm runtime `modelConfig` on the failing node**
126
- - `preActionModel`, `skillModel`, `postActionModel` on the `RunTaskRequest` graph-engine builds.
127
- - Expect: `cheap/default` on PRE; MAIN slot may differ.
128
-
129
- - [ ] **2. Confirm compiled `nodePlan` for `node:inbound-reachability`**
130
- - Per-unit `modelSelection` (`profileChoice` vs concrete).
131
- - `resolvedInvocationSnapshot.modelId` — if present with concrete slug, note for CR-1.
132
-
133
- - [ ] **3. Lockfile versions**
134
- ```bash
135
- npm ls @x12i/funcx @x12i/ai-tools @exellix/xynthesis @exellix/ai-tasks @x12i/ai-profiles
136
- ```
137
- Compare to mono-repo `ai-tasks/package.json`.
138
-
139
- - [ ] **4. Catalog spot-check in installed tree**
140
- ```bash
141
- rg "gemini-2.5-flash-lite" node_modules/@x12i/ai-tools/dist/
142
- ```
143
- Should appear in bundled `models-catalog.json` chunk.
144
-
145
- - [ ] **5. Reproduce with trace**
146
- - `executionMode: "trace"` on `runTask`.
147
- - Look for xynthesis `wireModelId` / `profileChoiceKey: "cheap/default"` **before** any MAIN skill observation.
148
- - If only PRE logs appear → confirms H4.
149
-
150
- - [ ] **6. Minimal isolated PRE call**
151
- - xynthesis `executeXynthesisAction` with `model: "cheap/default"` and same env as playground.
152
- - If fails → H1/H2. If passes → graph wiring or plan overlay issue.
153
-
154
- - [ ] **7. OPENROUTER_API_KEY**
155
- - Required for OpenRouter backend; missing key causes other errors, but verify present.
156
-
157
- ---
158
-
159
- ## What is **not** the bug
160
-
161
- - Choosing `cheap/default` for PRE/POST.
162
- - ai-profiles mapping `cheap/default` → `google/gemini-2.5-flash-lite`.
163
- - xynthesis emitting bare OpenRouter slug to funcx (by design since xynthesis ≥4.1.8).
164
- - Skill / funcx **content** catalog storing or supplying a model (verified: **no models there**).
165
- - Confusing runtime resolved wire with catalog-authored model (there is no latter).
166
-
167
- ---
168
-
169
- ## Recommended fix path (consumer)
170
-
171
- 1. Align `@x12i/funcx`, `@x12i/ai-tools`, `@exellix/xynthesis`, `@exellix/ai-tasks` to mono-repo versions (or newer).
172
- 2. Re-run graph; if still failing, run checklist §5–6.
173
- 3. If catalog is current and resolve still fails, file upstream bug on funcx/ai-tools with `resolveModelSlug` diagnostics (`attemptedStrategies`, `bestRejectedCandidate`).
174
-
175
- ---
176
-
177
- ## Related mono-repo references
178
-
179
- - PRE fixture: `ai-tasks/test/fixtures/run-task/graph-engine-pre-synthesis.json`
180
- - xynthesis wire: `xynthesis/src/funcxInvoker.ts`, `xynthesis/src/resolveAiProfileModel.ts`
181
- - funcx validation: `node_modules/@x12i/funcx/dist/src/serve.js` → `requireCatalogModel`
182
- - Error wrap: `ai-tasks/src/errors/runTaskExecutionError.ts`
@@ -1,236 +0,0 @@
1
- # Problem knowledge: `Unknown model "google/gemini-2.5-flash-lite"`
2
-
3
- **Session:** 2026-06-08
4
- **Repro:** `worox-graphs-playground` — `graph:subnets-analysis`, `node:inbound-reachability`, `skillKey=professional-answer`
5
- **Status:** **Resolved** in **`@x12i/funcx@4.9.5+`** (catalog gate via **`@x12i/ai-profiles`**). Ship **`@exellix/xynthesis@4.6.6+`** and **`@exellix/ai-tasks@9.0.5+`** with **`@x12i/funcx@^4.9.5`** declared in dependencies.
6
-
7
- ---
8
-
9
- ## 1. What we observed
10
-
11
- ```json
12
- {
13
- "nodeId": "node:inbound-reachability",
14
- "error": {
15
- "message": "runTask failed (skillKey=professional-answer nodeId=node:inbound-reachability graphId=graph:subnets-analysis): Unknown model \"google/gemini-2.5-flash-lite\". Pass a catalog-resolvable model slug (e.g. \"deepseek/deepseek-v4-flash\")."
16
- }
17
- }
18
- ```
19
-
20
- Stack (from consumer): `@exellix/graph-engine` → `@exellix/ai-tasks` `runTask` → … → `@x12i/funcx` `Client.ask()`.
21
-
22
- The exact substring `Pass a catalog-resolvable model slug` is thrown only by **`@x12i/funcx`** `requireCatalogModel()` (funcx ≥4.3). It is **not** from ai-gateway, ai-skills, or Catalox.
23
-
24
- ---
25
-
26
- ## 2. What we verified about input (runtime data)
27
-
28
- | Fact | Source |
29
- |------|--------|
30
- | Runtime model input was **`cheap/default`**, not a concrete slug in authoring | Operator check |
31
- | **Skill catalog (Catalox `ai-skills`) stores no model** for `professional-answer` or other skills — templates + Optimixer only | Operator check + mono-repo `AI_SKILLS_CATALOG_ITEMS` |
32
- | `cheap/default` → `google/gemini-2.5-flash-lite` is **correct** OpenRouter wire output for PRE/POST xynthesis | `@x12i/ai-profiles` bundled registry |
33
-
34
- **Important:** The error string shows a **resolved wire slug**, not what was typed in the graph. That slug is **invoke-time output**, not catalog-authored data.
35
-
36
- ---
37
-
38
- ## 3. Three different “catalog” meanings (do not mix)
39
-
40
- | Name | What it is | Role in this incident |
41
- |------|------------|------------------------|
42
- | **Catalox skill catalog** | Skill templates, Optimixer fields | **Not involved** — no models |
43
- | **Runtime orchestration data** | `RunTaskRequest.modelConfig`, graph `modelSelection`, per-unit slots | **Source of `cheap/default`** — correct |
44
- | **`@x12i/ai-tools` models catalog** | JSON bundled inside the **npm package**; used by funcx/gateway for slug lookup + pricing | **Where the error is thrown** — funcx asks “is this slug known?” |
45
- | **`@x12i/ai-profiles` registry** | Profile/choice → vendor SKU + OpenRouter invocation mapping | **Already used successfully** before funcx (see §4) |
46
-
47
- ---
48
-
49
- ## 4. End-to-end path today (what actually runs)
50
-
51
- ### 4.1 Graph → ai-tasks
52
-
53
- For subnet-style nodes running `professional-answer` with PRE synthesis, a typical `RunTaskRequest` looks like:
54
-
55
- ```json
56
- {
57
- "skillKey": "professional-answer",
58
- "modelConfig": {
59
- "preActionModel": "cheap/default",
60
- "skillModel": "<profile or concrete — MAIN, separate hop>",
61
- "postActionModel": "cheap/default"
62
- },
63
- "taskConfiguration": {
64
- "aiTaskStrategies": { "pre": "synthesis", ... }
65
- }
66
- }
67
- ```
68
-
69
- Graph-engine wraps any `runTask` failure with `skillKey=professional-answer` even when **PRE dies before MAIN** — misleading for operators.
70
-
71
- ### 4.2 PRE synthesis — **first hop: ai-profiles** (already in use)
72
-
73
- 1. ai-tasks `_runSynthesizedContextPreStep` reads `preActionModel` → `"cheap/default"`.
74
- 2. Calls `@exellix/xynthesis` `executeXynthesisAction({ model: "cheap/default", ... })`.
75
- 3. xynthesis `resolveXynthesisModel("cheap/default")` calls **`@x12i/ai-profiles`**:
76
- - Profile `cheap`, choice `default`
77
- - Vendor: `google` / `gemini-2.5-flash-lite`
78
- - OpenRouter invocation: `google/gemini-2.5-flash-lite`
79
- 4. xynthesis builds `modelResolution` snapshot and calls `FuncxInvoker` with:
80
- - `model: "cheap/default"` (alias)
81
- - `modelResolution.wireModelId: "google/gemini-2.5-flash-lite"`
82
-
83
- If step 3 fails, xynthesis throws **before** funcx — e.g. unknown profile/choice.
84
- **We got past step 3** (otherwise the error message would be about alias resolution, not “Unknown model … slug”).
85
-
86
- ### 4.3 PRE synthesis — **second hop: funcx + ai-tools** (where it breaks)
87
-
88
- 5. `FuncxInvoker` → `client.ask(userPrompt, { model: "google/gemini-2.5-flash-lite", ... })`.
89
- 6. funcx `resolveAskRuntime()` → `requireCatalogModel({ model, provider: "openrouter" })`.
90
- 7. funcx `resolveModelSlug()` loads **`@x12i/ai-tools`** catalog via `getAiModelsCatalogClient().getAllModels()` and runs `createModelNameResolver(catalog).resolve(...)`.
91
- 8. If `found: false` → throws:
92
-
93
- ```text
94
- Unknown model "google/gemini-2.5-flash-lite". Pass a catalog-resolvable model slug ...
95
- ```
96
-
97
- funcx README (≥4.3) documents this split explicitly:
98
-
99
- - **Host (xynthesis):** resolve `profile/choice` with **ai-profiles**, pass **concrete slug** to funcx.
100
- - **funcx:** slug must be **catalog-resolvable** in **ai-tools** — funcx does **not** resolve `cheap/default` itself.
101
-
102
- ### 4.4 MAIN `professional-answer` — different path (not this error)
103
-
104
- MAIN uses `skillModel` → `@exellix/ai-skills` → `@x12i/ai-gateway`:
105
-
106
- - Wire shape: `openrouter/google/gemini-2.5-flash-lite` (gateway prefix), not bare slug.
107
- - Validation: ai-tools `resolveInvokeModel` via gateway, **different error message** (`Could not resolve model "..." (provider: "...")`).
108
-
109
- So this incident is **PRE (or POST) xynthesis/funcx**, not MAIN professional-answer gateway invoke.
110
-
111
- ---
112
-
113
- ## 5. ai-profiles vs ai-tools — what is done today, could ai-profiles replace ai-tools here?
114
-
115
- ### What is done today
116
-
117
- | Step | Package | Job |
118
- |------|---------|-----|
119
- | Profile → wire slug | **ai-profiles** (in xynthesis) | `cheap/default` → `google/gemini-2.5-flash-lite` |
120
- | Slug accepted for HTTP call? | **ai-tools** (inside funcx) | Re-lookup slug in bundled models JSON |
121
- | LLM HTTP call | **funcx** → OpenRouter | Uses validated `modelId` |
122
-
123
- **ai-profiles is already in the pipeline.** The failure is not “we should use ai-profiles instead of nothing” — it is **ai-tools rejecting a slug that ai-profiles just produced**.
124
-
125
- ### Could funcx validate with ai-profiles instead of ai-tools?
126
-
127
- **Theoretically yes, but not how funcx is built today.**
128
-
129
- - ai-profiles exposes `ensureConcreteModel("google/gemini-2.5-flash-lite")` and `resolveCatalogModel(...)` against its own `models-catalog.json` / registry linkage — similar knowledge, **different package and index**.
130
- - funcx 4.x is wired to **ai-tools** for `requireCatalogModel`, pricing (`readCallCostFromAskResult`), and Activix `autoCost`.
131
- - funcx README requires both packages aligned (e.g. **^3.3.0**).
132
-
133
- **Practical options (no code changed in this session):**
134
-
135
- | Approach | Effect |
136
- |----------|--------|
137
- | **Align versions** in `worox-graphs-playground`: `@x12i/funcx`, `@x12i/ai-tools`, `@x12i/ai-profiles`, `@exellix/xynthesis` to mono-repo pins | Most likely fix — both catalogs should agree on `gemini-2.5-flash-lite` |
138
- | **Pass `cheap/default` into funcx `ask()`** | **Fails by design** — funcx requires concrete catalog slug, not profile alias |
139
- | **funcx skip ai-tools check when `modelResolution` from ai-profiles present** | Would need **funcx product change** — trust host resolution, use ai-tools only for cost |
140
- | **funcx call ai-profiles `resolveCatalogModel` instead of ai-tools resolver** | Would need **funcx product change** — duplicate validation path, still two catalogs unless unified |
141
-
142
- **“Work better with ai-profiles”** in the current architecture means: **keep resolving in xynthesis via ai-profiles (already done), then ensure the ai-tools copy in the same install recognizes the emitted slug** — not replace step 1, fix step 2 alignment.
143
-
144
- ---
145
-
146
- ## 6. Why ai-profiles can succeed and ai-tools can still fail
147
-
148
- Both use bundled JSON that can **drift across package versions** or **resolve differently**:
149
-
150
- - ai-profiles: registry + `normalizeInvokeModel` → OpenRouter slug from profile choice.
151
- - ai-tools: `ModelNameResolver` over merged direct + OpenRouter catalog maps; lookup strategies (exact, slug, provider-prefix, fallback catalog).
152
-
153
- Known mono-repo state (reference install):
154
-
155
- - **ai-tools** direct catalog includes `provider: google`, `modelId: gemini-2.5-flash-lite`.
156
- - **ai-tools** OpenRouter catalog may list newer ids (e.g. `google/gemini-3.1-flash-lite`) without listing `2.5-flash-lite` under OpenRouter lane — resolver should fall back to direct catalog, **if consumer ai-tools version is current**.
157
-
158
- Failure modes for step 7:
159
-
160
- 1. **Older `@x12i/ai-tools`** in playground — slug not in bundled JSON.
161
- 2. **Older `@x12i/funcx`** — different resolver behavior.
162
- 3. **ai-tools client disabled / throws** — funcx catches and returns `found: false` → same “Unknown model” message.
163
- 4. **Version skew** — ai-profiles 3.3 emits slug ai-tools 2.x does not index.
164
-
165
- ---
166
-
167
- ## 7. What we know vs what we do not know
168
-
169
- ### Known
170
-
171
- - Input at runtime: `cheap/default` (verified).
172
- - Skill Catalox catalog: no models (verified).
173
- - Wire slug in error is expected output of ai-profiles for `cheap/default`.
174
- - Error originates in funcx `requireCatalogModel` (ai-tools gate), not skill catalog.
175
- - Error message shape implies PRE/POST funcx path, not MAIN gateway.
176
- - graph-engine attributes failure to `skillKey=professional-answer` regardless of phase.
177
-
178
- ### Not confirmed in consumer repo (if debugging continues)
179
-
180
- - Installed versions: `npm ls @x12i/funcx @x12i/ai-tools @x12i/ai-profiles @exellix/xynthesis`
181
- - Whether error still reproduces after version align.
182
- - Whether `executionMode: "trace"` shows `profileChoiceKey: "cheap/default"` and `wireModelId` on PRE hop only.
183
- - Whether `OPENROUTER_API_KEY` is set (missing key usually causes different errors, but worth ruling out).
184
-
185
- ### Ruled out
186
-
187
- - Wrong profile choice in authoring (`cheap/default` is valid).
188
- - Skill catalog supplying `google/gemini-2.5-flash-lite`.
189
- - xynthesis double-prefix bug (`openrouter/google/...` to OpenRouter API) — fixed in xynthesis ≥4.1.8; error shows **bare** slug, which is correct for funcx.
190
-
191
- ---
192
-
193
- ## 8. Minimal reproduction mental model
194
-
195
- ```text
196
- cheap/default
197
- → [ai-profiles] OK → google/gemini-2.5-flash-lite
198
- → [funcx ask + ai-tools requireCatalogModel] FAIL? → Unknown model
199
- → [OpenRouter HTTP] never reached
200
- ```
201
-
202
- If ai-profiles step failed, you would never see this exact funcx message with that slug.
203
-
204
- ---
205
-
206
- ## 9. Recommended next step (consumer only)
207
-
208
- In `worox-graphs-playground`:
209
-
210
- ```bash
211
- npm ls @x12i/funcx @x12i/ai-tools @x12i/ai-profiles @exellix/xynthesis @exellix/ai-tasks
212
- rg "gemini-2.5-flash-lite" node_modules/@x12i/ai-tools/dist/
213
- ```
214
-
215
- Align to mono-repo reference (`ai-tasks/package.json`: funcx ^4.6.0 override, ai-profiles ^3.3.0, xynthesis ^4.6.4). Re-run graph.
216
-
217
- If still failing with current catalogs, file upstream on **funcx/ai-tools** with: input alias `cheap/default`, ai-profiles wire `google/gemini-2.5-flash-lite`, and ai-tools resolver `found: false` diagnostics.
218
-
219
- ---
220
-
221
- ## 10. Mono-repo code references
222
-
223
- | Piece | Location |
224
- |-------|----------|
225
- | PRE reads `preActionModel` | `ai-tasks/src/core/task-sdk.ts` `_runSynthesizedContextPreStep` |
226
- | ai-profiles resolve | `xynthesis/src/resolveAiProfileModel.ts` `resolveXynthesisModel` |
227
- | Pass wire to funcx | `xynthesis/src/executeXynthesisAction.ts`, `xynthesis/src/funcxInvoker.ts` |
228
- | funcx ai-tools gate | `node_modules/@x12i/funcx/dist/src/serve.js` `requireCatalogModel` |
229
- | cheap/default → gemini | `node_modules/@x12i/ai-profiles/dist/data/models-profiles.json` |
230
- | Subnet-style fixture | `ai-tasks/test/fixtures/run-task/graph-engine-pre-synthesis.json` |
231
-
232
- ---
233
-
234
- ## 11. Session CR/FR docs
235
-
236
- Deferred — not part of this problem analysis. See sibling files only if needed for future product work.
@@ -1,11 +0,0 @@
1
- # Session: subnets-analysis model resolution (2026-06-08)
2
-
3
- **Canonical doc:** [PROBLEM.md](./PROBLEM.md) — everything we know about the `Unknown model "google/gemini-2.5-flash-lite"` failure.
4
-
5
- ## One-line summary
6
-
7
- Runtime input `cheap/default` is correct; ai-profiles resolves it to `google/gemini-2.5-flash-lite`; **funcx then re-validates that slug against `@x12i/ai-tools`** (not the skill catalog) and throws. Skill Catalox catalog has no models.
8
-
9
- ## Other files in this folder
10
-
11
- CR/FR drafts from earlier in the session — **out of scope** for the original bug; kept for reference only.
@@ -1,117 +0,0 @@
1
- /**
2
- * Copy to funcx repo: `test/resolveModel.cheapDefaultWireSlug.test.ts`
3
- *
4
- * Reproduces PRE xynthesis catalog gate (graphs-studio / ai-tasks):
5
- * cheap/default → ai-profiles wire slug → funcx resolveModelSlug / requireCatalogModel
6
- *
7
- * Run (from funcx root):
8
- * mode=debug FUNCX_ACTIVIX_ENABLED=0 node --import ./test/helpers/testGlobalSetup.ts --import tsx --test test/resolveModel.cheapDefaultWireSlug.test.ts
9
- *
10
- * BEFORE fix (funcx <4.9, resolveModelSlug uses getAllModels + narrow resolver):
11
- * - ai-tools catalog.resolveModel → found: true
12
- * - funcx resolveModelSlug → found: false → THIS TEST FAILS
13
- *
14
- * AFTER fix (funcx >=4.9, resolveModelSlug delegates to @x12i/ai-profiles requireCatalogModel):
15
- * - both → found: true → THIS TEST PASSES
16
- */
17
- import assert from "node:assert/strict";
18
- import { describe, it, beforeEach } from "node:test";
19
- import { ensureConcreteModel } from "@x12i/ai-profiles";
20
- import {
21
- createAiToolsInvokeClient,
22
- createModelNameResolver,
23
- } from "@x12i/ai-tools";
24
- import {
25
- configureAiToolsEngine,
26
- requireCatalogModel,
27
- resetAiToolsClients,
28
- resolveModelSlug,
29
- } from "../src/index.js";
30
-
31
- const PRE_ALIAS = "cheap/default";
32
- /** Wire slug xynthesis passes to funcx ask() after ai-profiles resolution. */
33
- const EXPECTED_WIRE_SLUG = "google/gemini-2.5-flash-lite";
34
-
35
- function useDefaultDevCatalogEngine(): void {
36
- resetAiToolsClients();
37
- configureAiToolsEngine({
38
- bundledOnly: false,
39
- catalogLane: "text",
40
- });
41
- }
42
-
43
- describe("resolveModel — cheap/default PRE wire slug (subnets-analysis repro)", () => {
44
- beforeEach(() => {
45
- useDefaultDevCatalogEngine();
46
- });
47
-
48
- it("step A: ai-profiles resolves cheap/default to the expected OpenRouter wire slug", () => {
49
- const resolved = ensureConcreteModel(PRE_ALIAS);
50
- assert.equal(
51
- resolved.modelId,
52
- EXPECTED_WIRE_SLUG,
53
- "host/xynthesis must resolve profile alias before funcx"
54
- );
55
- });
56
-
57
- it("step B–E: funcx must accept the wire slug when ai-tools full resolveModel does (default dev catalog)", async () => {
58
- // --- step A (again at runtime boundary) ---
59
- const resolved = ensureConcreteModel(PRE_ALIAS);
60
- const wireSlug = resolved.modelId;
61
- assert.equal(wireSlug, EXPECTED_WIRE_SLUG);
62
-
63
- // --- step C: narrow path input (what funcx uses today) ---
64
- const client = createAiToolsInvokeClient({ bundledOnly: false });
65
- const mergedMap = await client.catalog.getAllModels();
66
- const narrow = createModelNameResolver(mergedMap).resolve({
67
- model: wireSlug,
68
- provider: "openrouter",
69
- });
70
-
71
- // --- step D: ai-tools full path (what funcx SHOULD use) ---
72
- const full = await client.catalog.resolveModel({
73
- model: wireSlug,
74
- provider: "openrouter",
75
- });
76
-
77
- // --- step E: funcx public API used by Client.ask() → requireCatalogModel ---
78
- const funcx = await resolveModelSlug({
79
- model: wireSlug,
80
- provider: "openrouter",
81
- });
82
-
83
- // Diagnostic log when run with `node --test` (visible in CI output)
84
- console.info("[resolveModel.cheapDefaultWireSlug]", {
85
- alias: PRE_ALIAS,
86
- wireSlug,
87
- mergedCatalogSize: mergedMap.size,
88
- mergedHasSlug: mergedMap.has(wireSlug),
89
- narrowFound: narrow.found,
90
- fullResolveFound: full.found,
91
- fullResolvedReason: full.found ? full.resolvedReason : full.reason,
92
- funcxResolveFound: funcx.found,
93
- });
94
-
95
- assert.equal(
96
- full.found,
97
- true,
98
- `ai-tools catalog.resolveModel must accept wire slug "${wireSlug}" (ai-profiles fallback / direct lane)`
99
- );
100
-
101
- // Core regression: funcx must not reject a slug that ai-tools full resolver accepts.
102
- assert.equal(
103
- funcx.found,
104
- full.found,
105
- "resolveModelSlug must delegate to catalog.resolveModel (not getAllModels narrow map only)"
106
- );
107
- assert.equal(funcx.modelId, wireSlug);
108
-
109
- // Same gate Client.ask() hits before OpenRouter HTTP:
110
- const required = await requireCatalogModel({
111
- model: wireSlug,
112
- provider: "openrouter",
113
- });
114
- assert.equal(required.found, true);
115
- assert.equal(required.modelId, wireSlug);
116
- });
117
- });
@@ -1,129 +0,0 @@
1
- # `@exellix/ai-tasks` — wrap-up after upstream invoke-contract fixes
2
-
3
- Status: **unblocked** — **@exellix/xynthesis ≥ 4.3.1** shipped ([xynthesis-ai-profiles-2.1-import-break.md](./xynthesis-ai-profiles-2.1-import-break.md)); invoke-contract items below are shipped in **ai-skills 6.0** / **xynthesis 4.3**:
4
-
5
- - [`ai-skills-orchestrator-invoke-contract-5.9.md`](./ai-skills-orchestrator-invoke-contract-5.9.md)
6
- - [`xynthesis-orchestrator-invoke-contract-4.2.md`](./xynthesis-orchestrator-invoke-contract-4.2.md)
7
-
8
- Owner: `@exellix/ai-tasks`
9
- Target release: **8.4.x** (or **8.5.0** if breaking `llmCall` surface)
10
-
11
- ---
12
-
13
- ## Contract (locked with product)
14
-
15
- **ai-tasks sends to lower layers:**
16
-
17
- - Model ids via `RunTaskModelConfig` triplet (`preActionModel`, `skillModel`, `postActionModel`) + optional `llmCall.model` overrides.
18
- - `temperature`, `topP`, **`reasoningEffort`** (once upstream exposes it).
19
- - **`outputExpectation`** on xynthesis-backed hops only (sizing intent — **not** a token count).
20
-
21
- **ai-tasks does not send:**
22
-
23
- - `maxTokens` / `maxTokensCap` on `modelConfig`, `runSkill`, `executeXynthesisAction`, or direct gateway repair (unless product later revives an explicit ceiling knob with a new name).
24
-
25
- **Lower layers own:**
26
-
27
- - MAIN caps → `@exellix/ai-skills` Optimixer + Catalox skill catalog.
28
- - PRE/POST/scoping/utility caps → `@exellix/xynthesis` `resolveEffectiveMaxTokens` inside `executeXynthesisAction`.
29
-
30
- ---
31
-
32
- ## Already done in ai-tasks (this branch)
33
-
34
- - [x] `RunTaskRequest.modelConfig` typed as `RunTaskModelConfig` (not ai-skills `ModelConfig` with `maxTokens`).
35
- - [x] Removed `maxTokens` from `RunTaskModelConfig`; strip legacy key at ai-skills boundary.
36
- - [x] Stopped mapping `llmCall.maxTokensCap` → `modelConfig.maxTokens` in `buildAiSkillsModelConfigForMain`.
37
- - [x] Trace repair: `mapGatewayInvokeToTrace` uses `maxTokensRequested` only (not `modelConfig.maxTokens`).
38
- - [x] `@exellix/xynthesis` ≥ 4.3.1 in `package.json`; bare profile keys normalized via `toStrictAiProfileResolveInput` before xynthesis invoke.
39
- - [x] Tests/fixtures use `cheap/default` + `pro/default` (no legacy `balanced` default).
40
- - [x] Public exports: `listAiTasksProfileChoiceKeys`, `toStrictAiProfileResolveInput`.
41
- - [x] `npm run build` + `npm run test` green (390 pass / 0 fail).
42
-
43
- ---
44
-
45
- ## TODO after upstream ships
46
-
47
- ### 1. Remove broken / duplicate token budgeting
48
-
49
- | File / area | Change |
50
- |-------------|--------|
51
- | `src/internal/resolveLlmCallForXynthesis.ts` | Remove `resolveMaxTokens` import; either delete token resolution or reduce to **outputExpectation-only** helper (rename e.g. `resolveLlmOutputExpectationForXynthesis`). |
52
- | `src/internal/runPostStepLlmCall.ts` | Drop `maxTokens` / `resolveLlmCallForXynthesis` pre-resolution; pass **`outputExpectation`** (required). |
53
- | `src/synthesis/runStructuredSynthesisRobust.ts` | Repair path: stop `resolveMaxTokens`; do not push `maxTokens` into raw AIGateway `config` unless gateway documents a non-Optimixer escape hatch. |
54
- | `src/index.ts` | Stop re-exporting `resolveMaxTokens`; export `resolveEffectiveMaxTokens` only if graph-engine needs it (prefer not). |
55
- | `src/utilities/runUtility.ts` | Remove `maxTokens` forward to xynthesis finalize. |
56
- | `src/post-steps/resolvePostStepConfig.ts` | Remove env `*_MAX_TOKENS_CAP` wiring if contract is zero host caps (or keep env as deprecated no-op one release). |
57
-
58
- ### 2. Add `reasoningEffort` to ai-tasks surface
59
-
60
- | File | Change |
61
- |------|--------|
62
- | `src/types/llmCall.ts` | `reasoningEffort?: OptimixerReasoningEffort` (re-export type from `@x12i/optimixer` or xynthesis). |
63
- | `src/types/model-config.ts` | Optional tuning field; passthrough in `modelConfigTuningPassthrough` (not stripped). |
64
- | `src/types/task-types.ts` | Document on `llmCall` and post-step configs. |
65
- | `buildAiSkillsModelConfigForMain` | Forward to ai-skills `modelConfig` when upstream §1 ships. |
66
- | `runPostStepLlmCall` / `task-sdk` synthesis | Forward to `executeXynthesisAction` / structured params. |
67
- | `src/validation/helpers.ts` | Optional enum validation if finite set. |
68
- | `src/builders/task-request-builder.ts` | Document in `withLlmCall` JSDoc. |
69
-
70
- ### 3. Fix xynthesis call sites (no new upstream needed except §1–2)
71
-
72
- | Call site | Pass |
73
- |-----------|------|
74
- | `runPostStepLlmCall` → `executeXynthesisAction` | `outputExpectation`, `temperature`, `topP`, `sidekickAction` / `activixActionType`, `reasoningEffort` (when exists) |
75
- | PRE structured / markdown synthesis (`task-sdk`) | Same via gateway / `runStructuredSynthesisGatewayCall` params |
76
- | AI scoping | `outputExpectation` (already defaulted in `runScopingCall`) |
77
-
78
- ### 4. Remove / deprecate `maxTokensCap` on `LlmCallConfig`
79
-
80
- - **Breaking:** remove `maxTokensCap` from `LlmCallConfig`, `RunUtilityRequest.exec`, post-step env fallbacks, validation, README.
81
- - **Or soft:** mark deprecated in 8.4.1, ignore at runtime, remove in 8.5.0.
82
-
83
- Confirm with graph-engine before hard removal.
84
-
85
- ### 5. Tests & docs
86
-
87
- - [ ] `npm run build` + `tsc -p tsconfig.test.json` green (no `resolveMaxTokens` import).
88
- - [ ] `npm run test` green (mocks via `setSynthesisInvoker` unchanged).
89
- - [ ] Update [`README.md`](../../README.md) token-budget section (remove `llmCall.maxTokensCap` → `modelConfig.maxTokens` overlay story).
90
- - [ ] Update [`ai-skills-llm-observability.md`](./ai-skills-llm-observability.md) §2 (stale maxTokens wording).
91
- - [ ] Update [`xynthesis-llm-observability.md`](./xynthesis-llm-observability.md) superseded sections.
92
- - [ ] Link all three contract docs from [`BREAKING-CHANGES.md`](../../BREAKING-CHANGES.md) 8.4 section.
93
-
94
- ---
95
-
96
- ## Dependency order
97
-
98
- ```mermaid
99
- flowchart LR
100
- A[ai-skills: reasoningEffort on RunSkillRequest]
101
- B[xynthesis: reasoningEffort on ExecuteXynthesisActionRequest]
102
- C[xynthesis: verify temperature topP all paths]
103
- D[ai-tasks: remove maxTokens forwarding]
104
- E[ai-tasks: wire reasoningEffort + outputExpectation]
105
- A --> E
106
- B --> E
107
- C --> E
108
- D --> E
109
- ```
110
-
111
- Recommended sequence:
112
-
113
- 1. Merge **xynthesis** ai-profiles 2.1 import fix (**≥ 4.3.1**) + **ai-skills** contract PRs (can be parallel).
114
- 2. Bump `package.json`: `"@exellix/xynthesis": "^4.3.1"` (minimum — **do not** ship ai-tasks 8.4.x consumer release on **4.3.0**).
115
- 3. Execute **this wrap-up** checklist in one ai-tasks PR.
116
- 4. Release note in **8.4.x** or **8.5.0** with graph-engine migration (drop `maxTokensCap` on task payloads if removed).
117
-
118
- ---
119
-
120
- ## Quick smoke test after wrap-up
121
-
122
- ```bash
123
- npm run build
124
- npm run test
125
- # Optional live:
126
- # npm run test:e2e:synthesis
127
- ```
128
-
129
- Expect: no import of `resolveMaxTokens` from `@exellix/xynthesis/ai-actions`; live POST/PRE calls succeed with `outputExpectation` only (no `maxTokens` on request).