@bitkyc08/opencodex 2.91.0 → 2.93.0-preview.20261027

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 (360) hide show
  1. package/bin/ocx.mjs +47 -8
  2. package/gui/dist/assets/App-CJZoq-uF.js +58 -0
  3. package/gui/dist/assets/{Tray-BuLy7hL1.js → Tray-BWQPcgZn.js} +1 -1
  4. package/gui/dist/assets/index-DRe8Hhfz.css +1 -0
  5. package/gui/dist/assets/index-Xfct8owH.js +94 -0
  6. package/gui/dist/assets/quota-summary-DxToX1rV.js +1 -0
  7. package/gui/dist/index.html +2 -2
  8. package/gui/dist/provider-icons/workbuddy-color.svg +29 -0
  9. package/package.json +8 -7
  10. package/src/adapters/anthropic.ts +28 -5
  11. package/src/adapters/coding-agent/batch-dispatcher.ts +122 -0
  12. package/src/adapters/coding-agent/profile.ts +54 -16
  13. package/src/adapters/coding-agent/turn.ts +30 -2
  14. package/src/adapters/command-code.ts +114 -7
  15. package/src/adapters/cursor/native-exec-fs.ts +11 -9
  16. package/src/adapters/devin/live-models.ts +4 -0
  17. package/src/adapters/google-vertex-endpoint.ts +9 -1
  18. package/src/adapters/google-vertex-key-project.ts +223 -0
  19. package/src/adapters/google-wire-compiler.ts +1 -2
  20. package/src/adapters/google.ts +13 -3
  21. package/src/adapters/kiro/reasoning.ts +2 -0
  22. package/src/adapters/kiro-refusal.ts +6 -1
  23. package/src/adapters/kiro-wire.ts +1 -1
  24. package/src/adapters/openai-chat/messages.ts +8 -2
  25. package/src/adapters/openai-chat/passthrough.ts +35 -14
  26. package/src/adapters/openai-chat/reasoning-replay.ts +27 -16
  27. package/src/adapters/openai-chat/reasoning-wire.ts +117 -8
  28. package/src/adapters/openai-chat/required-tool-result.ts +64 -0
  29. package/src/adapters/openai-chat/tool-name-registry.ts +3 -1
  30. package/src/adapters/openai-chat.ts +9 -10
  31. package/src/adapters/openai-responses/passthrough.ts +7 -4
  32. package/src/adapters/openai-responses/reasoning.ts +13 -0
  33. package/src/adapters/openai-responses/request-strips.ts +60 -0
  34. package/src/adapters/qoder/adapter.ts +129 -8
  35. package/src/adapters/qoder/scaffold-guard.ts +5 -0
  36. package/src/adapters/reasoning-controls.ts +16 -0
  37. package/src/adapters/registry.ts +5 -0
  38. package/src/adapters/tool-call-id.ts +1 -3
  39. package/src/adapters/workbuddy-schema.ts +61 -0
  40. package/src/adapters/workbuddy.ts +68 -0
  41. package/src/bridge/errors.ts +27 -0
  42. package/src/bridge/response-json.ts +1 -1
  43. package/src/bridge/sse.ts +1 -1
  44. package/src/bridge.ts +1 -1
  45. package/src/chat/inbound.ts +4 -1
  46. package/src/chat/outbound.ts +20 -6
  47. package/src/chat/reasoning-details.ts +28 -5
  48. package/src/claude/desktop-first-party.ts +54 -4
  49. package/src/claude/desktop-picker.ts +11 -8
  50. package/src/claude/first-party-settings.ts +3 -1
  51. package/src/claude/inbound.ts +2 -1
  52. package/src/claude/intercept/local-ca.ts +2 -1
  53. package/src/claude/intercept/picker-ca-cleanup.ts +4 -2
  54. package/src/claude/intercept/picker-ca-startup.ts +3 -1
  55. package/src/claude/intercept/picker-models.ts +6 -3
  56. package/src/claude/intercept/picker-runtime.ts +3 -2
  57. package/src/claude/intercept/runtime.ts +6 -3
  58. package/src/claude/model-info.ts +31 -8
  59. package/src/cli/account-api.ts +11 -0
  60. package/src/cli/capabilities-agents-routing.ts +3 -3
  61. package/src/cli/capabilities-base.ts +7 -1
  62. package/src/cli/capabilities-observe-system.ts +10 -0
  63. package/src/cli/claude-desktop.ts +9 -8
  64. package/src/cli/claude.ts +3 -2
  65. package/src/cli/codex-cli-update.ts +8 -0
  66. package/src/cli/codex-shim-autorestore.ts +9 -0
  67. package/src/cli/combo-result.ts +13 -0
  68. package/src/cli/combo-stats.ts +3 -0
  69. package/src/cli/combo.ts +83 -41
  70. package/src/cli/cross-home-owner.ts +13 -1
  71. package/src/cli/dispatch.ts +25 -6
  72. package/src/cli/ensure-desired-integrations.ts +8 -6
  73. package/src/cli/export-command.ts +4 -1
  74. package/src/cli/help.ts +2 -1
  75. package/src/cli/index.ts +45 -45
  76. package/src/cli/integration-plan-dto.ts +4 -0
  77. package/src/cli/launcher-context.ts +49 -2
  78. package/src/cli/link.ts +45 -32
  79. package/src/cli/opencode.ts +20 -9
  80. package/src/cli/provider.ts +2 -1
  81. package/src/cli/registry.ts +6 -4
  82. package/src/cli/root.ts +9 -0
  83. package/src/cli/status.ts +59 -1
  84. package/src/cli/stop-restore.ts +113 -0
  85. package/src/cli/sync-expectation.ts +60 -0
  86. package/src/cli/uninstall-integrations.ts +41 -7
  87. package/src/cli/usage-compare.ts +68 -12
  88. package/src/client/connect.ts +40 -3
  89. package/src/client/link-home.ts +10 -1
  90. package/src/client/link-ingress.ts +1 -1
  91. package/src/client/link-readiness.ts +97 -0
  92. package/src/client/link-relay-transport.ts +79 -11
  93. package/src/client/link-relay.ts +74 -15
  94. package/src/client/link-tunnel.ts +45 -18
  95. package/src/client/machine-api.ts +3 -1
  96. package/src/client/machine-listener.ts +20 -2
  97. package/src/client/runtime.ts +20 -2
  98. package/src/client/sync-expectation.ts +118 -0
  99. package/src/clients/config-export/agent-clients.ts +96 -0
  100. package/src/clients/config-export/contracts.ts +25 -7
  101. package/src/clients/config-export/qoder.ts +38 -23
  102. package/src/clients/config-export/reasoning-metadata.ts +55 -8
  103. package/src/clients/config-export.ts +12 -0
  104. package/src/clients/lazycodex.ts +7 -2
  105. package/src/clients/reasoning-controls.ts +49 -0
  106. package/src/codex/account-store.ts +17 -3
  107. package/src/codex/app-server-restart-service.ts +6 -5
  108. package/src/codex/auth-api/account-identity.ts +14 -0
  109. package/src/codex/auth-api/account-list.ts +29 -2
  110. package/src/codex/auth-api/http.ts +13 -0
  111. package/src/codex/auth-api/main-account-probe.ts +2 -2
  112. package/src/codex/auth-api/pool-mode-gate.ts +16 -3
  113. package/src/codex/auth-api/pool-quota-probe.ts +15 -0
  114. package/src/codex/auth-context.ts +15 -12
  115. package/src/codex/catalog/build-entries.ts +22 -0
  116. package/src/codex/catalog/configured-tiers.ts +70 -0
  117. package/src/codex/catalog/effort.ts +52 -11
  118. package/src/codex/catalog/gather-capture.ts +5 -2
  119. package/src/codex/catalog/heal-observation.ts +155 -13
  120. package/src/codex/catalog/metadata.ts +6 -0
  121. package/src/codex/catalog/model-hints.ts +60 -11
  122. package/src/codex/catalog/model-visibility.ts +3 -2
  123. package/src/codex/catalog/native-models.ts +18 -3
  124. package/src/codex/catalog/parsing.ts +10 -8
  125. package/src/codex/catalog/pinned-models.ts +2 -1
  126. package/src/codex/catalog/provider-models.ts +18 -13
  127. package/src/codex/catalog/retained-sync.ts +2 -1
  128. package/src/codex/catalog/routed-gather.ts +19 -20
  129. package/src/codex/catalog/write-audit.ts +3 -2
  130. package/src/codex/catalog-self-heal.ts +43 -23
  131. package/src/codex/chatgpt-refresh-failure.ts +6 -2
  132. package/src/codex/cli-install-provenance.ts +418 -0
  133. package/src/codex/cli-installation-targets.ts +5 -1
  134. package/src/codex/cli-update-plan.ts +43 -16
  135. package/src/codex/collision-identity.ts +30 -5
  136. package/src/codex/convergence.ts +4 -3
  137. package/src/codex/data/roster-pinned-models.json +177 -1
  138. package/src/codex/desired-state.ts +6 -1
  139. package/src/codex/desktop-app/picker-freshness.ts +10 -8
  140. package/src/codex/desktop-compatibility/installed-build.ts +88 -12
  141. package/src/codex/desktop-compatibility/runtime.ts +29 -5
  142. package/src/codex/desktop-compatibility/usage-activation.ts +2 -1
  143. package/src/codex/desktop-compatibility/usage-controller.ts +9 -1
  144. package/src/codex/desktop-compatibility/windows-certificate-trust.ts +46 -12
  145. package/src/codex/inject/config-toml.ts +0 -18
  146. package/src/codex/inject/plan.ts +18 -3
  147. package/src/codex/inject/remove.ts +6 -2
  148. package/src/codex/inject.ts +1 -1
  149. package/src/codex/journal.ts +61 -1
  150. package/src/codex/model-entitlements.ts +1 -1
  151. package/src/codex/native-main-owner.ts +27 -1
  152. package/src/codex/native-profile-store.ts +2 -1
  153. package/src/codex/pool-credit-policy.ts +35 -1
  154. package/src/codex/pool-refresh-backoff.ts +3 -1
  155. package/src/codex/quota-types.ts +3 -0
  156. package/src/codex/quota.ts +24 -4
  157. package/src/codex/role-auto-assign.ts +6 -2
  158. package/src/codex/subagent-defaults.ts +49 -4
  159. package/src/codex/user-identity.ts +35 -6
  160. package/src/codex/windows-current-sid.ts +162 -0
  161. package/src/combos/failover.ts +17 -2
  162. package/src/combos/jev-decision-contract.ts +22 -1
  163. package/src/combos/jev-quota-activation.ts +5 -1
  164. package/src/combos/jev-quota-route.ts +1 -1
  165. package/src/combos/jev-quota.ts +9 -1
  166. package/src/combos/jev-service-exchange.ts +3 -1
  167. package/src/combos/jev-session-pin-config.ts +51 -0
  168. package/src/combos/jev.ts +101 -9
  169. package/src/combos/resolve.ts +45 -1
  170. package/src/combos/types.ts +43 -0
  171. package/src/config/load-degrade.ts +5 -0
  172. package/src/config/paths.ts +19 -3
  173. package/src/config/pending-teardown.ts +22 -1
  174. package/src/config/provider-validation.ts +22 -4
  175. package/src/config/removed-opencode-free.ts +11 -0
  176. package/src/config/schema/leaf-validators.ts +6 -0
  177. package/src/generated/compatibility-version.json +467 -311
  178. package/src/generated/model-metadata.ts +5 -5
  179. package/src/images/loop.ts +16 -2
  180. package/src/integrations/catalog-refresh.ts +1 -1
  181. package/src/integrations/hermes-profiles.ts +251 -0
  182. package/src/integrations/merge.ts +8 -0
  183. package/src/integrations/mutation-plan.ts +19 -4
  184. package/src/integrations/registry.ts +5 -0
  185. package/src/integrations/state.ts +36 -1
  186. package/src/integrations/writer.ts +18 -4
  187. package/src/lib/bun-path-runtime.mjs +2 -1
  188. package/src/lib/decision-quota-sink.ts +10 -0
  189. package/src/lib/errors.ts +62 -0
  190. package/src/lib/eventstream-decoder.ts +81 -37
  191. package/src/lib/opaque-proxy-tunnel.ts +32 -8
  192. package/src/lib/pinned-http.ts +35 -2
  193. package/src/lib/process-control.ts +13 -1
  194. package/src/lib/socks5-fetch.ts +59 -64
  195. package/src/lib/socks5-upload-waiter.ts +50 -0
  196. package/src/lib/sse-decoder.ts +7 -2
  197. package/src/lib/state-store-sweeper.ts +40 -14
  198. package/src/lib/translator-budget.ts +4 -4
  199. package/src/lib/upstream-retry.ts +4 -1
  200. package/src/lib/windows-native-principal-worker.ts +14 -0
  201. package/src/lib/windows-native-principal.ts +188 -0
  202. package/src/lib/windows-secret-acl.ts +39 -3
  203. package/src/lib/windows-user-principal.ts +62 -18
  204. package/src/link/diagnostics.ts +193 -0
  205. package/src/link/relay-auth.ts +6 -0
  206. package/src/link/ssh-config.ts +35 -3
  207. package/src/link/status-projection.ts +39 -0
  208. package/src/link/supervisor.ts +45 -12
  209. package/src/link/tunnel-history.ts +109 -0
  210. package/src/link/tunnel-state.ts +80 -17
  211. package/src/messaging/remote-files.ts +24 -1
  212. package/src/oauth/generic-account-failover.ts +91 -7
  213. package/src/oauth/index.ts +15 -0
  214. package/src/oauth/model-discovery-auth.ts +5 -0
  215. package/src/oauth/store.ts +4 -1
  216. package/src/oauth/token-guardian.ts +7 -0
  217. package/src/oauth/types.ts +9 -0
  218. package/src/oauth/workbuddy.ts +139 -0
  219. package/src/providers/account-quota-disk.ts +12 -4
  220. package/src/providers/antigravity-quota-identity.ts +37 -0
  221. package/src/providers/base-url-choices.ts +8 -5
  222. package/src/providers/codebuddy-models.ts +6 -0
  223. package/src/providers/codex-capacity.ts +3 -1
  224. package/src/providers/derive.ts +51 -3
  225. package/src/providers/kiro-models.ts +3 -0
  226. package/src/providers/mimo-thinking.ts +12 -0
  227. package/src/providers/model-discovery.ts +2 -0
  228. package/src/providers/model-rename-fields.ts +2 -0
  229. package/src/providers/model-rename-migration.ts +10 -0
  230. package/src/providers/openai-sidecar-credit.ts +2 -2
  231. package/src/providers/quota/account-cache.ts +3 -2
  232. package/src/providers/quota/antigravity.ts +25 -14
  233. package/src/providers/quota/report-cache.ts +13 -4
  234. package/src/providers/quota/vendor-probes-key.ts +60 -0
  235. package/src/providers/quota/workbuddy.ts +83 -0
  236. package/src/providers/quota-decision-antigravity.ts +64 -0
  237. package/src/providers/quota-decision-publication.ts +11 -0
  238. package/src/providers/quota-decision-snapshot.ts +21 -4
  239. package/src/providers/quota-types.ts +2 -0
  240. package/src/providers/quota.ts +3 -1
  241. package/src/providers/reasoning-capabilities.ts +76 -0
  242. package/src/providers/registry/entries-core.ts +23 -12
  243. package/src/providers/registry/entries-extended.ts +83 -27
  244. package/src/providers/registry/model-ids.ts +5 -0
  245. package/src/providers/registry/model-seeds.ts +120 -56
  246. package/src/providers/registry/types.ts +29 -2
  247. package/src/providers/resolved-model-policy.ts +30 -10
  248. package/src/providers/routed-config.ts +24 -1
  249. package/src/providers/stale-model-roster-migration.ts +123 -18
  250. package/src/providers/workbuddy-credit-balance.ts +81 -0
  251. package/src/providers/workbuddy-models.ts +37 -0
  252. package/src/providers/workbuddy.ts +60 -0
  253. package/src/remote-control/workspace-pi-runtime.ts +11 -6
  254. package/src/responses/compaction-summary.ts +45 -0
  255. package/src/responses/muse-tool-name-alias.ts +1 -2
  256. package/src/responses/parser.ts +3 -2
  257. package/src/responses/reasoning-replay-cache.ts +18 -14
  258. package/src/responses/schema.ts +1 -0
  259. package/src/responses/thought-signature-replay.ts +10 -2
  260. package/src/router.ts +2 -0
  261. package/src/routing/analytics.ts +2 -3
  262. package/src/routing/capability.ts +8 -2
  263. package/src/routing/fallback-policy.ts +3 -3
  264. package/src/routing/history/ingest.ts +28 -3
  265. package/src/server/auth-cors.ts +4 -2
  266. package/src/server/chat-completions.ts +21 -1
  267. package/src/server/chat-native-eligibility.ts +7 -0
  268. package/src/server/chat-native-reasoning.ts +24 -7
  269. package/src/server/chat-native.ts +13 -2
  270. package/src/server/claude-messages.ts +3 -0
  271. package/src/server/direct-local-http.ts +5 -2
  272. package/src/server/effort-policy.ts +5 -1
  273. package/src/server/index/link-relay-sessions.ts +9 -5
  274. package/src/server/index/live-sideband.ts +18 -15
  275. package/src/server/index/optional-listeners.ts +4 -0
  276. package/src/server/index/serve-options.ts +5 -4
  277. package/src/server/local-management-read-client.ts +3 -1
  278. package/src/server/management/agent-settings-routes.ts +27 -15
  279. package/src/server/management/combo-routes.ts +14 -4
  280. package/src/server/management/config-routes.ts +2 -2
  281. package/src/server/management/decision-discovery.ts +12 -2
  282. package/src/server/management/hermes-profile-routes.ts +156 -0
  283. package/src/server/management/integration-routes.ts +85 -24
  284. package/src/server/management/link-routes.ts +5 -2
  285. package/src/server/management/model-routes.ts +2 -2
  286. package/src/server/management/model-row-export-metadata.ts +25 -6
  287. package/src/server/management/model-rows.ts +15 -20
  288. package/src/server/management/native-integration-routes.ts +11 -8
  289. package/src/server/management/provider-routes.ts +1 -1
  290. package/src/server/management/route-registry.ts +4 -0
  291. package/src/server/management-api.ts +5 -0
  292. package/src/server/models-capabilities.ts +21 -3
  293. package/src/server/port-reclaim.ts +51 -9
  294. package/src/server/request-log-conversation.ts +49 -0
  295. package/src/server/request-log.ts +2 -0
  296. package/src/server/responses/adapter-delivery.ts +11 -1
  297. package/src/server/responses/adapter-dispatch.ts +2 -2
  298. package/src/server/responses/anthropic-thinking-recovery.ts +1 -0
  299. package/src/server/responses/codex-ws-exchange.ts +39 -9
  300. package/src/server/responses/codex-ws-session.ts +38 -4
  301. package/src/server/responses/codex-ws-wire.ts +6 -1
  302. package/src/server/responses/combo-required-tool-contract.ts +103 -0
  303. package/src/server/responses/combo-stream-preflight.ts +8 -1
  304. package/src/server/responses/compact.ts +14 -5
  305. package/src/server/responses/context-overflow.ts +8 -1
  306. package/src/server/responses/core-combo-failure.ts +10 -0
  307. package/src/server/responses/core-combo.ts +74 -44
  308. package/src/server/responses/core-lifetime.ts +5 -2
  309. package/src/server/responses/core-normalize.ts +17 -4
  310. package/src/server/responses/core-opaque-recovery.ts +1 -0
  311. package/src/server/responses/core-options.ts +7 -0
  312. package/src/server/responses/core-replay.ts +2 -1
  313. package/src/server/responses/jev-combo-choice.ts +39 -0
  314. package/src/server/responses/jev-session-pin.ts +203 -0
  315. package/src/server/responses/main-hard-lock-routing.ts +60 -44
  316. package/src/server/responses/passthrough-delivery.ts +44 -2
  317. package/src/server/responses/policy-fallback.ts +6 -1
  318. package/src/server/responses/request-compression.ts +12 -7
  319. package/src/server/responses/request-prepare.ts +32 -7
  320. package/src/server/responses/request-sidecar-auth.ts +2 -0
  321. package/src/server/responses/request-transport.ts +25 -6
  322. package/src/server/responses/response-effects.ts +22 -10
  323. package/src/server/responses/run-turn-execution.ts +2 -4
  324. package/src/server/responses/sidecar-execution.ts +13 -7
  325. package/src/server/responses-phase-inference.ts +267 -0
  326. package/src/server/sse-payload-rewrite.ts +14 -1
  327. package/src/server/stop-teardown.ts +36 -1
  328. package/src/server/ws-bridge.ts +1 -1
  329. package/src/service/definition.ts +20 -8
  330. package/src/service/desktop-supervision.d.mts +7 -4
  331. package/src/service/desktop-supervision.mjs +90 -13
  332. package/src/service/ownership-mutation-lease.mjs +21 -7
  333. package/src/types/config.ts +14 -2
  334. package/src/types/provider.ts +29 -7
  335. package/src/types/request.ts +11 -0
  336. package/src/types/wire.ts +1 -0
  337. package/src/types.ts +1 -0
  338. package/src/update/bind-probe.ts +29 -0
  339. package/src/update/codex-cli-update-launch-policy.d.mts +9 -0
  340. package/src/update/codex-cli-update-launch-policy.mjs +30 -0
  341. package/src/update/job.ts +10 -29
  342. package/src/update/npm-install-job.ps1 +173 -0
  343. package/src/update/npm-install.mjs +70 -0
  344. package/src/update/stop-contract.d.mts +1 -0
  345. package/src/update/stop-contract.mjs +14 -0
  346. package/src/update/stop-decision.d.mts +1 -1
  347. package/src/update/stop-decision.mjs +13 -3
  348. package/src/update/teardown-handover.ts +166 -0
  349. package/src/update/transactional-install.d.mts +14 -3
  350. package/src/update/transactional-install.mjs +33 -7
  351. package/src/usage/expected-prices.ts +64 -31
  352. package/src/usage/jev-stats.ts +54 -14
  353. package/src/usage/timeline.ts +19 -9
  354. package/src/vision/eligibility.ts +15 -5
  355. package/src/vision/plan.ts +2 -2
  356. package/src/web-search/loop.ts +16 -2
  357. package/gui/dist/assets/App-nZ34cR5G.js +0 -58
  358. package/gui/dist/assets/index-DGXS51sp.js +0 -94
  359. package/gui/dist/assets/index-DPeB9HpV.css +0 -1
  360. package/gui/dist/assets/quota-summary-DO1Sx5TM.js +0 -1
@@ -155,30 +155,33 @@ export const ZAI_GLM_5X_REASONING_EFFORTS: Record<string, string[]> = {
155
155
  };
156
156
  // 260710 MiniMax models and context windows: Tier-2 evidence in
157
157
  // devlog/_plan/260710_provider_hardening/002_research_cn.md.
158
- // 260930 MiniMax-M3.1-Flash-Preview: Token Plan / MiniMax Code only, 1M context, thinking
159
- // always on (effort none or thinking disabled answers 400 code 2013), omitted effort = max.
160
- // It returns thinking as reasoning_content and ignores reasoning_split. The live /v1/models
161
- // roster does not list it yet. Evidence: devlog/_fin/260930_minimax_m31_flash_preview/.
162
- export const MINIMAX_M31_FLASH_PREVIEW = "MiniMax-M3.1-Flash-Preview";
158
+ // 261021 MiniMax-M3.1-Flash: current global/CN text route, 1M context, thinking always on
159
+ // (effort none or thinking disabled answers 400), omitted effort = max. It returns thinking as
160
+ // reasoning_content and ignores reasoning_split. The live /v1/models roster may omit it.
161
+ export const MINIMAX_M31_FLASH = "MiniMax-M3.1-Flash";
162
+ /** The preview id MiniMax retired when M3.1-Flash went GA (2026-10-19); see MODEL_RENAMES. */
163
+ export const MINIMAX_M31_FLASH_PREVIEW_RETIRED = "MiniMax-M3.1-Flash-Preview";
164
+ /** MiniMax's published M3.1-Flash output ceiling (512K). */
165
+ export const MINIMAX_M31_FLASH_MAX_OUTPUT_TOKENS = 524_288;
163
166
  export const MINIMAX_MODELS = [
164
- MINIMAX_M31_FLASH_PREVIEW,
167
+ MINIMAX_M31_FLASH,
165
168
  "MiniMax-M3",
166
169
  "MiniMax-M2.7", "MiniMax-M2.7-highspeed",
167
170
  "MiniMax-M2.5", "MiniMax-M2.5-highspeed",
168
171
  "MiniMax-M2.1", "MiniMax-M2.1-highspeed",
169
172
  "MiniMax-M2",
170
173
  ];
171
- /** The eight-id roster every MiniMax preset seeded from 2026-07-10 until the preview landed. */
172
- export const MINIMAX_MODELS_BEFORE_M31 = MINIMAX_MODELS.filter(id => id !== MINIMAX_M31_FLASH_PREVIEW);
174
+ /** The eight-id roster every MiniMax preset seeded before Flash landed. */
175
+ export const MINIMAX_MODELS_BEFORE_M31 = MINIMAX_MODELS.filter(id => id !== MINIMAX_M31_FLASH);
173
176
  /** Models that honour reasoning_split and answer with structured reasoning_details. */
174
177
  export const MINIMAX_REASONING_SPLIT_MODELS = MINIMAX_MODELS_BEFORE_M31;
175
178
  export const MINIMAX_MODEL_CONTEXT_WINDOWS: Record<string, number> = Object.fromEntries(
176
- MINIMAX_MODELS.map(id => [id, id === "MiniMax-M3" || id === MINIMAX_M31_FLASH_PREVIEW ? 1_000_000 : 204_800]),
179
+ MINIMAX_MODELS.map(id => [id, id === "MiniMax-M3" || id === MINIMAX_M31_FLASH ? 1_000_000 : 204_800]),
177
180
  );
178
181
  /** MiniMax's OpenAI-compatible M3 endpoints accept image_url; keep video off Codex's input enum. */
179
182
  export const MINIMAX_MODEL_INPUT_MODALITIES: Record<string, string[]> = {
180
183
  "MiniMax-M3": ["text", "image"],
181
- [MINIMAX_M31_FLASH_PREVIEW]: ["text", "image"],
184
+ [MINIMAX_M31_FLASH]: ["text", "image"],
182
185
  };
183
186
  export const MINIMAX_M3_REASONING_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
184
187
  /** Identity efforts on the wire; no map, so none omits the field instead of disabling thinking. */
@@ -219,7 +222,8 @@ export const OPENAI_API_GPT56_REASONING_EFFORTS = ["low", "medium", "high", "xhi
219
222
  * 1,050,000 context, 922,000 max input, 128,000 max output, efforts low..max
220
223
  * (https://developers.openai.com/api/docs/models/gpt-6.1-sol, checked 2026-09-30).
221
224
  */
222
- export const OPENAI_GPT6_MODELS = ["gpt-6.1-sol", "gpt-6-sol", "gpt-6-luna"];
225
+ // GPT-6.1 Terra (2026-10-26): same API limits; its none..max ladder is set per model.
226
+ export const OPENAI_GPT6_MODELS = ["gpt-6.1-sol", "gpt-6.1-terra", "gpt-6-sol", "gpt-6-luna"];
223
227
  /*
224
228
  * Meta Model API (https://api.meta.ai/v1) — published ladder, deliberately NOT the
225
229
  * house set. dev.meta.ai/docs/reasoning lists "none", "minimal", "low", "medium",
@@ -327,6 +331,8 @@ export const OPENROUTER_GPT56_CONTEXT_WINDOWS = {
327
331
  "openai/gpt-6-luna": OPENROUTER_GPT56_CONTEXT_WINDOW,
328
332
  // Live /api/v1/models on 2026-09-30: context_length 1,050,000, max_completion_tokens 128,000.
329
333
  "openai/gpt-6.1-sol": OPENROUTER_GPT56_CONTEXT_WINDOW,
334
+ // OpenRouter listing checked 2026-10-27: context_length 1,050,000.
335
+ "openai/gpt-6.1-terra": OPENROUTER_GPT56_CONTEXT_WINDOW,
330
336
  };
331
337
 
332
338
  /**
@@ -377,8 +383,8 @@ export const OPENCODE_GO_THINKING_BUDGET_MODELS = ["qwen3.5-plus", "qwen3.6-plus
377
383
  /*
378
384
  * DeepSeek moved the whole V4 name set on 2026-09-10. V4.1-Flash ships as deepseek-flash
379
385
  * on the first-party API; deepseek-v4-flash and the vision preview retire as models but
380
- * keep routing there as compatibility aliases, and deepseek-v4-pro follows from
381
- * 2026-09-14 04:00 UTC. Evidence: https://api-docs.deepseek.com/news/news260910/.
386
+ * keep routing there as compatibility aliases. V4 Pro remains available: the planned
387
+ * retirement was withdrawn. Evidence: https://api-docs.deepseek.com/updates/ (2026-10-23).
382
388
  *
383
389
  * The spelling differs by who serves it, so one shared list cannot express it: the
384
390
  * first-party API answers to deepseek-flash, while the Zen gateway exposes the route as
@@ -388,15 +394,10 @@ export const OPENCODE_GO_THINKING_BUDGET_MODELS = ["qwen3.5-plus", "qwen3.6-plus
388
394
  */
389
395
  export const DEEPSEEK_V4_LEGACY_MODELS = ["deepseek-v4-flash"];
390
396
  /*
391
- * `deepseek-v4-pro` is deliberately absent from both live sets. DeepSeek retires it from
392
- * 2026-09-14 04:00 UTC and routes its requests to V4.1-Flash until a V4.1 Pro exists, so a
393
- * row here would advertise a Pro context window and Pro pricing for a route that serves
394
- * Flash. The retirement is followed through every roster in this file, including the
395
- * vendor-hosted ones; providers that discover their models live are handled by
396
- * `ROUTED_MODEL_COMPATIBILITY_EXCLUSIONS` because deleting a row there removes the
397
- * model's capabilities rather than the model.
397
+ * The official API continues serving V4 Pro after September 14 with unchanged billing.
398
+ * Gateway availability is independent; restoring the native set does not change gateway rosters.
398
399
  */
399
- export const DEEPSEEK_NATIVE_THINKING_MODELS = ["deepseek-flash", "deepseek-v4-flash"];
400
+ export const DEEPSEEK_NATIVE_THINKING_MODELS = ["deepseek-flash", "deepseek-v4-flash", "deepseek-v4-pro"];
400
401
  export const DEEPSEEK_GATEWAY_THINKING_MODELS = ["deepseek-v4.1-flash", "deepseek-v4-flash"];
401
402
  /*
402
403
  * DeepSeek's legacy vision preview id (released 2026-08-21). First-party probes
@@ -573,22 +574,22 @@ export const deepseekReasoningMapFor = (modelId: string): Record<string, string>
573
574
  // text-only input, strict json_schema accepted. glm-5.3-flash REMAINS OUT:
574
575
  // still never served by the Token Plan gateway (docs.z.ai VLM id, not plan
575
576
  // entitlement).
576
- // The Beijing preset keeps the Personal Edition subset; non-chat ids (audio/image/
577
- // video families) stay out: they answer only on async endpoints openai-chat cannot
578
- // reach. deepseek-v4-pro-0813 is callable but NOT listed by /models, which is the
579
- // reason liveModels must stay false for this provider. deepseek-v4.1-flash is the
580
- // 260910 DeepSeek rename row: listed on /models on both tiers and regions from 260915,
581
- // hybrid thinking, vision via user message and tool result, json_object but not
582
- // json_schema (see noJsonSchemaModels on the entries).
583
- // Beijing serves the Personal Edition, so this is the Personal-tier roster probed
584
- // 260909 (a strict subset of Team). deepseek-v4-pro-0813 stays out of the Beijing
585
- // entry: its callability is only proven on Team keys, and no Personal key has been
586
- // shown to reach it. The Beijing entry also shares the intl maps, so it carries a
587
- // few orphan keys (kimi/glm-5/MiniMax rows); harmless, and one map beats two
588
- // drifting ones.
577
+ // Both regions support Personal and Team subscriptions. Keep the existing Beijing
578
+ // Personal and International Team model rosters. Discovery stays disabled because
579
+ // the upstream list includes non-chat models.
580
+ // 261020: 0813 is now listed on Global Personal/Team and CN Team, and the CN Personal
581
+ // overview documents entitlement. Add it to the existing Personal curation without
582
+ // claiming new Personal inference. Retired 261011: deepseek-v3.2 and bare v4-flash.
583
+ // 1017 evidence: https://www.qianwenai.com/models/deepseek-v4.1-flash-1017 and
584
+ // https://docs.qwencloud.com/api-reference/chat/openai-chat (checked 2026-10-20).
585
+ // Global Personal probes: completion, thinking-off, low effort, tools, user/tool images
586
+ // and Responses succeed; strict json_schema rejects 400. json_object and replay are
587
+ // untested on this exact id. Published 1M context and 393K output use 393216 here,
588
+ // consistent with the existing plan budget convention, not a measured boundary;
589
+ // the lab's 384000 precision differs. Do not inherit the bare model's JSON fallback.
589
590
  export const ALIBABA_TOKEN_PLAN_MODELS = [
590
591
  "qwen3.8-max", "qwen3.8-flash", "qwen3.7-max", "qwen3.7-plus", "qwen3.6-flash",
591
- "deepseek-v4-pro", "deepseek-v4-flash-0731", "deepseek-v4.1-flash", "glm-5.2", "glm-5.3",
592
+ "deepseek-v4-pro", "deepseek-v4-pro-0813", "deepseek-v4-flash-0731", "deepseek-v4.1-flash", "deepseek-v4.1-flash-1017", "glm-5.2", "glm-5.3",
592
593
  ];
593
594
  export const ALIBABA_TOKEN_PLAN_QWEN_MODELS = [
594
595
  "qwen3.8-max", "qwen3.8-flash", "qwen3.7-max", "qwen3.7-plus", "qwen3.6-flash",
@@ -604,12 +605,13 @@ export const ALIBABA_TOKEN_PLAN_INPUT_MODALITIES: Record<string, string[]> = {
604
605
  "deepseek-v4-flash-0731": ["text"],
605
606
  // Vision probed on the plan gateway 260915 (user message and tool result, both 200).
606
607
  "deepseek-v4.1-flash": ["text", "image"],
608
+ "deepseek-v4.1-flash-1017": ["text", "image"],
607
609
  "glm-5.2": ["text"],
608
610
  "glm-5.3": ["text"],
609
611
  };
610
612
 
611
613
  // 260721 Alibaba Token Plan International (ap-southeast-1 / Singapore, hardened 260721).
612
- // Multi-vendor lineup distinct from Beijing — includes DeepSeek V4 flash, Kimi K2.7, MiniMax.
614
+ // International Team model roster; tier and region are independent.
613
615
  // Evidence: https://www.alibabacloud.com/help/en/model-studio/token-plan-overview
614
616
  // https://qwencloud.com/pricing/token-plan (qwen3.8 metadata)
615
617
  // The Team Edition roster (Singapore), verified identical to the CN Team set on 260909.
@@ -617,7 +619,7 @@ export const ALIBABA_TOKEN_PLAN_INPUT_MODALITIES: Record<string, string[]> = {
617
619
  // listed on /models on both regions) after being dropped as "retired" upstream.
618
620
  export const ALIBABA_INTL_TOKEN_PLAN_MODELS = [
619
621
  "qwen3.8-max", "qwen3.8-flash", "qwen3.7-max", "qwen3.7-plus", "qwen3.6-plus", "qwen3.6-flash",
620
- "deepseek-v4-pro", "deepseek-v4-pro-0813", "deepseek-v4-flash", "deepseek-v4-flash-0731", "deepseek-v4.1-flash", "deepseek-v3.2",
622
+ "deepseek-v4-pro", "deepseek-v4-pro-0813", "deepseek-v4-flash-0731", "deepseek-v4.1-flash", "deepseek-v4.1-flash-1017",
621
623
  "kimi-k2.7-code", "kimi-k2.6", "kimi-k2.5",
622
624
  "glm-5.2", "glm-5.3", "glm-5.1", "glm-5",
623
625
  "MiniMax-M2.5",
@@ -702,8 +704,6 @@ export const VOLCENGINE_PLAN_TEXT_ONLY_MODELS = [
702
704
  export const ALIBABA_INTL_TOKEN_PLAN_INPUT_MODALITIES: Record<string, string[]> = {
703
705
  ...ALIBABA_TOKEN_PLAN_INPUT_MODALITIES,
704
706
  "qwen3.6-plus": ["text", "image"],
705
- "deepseek-v4-flash": ["text"],
706
- "deepseek-v3.2": ["text"],
707
707
  "kimi-k2.7-code": ["text", "image"],
708
708
  "kimi-k2.6": ["text", "image"],
709
709
  "kimi-k2.5": ["text", "image"],
@@ -712,14 +712,14 @@ export const ALIBABA_INTL_TOKEN_PLAN_INPUT_MODALITIES: Record<string, string[]>
712
712
  "MiniMax-M2.5": ["text"],
713
713
  };
714
714
 
715
- // Shared Token Plan metadata (260909 gateway probes; output ceilings are max_tokens
716
- // boundary probes: accept at N, reject at N+1).
715
+ // Shared Token Plan metadata: legacy rows use 260909 max_tokens boundary probes.
716
+ // The 1017 row uses published card normalization, not a boundary probe (see above).
717
717
  export const QWEN38_FAMILY = ["qwen3.8-max", "qwen3.8-flash"];
718
718
  export const ALIBABA_TOKEN_PLAN_CONTEXT_WINDOWS: Record<string, number> = {
719
719
  "qwen3.8-max": 1_000_000, "qwen3.8-flash": 1_000_000, "qwen3.7-max": 1_000_000, "qwen3.7-plus": 1_000_000,
720
720
  "qwen3.6-plus": 1_000_000, "qwen3.6-flash": 1_000_000,
721
- "deepseek-v4-pro": 1_000_000, "deepseek-v4-pro-0813": 1_000_000, "deepseek-v4-flash": 1_000_000,
722
- "deepseek-v4-flash-0731": 1_000_000, "deepseek-v4.1-flash": 1_000_000, "deepseek-v3.2": 131_072,
721
+ "deepseek-v4-pro": 1_000_000, "deepseek-v4-pro-0813": 1_000_000,
722
+ "deepseek-v4-flash-0731": 1_000_000, "deepseek-v4.1-flash": 1_000_000, "deepseek-v4.1-flash-1017": 1_000_000,
723
723
  "kimi-k2.7-code": 262_144, "kimi-k2.6": 262_144, "kimi-k2.5": 262_144,
724
724
  "glm-5.2": 1_000_000, "glm-5.3": 1_000_000, "glm-5.1": 202_752, "glm-5": 202_752,
725
725
  "MiniMax-M2.5": 196_608,
@@ -727,20 +727,20 @@ export const ALIBABA_TOKEN_PLAN_CONTEXT_WINDOWS: Record<string, number> = {
727
727
  export const ALIBABA_TOKEN_PLAN_MAX_OUTPUT_TOKENS: Record<string, number> = {
728
728
  "qwen3.8-max": 131_072, "qwen3.8-flash": 131_072, "qwen3.7-max": 131_072, "qwen3.7-plus": 131_072,
729
729
  "qwen3.6-plus": 65_536, "qwen3.6-flash": 65_536,
730
- "deepseek-v4-pro": 393_216, "deepseek-v4-pro-0813": 393_216, "deepseek-v4-flash": 393_216,
731
- "deepseek-v4-flash-0731": 393_216, "deepseek-v4.1-flash": 393_216, "deepseek-v3.2": 65_536,
730
+ "deepseek-v4-pro": 393_216, "deepseek-v4-pro-0813": 393_216,
731
+ "deepseek-v4-flash-0731": 393_216, "deepseek-v4.1-flash": 393_216, "deepseek-v4.1-flash-1017": 393_216,
732
732
  "kimi-k2.7-code": 262_144, "kimi-k2.6": 262_144, "kimi-k2.5": 98_304,
733
733
  "glm-5.2": 131_072, "glm-5.3": 131_072, "glm-5.1": 128_000, "glm-5": 16_384,
734
734
  "MiniMax-M2.5": 32_768,
735
735
  };
736
736
  export const ALIBABA_TOKEN_PLAN_NO_VISION = [
737
- "qwen3.7-max", "deepseek-v4-pro", "deepseek-v4-pro-0813", "deepseek-v4-flash",
738
- "deepseek-v4-flash-0731", "deepseek-v3.2", "glm-5.2", "glm-5.3", "glm-5.1", "glm-5", "MiniMax-M2.5",
737
+ "qwen3.7-max", "deepseek-v4-pro", "deepseek-v4-pro-0813",
738
+ "deepseek-v4-flash-0731", "glm-5.2", "glm-5.3", "glm-5.1", "glm-5", "MiniMax-M2.5",
739
739
  ];
740
740
  export const ALIBABA_TOKEN_PLAN_PRESERVE_REASONING = [
741
741
  "qwen3.8-max", "qwen3.8-flash", "qwen3.7-max", "qwen3.7-plus", "qwen3.6-plus", "qwen3.6-flash",
742
- "deepseek-v4-pro", "deepseek-v4-pro-0813", "deepseek-v4-flash", "deepseek-v4-flash-0731",
743
- "deepseek-v4.1-flash", "glm-5.2", "glm-5.3",
742
+ "deepseek-v4-pro", "deepseek-v4-pro-0813", "deepseek-v4-flash-0731",
743
+ "deepseek-v4.1-flash", "deepseek-v4.1-flash-1017", "glm-5.2", "glm-5.3",
744
744
  ];
745
745
 
746
746
  // 260717 Kimi K3: the subscription endpoint uses one upstream id (`k3`) for both
@@ -754,6 +754,12 @@ export const ALIBABA_TOKEN_PLAN_PRESERVE_REASONING = [
754
754
  export const KIMI_K3_STANDARD_CONTEXT_WINDOW = 262_144;
755
755
  export const KIMI_K3_1M_CONTEXT_WINDOW = 1_048_576;
756
756
  export const KIMI_CODING_K3_MODELS = ["k3", "k3[1m]", "k3-256k"];
757
+ // 261024 Kimi K3.1 Pro: live GET /coding/v1/models now also lists k3.1-pro and
758
+ // k3.1-pro-highspeed, both advertising context_length 1048576 (flat 1M, no entitlement
759
+ // alias). Both run thinking-only: the endpoint rejects thinking-disabled requests with
760
+ // HTTP 400, and an absent effort defaults to max — the same low/high/max ladder as k3.
761
+ // Evidence: https://www.kimi.com/code/docs/en/kimi-code/models.html
762
+ export const KIMI_CODING_K31_MODELS = ["k3.1-pro", "k3.1-pro-highspeed"];
757
763
  // 260921 Kimi K2.8: `kimi-for-coding` is the stable subscription alias Moonshot re-points
758
764
  // at each coding release. Live GET /coding/v1/models lists only kimi-for-coding[-highspeed],
759
765
  // k3, k3-256k — the k2.x ids are retired from the subscription endpoint. Since K2.8 Preview
@@ -762,10 +768,27 @@ export const KIMI_CODING_K3_MODELS = ["k3", "k3[1m]", "k3-256k"];
762
768
  // with "model token limit: 1048576" beyond that.
763
769
  // Evidence: https://www.kimi.com/code/docs/en/kimi-code/models.html
764
770
  export const KIMI_CODING_K28_MODELS = ["kimi-for-coding"];
765
- export const KIMI_CODING_LIVE_MODELS = [...KIMI_CODING_K3_MODELS, ...KIMI_CODING_K28_MODELS];
771
+ export const KIMI_CODING_LIVE_MODELS = [...KIMI_CODING_K3_MODELS, ...KIMI_CODING_K31_MODELS, ...KIMI_CODING_K28_MODELS];
766
772
  export const KIMI_CODING_ADJUSTABLE_THINKING_MODELS = [...KIMI_CODING_LIVE_MODELS];
767
773
  export const KIMI_LEGACY_API_MODELS = ["kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6", "kimi-k2.5"];
768
- export const KIMI_API_MODELS = ["kimi-k3", ...KIMI_LEGACY_API_MODELS];
774
+ // 261025 Kimi K3.1 Pro on the Moonshot API (#7653): the platform model list names kimi-k3.1-pro
775
+ // and kimi-k3.1-pro-highspeed (same model, 2-3x speed) on both the International and China
776
+ // platforms. Every K3-series model has a 1,048,576-token window, and both ids share kimi-k3's
777
+ // parameter constraints: thinking is always on, top-level reasoning_effort takes low/high/max
778
+ // (default max), temperature/top_p/n/penalties are fixed, tool_choice "required" is supported.
779
+ // Verified 2026-10-25 against official docs only:
780
+ // Evidence: https://platform.kimi.ai/docs/models.md
781
+ // https://platform.kimi.ai/docs/guide/kimi-k3-1-pro-quickstart.md
782
+ // https://platform.kimi.ai/docs/api/models-overview.md
783
+ // https://platform.kimi.ai/docs/pricing/chat.md
784
+ // https://platform.kimi.com/docs/models.md (China)
785
+ export const KIMI_API_K31_MODELS = ["kimi-k3.1-pro", "kimi-k3.1-pro-highspeed"];
786
+ export const KIMI_API_K3_SERIES_MODELS = ["kimi-k3", ...KIMI_API_K31_MODELS];
787
+ export const KIMI_API_MODELS = [...KIMI_API_K3_SERIES_MODELS, ...KIMI_LEGACY_API_MODELS];
788
+ // The moonshot roster saved by installs between the K3 seed (260717) and K3.1 Pro. A literal on
789
+ // purpose: stale-model-roster-migration refreshes only rows still identical to it, and a later
790
+ // K2 retirement must not change what that refresh matches.
791
+ export const KIMI_API_MODELS_BEFORE_K31 = ["kimi-k3", "kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6", "kimi-k2.5"];
769
792
  // Every kimi coding preset record - picker, context windows, locked-parameter lists -
770
793
  // derives from the live ids only. seeding a retired id in a metadata list would re-arm
771
794
  // the model-rename migration on every boot (#5066): the list holds the retired id but
@@ -774,7 +797,7 @@ export const KIMI_API_MODELS = ["kimi-k3", ...KIMI_LEGACY_API_MODELS];
774
797
  // repairs saved rows still naming them.
775
798
  export const KIMI_THINKING_MODELS = KIMI_CODING_LIVE_MODELS;
776
799
  export const KIMI_CODING_NO_REASONING_MODELS = KIMI_CODING_LIVE_MODELS.filter(id => !KIMI_CODING_ADJUSTABLE_THINKING_MODELS.includes(id));
777
- export const KIMI_API_NO_REASONING_MODELS = KIMI_API_MODELS.filter(id => id !== "kimi-k3");
800
+ export const KIMI_API_NO_REASONING_MODELS = KIMI_API_MODELS.filter(id => !KIMI_API_K3_SERIES_MODELS.includes(id));
778
801
  export const KIMI_CODING_K3_REASONING_EFFORTS = ["low", "high", "max"];
779
802
  export const KIMI_CODING_K3_REASONING_EFFORT_MAP: Record<string, string> = {
780
803
  none: "none",
@@ -793,15 +816,33 @@ export const KIMI_CODING_DEFAULT_REASONING_EFFORTS = Object.fromEntries(
793
816
  export const KIMI_CODING_REASONING_EFFORT_MAPS = Object.fromEntries(
794
817
  KIMI_CODING_ADJUSTABLE_THINKING_MODELS.map(id => [id, KIMI_CODING_K3_REASONING_EFFORT_MAP]),
795
818
  );
819
+ // kimi-k3 keeps its launch-time max-only list; K3.1 Pro gets the documented low/high/max ladder.
796
820
  export const KIMI_API_REASONING_EFFORTS = Object.fromEntries(
797
- KIMI_API_MODELS.map(id => [id, id === "kimi-k3" ? ["max"] : []]),
821
+ KIMI_API_MODELS.map(id => [
822
+ id,
823
+ KIMI_API_K31_MODELS.includes(id) ? KIMI_CODING_K3_REASONING_EFFORTS : id === "kimi-k3" ? ["max"] : [],
824
+ ]),
825
+ );
826
+ export const KIMI_API_DEFAULT_REASONING_EFFORTS = Object.fromEntries(KIMI_API_K31_MODELS.map(id => [id, "max"]));
827
+ // K3.1 Pro cannot disable thinking and documents only low/high/max, so an explicit "none" omits
828
+ // reasoning_effort (upstream default max) rather than sending an undocumented value. The value is
829
+ // REASONING_EFFORT_OMIT_SENTINEL (src/reasoning-effort.ts); the registry does not import the
830
+ // request-path module, and provider-registry-parity asserts the two stay equal.
831
+ export const KIMI_API_K31_REASONING_EFFORT_MAP: Record<string, string> = {
832
+ ...KIMI_CODING_K3_REASONING_EFFORT_MAP,
833
+ none: "__omit__",
834
+ };
835
+ export const KIMI_API_REASONING_EFFORT_MAPS = Object.fromEntries(
836
+ KIMI_API_K31_MODELS.map(id => [id, KIMI_API_K31_REASONING_EFFORT_MAP]),
798
837
  );
799
838
  export const KIMI_LOCKED_PARAMETER_MODELS = KIMI_CODING_LIVE_MODELS;
800
839
  export const KIMI_AUTO_TOOL_CHOICE_ONLY_MODELS = ["kimi-for-coding"];
801
840
  export const KIMI_API_MODEL_CONTEXT_WINDOWS: Record<string, number> = Object.fromEntries(
802
- KIMI_API_MODELS.map(id => [id, id === "kimi-k3" ? KIMI_K3_1M_CONTEXT_WINDOW : 262_144]),
841
+ KIMI_API_MODELS.map(id => [id, KIMI_API_K3_SERIES_MODELS.includes(id) ? KIMI_K3_1M_CONTEXT_WINDOW : 262_144]),
842
+ );
843
+ export const KIMI_API_MODEL_INPUT_MODALITIES: Record<string, string[]> = Object.fromEntries(
844
+ KIMI_API_K3_SERIES_MODELS.map(id => [id, ["text", "image"]]),
803
845
  );
804
- export const KIMI_API_MODEL_INPUT_MODALITIES = { "kimi-k3": ["text", "image"] };
805
846
 
806
847
  // 260715 NVIDIA NIM kimi family (issue #126): documented served ids on integrate
807
848
  // chat/completions per docs.api.nvidia.com/nim/reference/llm-apis; live /v1/models
@@ -885,7 +926,7 @@ export const NVIDIA_NIM_NO_VISION_MODELS = [
885
926
  "poolside/laguna-xs-2.1", "z-ai/glm-5.3", "z-ai/glm-5.2",
886
927
  ];
887
928
  export const KIMI_CODING_MODEL_CONTEXT_WINDOWS: Record<string, number> = Object.fromEntries(
888
- KIMI_CODING_LIVE_MODELS.map(id => [id, (id === "k3[1m]" || KIMI_CODING_K28_MODELS.includes(id)) ? KIMI_K3_1M_CONTEXT_WINDOW : KIMI_K3_STANDARD_CONTEXT_WINDOW]),
929
+ KIMI_CODING_LIVE_MODELS.map(id => [id, (id === "k3[1m]" || KIMI_CODING_K31_MODELS.includes(id) || KIMI_CODING_K28_MODELS.includes(id)) ? KIMI_K3_1M_CONTEXT_WINDOW : KIMI_K3_STANDARD_CONTEXT_WINDOW]),
889
930
  );
890
931
  export const KIMI_CODING_MODEL_INPUT_MODALITIES = Object.fromEntries(
891
932
  KIMI_CODING_ADJUSTABLE_THINKING_MODELS.map(id => [id, ["text", "image"]]),
@@ -949,6 +990,8 @@ export const DIGITALOCEAN_CHAT_COMPLETION_MODELS = [
949
990
  "arcee-trinity-large-thinking",
950
991
  "openai-gpt-5.6-sol",
951
992
  "openai-gpt-5.6-terra",
993
+ // 261027 preemptive: GPT-6.1 Terra (mirrors the GPT-6 Sol seed; provider listing unverified).
994
+ "openai-gpt-6.1-terra",
952
995
  "openai-gpt-5.6-luna",
953
996
  // 260923 preemptive: GPT-6 Sol/Luna ahead of DigitalOcean's model list.
954
997
  "openai-gpt-6-sol",
@@ -1166,6 +1209,27 @@ export const OPPER_MODEL_INPUT_MODALITIES: Record<string, string[]> = Object.fro
1166
1209
  OPPER_MODELS.map(id => [id, OPPER_TEXT_ONLY_MODELS.includes(id) ? ["text"] : ["text", "image"]]),
1167
1210
  );
1168
1211
 
1212
+ // AI Stupid Level routing modes, as listed by the authenticated GET /v1/models on 2026-10-26
1213
+ // (https://aistupidlevel.info/router/docs#strategies). Each mode picks a model per request, so it
1214
+ // declares conservative limits that hold for any pick: a 262,144-token window (the pool's smallest,
1215
+ // Kimi K2.7 Code's, when first checked on 2026-10-23) and 64,000 output tokens.
1216
+ // The router is text only (image, audio and file parts are a 400 `unsupported_content`), so images
1217
+ // for a mode go through the vision sidecar. Pinned model ids arrive through live discovery.
1218
+ export const AISTUPIDLEVEL_ROUTING_MODES = [
1219
+ "auto-coding", "auto-tooling", "auto-reasoning", "auto-best", "auto", "auto-task",
1220
+ "auto-value", "auto-value-coding", "auto-value-tooling", "auto-value-reasoning",
1221
+ "auto-fastest-quality", "auto-consistent", "auto-cheapest", "auto-fastest", "auto-split",
1222
+ ];
1223
+ export const AISTUPIDLEVEL_MODEL_CONTEXT_WINDOWS: Record<string, number> = Object.fromEntries(
1224
+ AISTUPIDLEVEL_ROUTING_MODES.map(id => [id, 262_144]),
1225
+ );
1226
+ export const AISTUPIDLEVEL_MODEL_MAX_OUTPUT_TOKENS: Record<string, number> = Object.fromEntries(
1227
+ AISTUPIDLEVEL_ROUTING_MODES.map(id => [id, 64_000]),
1228
+ );
1229
+ export const AISTUPIDLEVEL_MODEL_INPUT_MODALITIES: Record<string, string[]> = Object.fromEntries(
1230
+ AISTUPIDLEVEL_ROUTING_MODES.map(id => [id, ["text"]]),
1231
+ );
1232
+
1169
1233
  export const STEPFUN_MODELS = [
1170
1234
  "step-5-preview",
1171
1235
  "step-3.5-flash",
@@ -63,6 +63,8 @@ export interface ProviderModelDiscoveryFilter {
63
63
  }
64
64
 
65
65
  interface ProviderModelDiscoverySharedSpec {
66
+ /** Product-config envelope used by WorkBuddy AI instead of an OpenAI model list. */
67
+ format?: "workbuddy";
66
68
  /** Query parameters applied to the resolved discovery URL. */
67
69
  query?: Readonly<Record<string, string>>;
68
70
  /** Top-level response key containing model rows; defaults to `data`. */
@@ -160,6 +162,14 @@ export interface ProviderRegistryEntry {
160
162
  */
161
163
  sponsor?: { tier: "main" | "standard"; url: string };
162
164
  dashboardPreset?: boolean;
165
+ /**
166
+ * The upstream route or service this entry depends on is gone. Deprecated entries stay in the
167
+ * registry so saved providers keep resolving and a pinned adapter keeps loading, but they are
168
+ * excluded from the add-provider picker, the init menu, the featured list, and new key logins.
169
+ * The value is the operator-facing reason; it is registry-only and never seeded into saved
170
+ * config.
171
+ */
172
+ deprecated?: string;
163
173
  note?: string;
164
174
  dashboardUrl?: string;
165
175
  defaultModel?: string;
@@ -308,6 +318,15 @@ export interface ProviderRegistryEntry {
308
318
  */
309
319
  modelDisplayNames?: Record<string, string>;
310
320
  modelInputModalities?: Record<string, string[]>;
321
+ /**
322
+ * Provider-wide input modalities for every model `modelInputModalities` does not enumerate,
323
+ * including ids that arrive from live discovery. Declare it where the limit belongs to the
324
+ * provider's API rather than to one model; a per-model entry still wins over it. Registry-only
325
+ * and runtime-only: never seeded or enriched into saved config, and applied only while a provider
326
+ * points at this entry's destination (routed provider, vision eligibility).
327
+ */
328
+ inputModalities?: string[];
329
+ modelCapabilities?: OcxProviderConfig["modelCapabilities"];
311
330
  defaultMaxOutputTokens?: number;
312
331
  modelMaxOutputTokens?: Record<string, number>;
313
332
  reasoningEfforts?: string[];
@@ -334,6 +353,8 @@ export interface ProviderRegistryEntry {
334
353
  * `directReasoningEffortModels` above is registry-owned.
335
354
  */
336
355
  noJsonSchemaModels?: string[];
356
+ /** Exact models with no established structured-output wire format. Registry-owned at routing. */
357
+ noStructuredOutputModels?: string[];
337
358
  /** Opt this provider into parallel tool calls (see OcxProviderConfig.parallelToolCalls). */
338
359
  parallelToolCalls?: boolean;
339
360
  /** Opt this provider into forwarding prompt_cache_key (OpenAI-specific; strict backends reject it). */
@@ -346,6 +367,12 @@ export interface ProviderRegistryEntry {
346
367
  chatServiceTier?: boolean;
347
368
  /** OpenAI Chat EOF policy for gateways that omit terminal frames after complete tool calls. */
348
369
  openaiChatEofTolerance?: boolean;
370
+ /**
371
+ * Record that this destination rejects the Chat `developer` role (`400 role 'developer' is not
372
+ * allowed`), so both the translated route and the native `/v1/chat/completions` passthrough send
373
+ * `system` instead. Seeds `foldDeveloperRoleToSystem` on the provider config; a user value wins.
374
+ */
375
+ foldDeveloperRoleToSystem?: boolean;
349
376
  autoToolChoiceOnlyModels?: string[];
350
377
  preserveReasoningContentModels?: string[];
351
378
  requiresReasoningPlaceholderModels?: string[];
@@ -378,10 +405,10 @@ export type ProviderConfigSeed = Pick<
378
405
  "anthropicOAuthInstance" |
379
406
  "adapter" | "baseUrl" | "apiKeyTransport" | "responsesPath" | "chatCompletionsPath" | "authMode" | "keyOptional" | "freeTier" | "modelSuffixBracketStrip" | "defaultModel" | "models"
380
407
  | "liveModels" | "contextWindow" | "modelContextWindows" | "modelInputModalities"
381
- | "modelDisplayNames"
408
+ | "modelDisplayNames" | "modelCapabilities"
382
409
  | "modelMaxInputTokens" | "defaultMaxOutputTokens" | "modelMaxOutputTokens"
383
410
  | "reasoningEfforts" | "modelReasoningEfforts" | "modelDefaultReasoningEfforts" | "reasoningEffortMap" | "modelReasoningEffortMap" | "reasoningWireFormat"
384
411
  | "noVisionModels" | "noReasoningModels" | "noTemperatureModels" | "noTopPModels" | "noStopModels" | "noPenaltyModels"
385
- | "autoToolChoiceOnlyModels" | "preserveReasoningContentModels" | "requiresReasoningPlaceholderModels" | "reasoningSplitModels" | "inlineThinkTagModels" | "reasoningDetailsModels" | "thinkingToggleModels" | "thinkingBudgetModels" | "escapeBuiltinToolNames" | "openaiChatEofTolerance" | "showThinkingSummary"
412
+ | "autoToolChoiceOnlyModels" | "preserveReasoningContentModels" | "requiresReasoningPlaceholderModels" | "reasoningSplitModels" | "inlineThinkTagModels" | "reasoningDetailsModels" | "thinkingToggleModels" | "thinkingBudgetModels" | "escapeBuiltinToolNames" | "openaiChatEofTolerance" | "foldDeveloperRoleToSystem" | "showThinkingSummary"
386
413
  | "googleMode" | "project" | "location" | "headers"
387
414
  >;
@@ -1,5 +1,6 @@
1
- import type { ModelCapabilities, OcxProviderConfig } from "../types";
2
- import { MODEL_ADAPTER_OVERRIDE_ALLOWED, pinnedWireAdapter } from "../types";
1
+ import type { ModelCapabilities, OcxProviderConfig, ReasoningCapabilities } from "../types";
2
+ import { declaredModelCapabilities, mergeReasoningModelCapabilities, reasoningCapabilitiesFromConfig, REASONING_CAPABILITY_FIELDS } from "./reasoning-capabilities";
3
+ import { MODEL_ADAPTER_OVERRIDE_ALLOWED, modelInList, pinnedWireAdapter } from "../types";
3
4
  import { isCanonicalOpenAiForwardProvider } from "./openai-tiers";
4
5
  import { resolveProviderAuthTransport } from "./fastwire";
5
6
  import { fastSwitchOff } from "./fast-opt-in";
@@ -31,8 +32,8 @@ export type StaticProviderPolicyField =
31
32
  | "modelMaxOutputTokens" | "reasoningEfforts" | "modelReasoningEfforts" | "modelReasoningEffortsAuthoritative"
32
33
  | "modelDefaultReasoningEfforts" | "reasoningEffortMap" | "modelReasoningEffortMap"
33
34
  | "reasoningWireFormat" | "noVisionModels" | "noReasoningModels" | "noTemperatureModels"
34
- | "noTopPModels" | "noStopModels" | "noPenaltyModels" | "noJsonSchemaModels" | "parallelToolCalls"
35
- | "promptCacheKey" | "chatServiceTier" | "openaiChatEofTolerance" | "statelessResponses"
35
+ | "noTopPModels" | "noStopModels" | "noPenaltyModels" | "noJsonSchemaModels" | "noStructuredOutputModels" | "parallelToolCalls"
36
+ | "promptCacheKey" | "chatServiceTier" | "openaiChatEofTolerance" | "foldDeveloperRoleToSystem" | "statelessResponses"
36
37
  | "requiresAdjacentResponsesToolResults" | "requiresPairedResponsesToolResults" | "annotateEmptyToolOutputs"
37
38
  | "fastWire" | "supportsServiceTier" | "modelSupportsServiceTier" | "supportsOpenAiWebSearchToolFields"
38
39
  | "supportsResponsesCustomTools" | "preserveResponsesReasoningContent" | "dropResponsesReasoningItems"
@@ -48,7 +49,7 @@ export type ResolvedProviderStaticPolicy = Readonly<Partial<StaticProviderPolicy
48
49
  adapter: string;
49
50
  baseUrl: string;
50
51
  }>;
51
- export interface ResolvedPerModelStaticPolicy {
52
+ export interface ResolvedPerModelStaticPolicy extends Readonly<ReasoningCapabilities> {
52
53
  readonly adapter: string;
53
54
  readonly contextWindow?: number;
54
55
  readonly inputModalities?: readonly string[];
@@ -173,7 +174,7 @@ export function resolveModelPolicy(input: ResolveModelPolicyInput): ResolvedMode
173
174
  "responsesPath", "chatCompletionsPath", "keyOptional", "freeTier", "modelSuffixBracketStrip",
174
175
  "defaultModel", "models", "liveModels", "contextWindow", "defaultMaxOutputTokens",
175
176
  "reasoningWireFormat", "parallelToolCalls", "promptCacheKey",
176
- "openaiChatEofTolerance", "statelessResponses",
177
+ "openaiChatEofTolerance", "foldDeveloperRoleToSystem", "statelessResponses",
177
178
  "requiresAdjacentResponsesToolResults", "requiresPairedResponsesToolResults",
178
179
  "annotateEmptyToolOutputs", "fastWire", "supportsServiceTier",
179
180
  "supportsOpenAiWebSearchToolFields", "supportsResponsesCustomTools",
@@ -215,9 +216,11 @@ export function resolveModelPolicy(input: ResolveModelPolicyInput): ResolvedMode
215
216
  putMergedMap("modelSupportsReasoningSummaries", entry?.modelSupportsReasoningSummaries, provider.modelSupportsReasoningSummaries);
216
217
  putMergedMap("modelSupportsVerbosity", entry?.modelSupportsVerbosity, provider.modelSupportsVerbosity);
217
218
  for (const key of [
218
- "modelCapabilities", "modelAutoCompactTokenLimits", "modelSuppressSyntheticMax",
219
+ "modelAutoCompactTokenLimits", "modelSuppressSyntheticMax",
219
220
  "modelReasoningSummaryDelivery", "codexToolMode", "modelAdapters",
220
221
  ] as const) putScalar(key, undefined);
222
+ put("modelCapabilities", mergeReasoningModelCapabilities(entry?.modelCapabilities, provider.modelCapabilities),
223
+ provider.modelCapabilities !== undefined ? "operator-capability" : entry?.modelCapabilities !== undefined ? "registry" : "unknown");
221
224
  for (const key of ["modelContextWindows", "modelMaxInputTokens"] as const) {
222
225
  const [value, source] = input.providerName === "openai-apikey"
223
226
  ? positiveCapMap(entry?.[key], provider[key])
@@ -231,7 +234,7 @@ export function resolveModelPolicy(input: ResolveModelPolicyInput): ResolvedMode
231
234
  for (const key of [
232
235
  "noVisionModels", "noReasoningModels", "noTemperatureModels", "noTopPModels",
233
236
  "noStopModels",
234
- "noPenaltyModels", "noJsonSchemaModels", "autoToolChoiceOnlyModels",
237
+ "noPenaltyModels", "noJsonSchemaModels", "noStructuredOutputModels", "autoToolChoiceOnlyModels",
235
238
  "preserveReasoningContentModels", "requiresReasoningPlaceholderModels",
236
239
  "reasoningSplitModels", "reasoningDetailsModels", "thinkingToggleModels", "thinkingBudgetModels",
237
240
  ] as const) putUnion(key, entry?.[key]);
@@ -325,7 +328,16 @@ export function resolveModelPolicy(input: ResolveModelPolicyInput): ResolvedMode
325
328
  : exactMaxInputTokens;
326
329
  const exactMaxOutputTokens = modelValue(providerPolicy.modelMaxOutputTokens);
327
330
  const modelMaxOutputTokens = exactMaxOutputTokens ?? providerPolicy.defaultMaxOutputTokens;
328
- const modelReasoningEfforts = modelValue(providerPolicy.modelReasoningEfforts) ?? providerPolicy.reasoningEfforts;
331
+ const reasoningCapabilities = reasoningCapabilitiesFromConfig({
332
+ ...providerPolicy,
333
+ adapter: providerPolicy.adapter ?? provider.adapter,
334
+ baseUrl: providerPolicy.baseUrl ?? provider.baseUrl,
335
+ ...(input.modelCapabilities ? { modelCapabilities: mergeReasoningModelCapabilities(
336
+ providerPolicy.modelCapabilities, { [input.modelId]: input.modelCapabilities },
337
+ ) } : {}),
338
+ }, input.modelId);
339
+ const modelReasoningEfforts = reasoningCapabilities.supportsReasoningEffort === false ? []
340
+ : modelValue(providerPolicy.modelReasoningEfforts) ?? providerPolicy.reasoningEfforts;
329
341
  const modelSupportsReasoningSummaries = modelValue(providerPolicy.modelSupportsReasoningSummaries)
330
342
  ?? (modelValue(providerPolicy.modelReasoningSummaryDelivery) !== undefined ? true : undefined);
331
343
  const modelSupportsVerbosity = modelValue(providerPolicy.modelSupportsVerbosity) ?? providerPolicy.supportsVerbosity;
@@ -334,6 +346,7 @@ export function resolveModelPolicy(input: ResolveModelPolicyInput): ResolvedMode
334
346
  : modelValue(providerPolicy.modelSupportsServiceTier) ?? providerPolicy.supportsServiceTier;
335
347
  const model: ResolvedPerModelStaticPolicy = {
336
348
  adapter,
349
+ ...reasoningCapabilities,
337
350
  ...(modelContextWindow !== undefined ? { contextWindow: modelContextWindow } : {}),
338
351
  ...(capabilityModalities ?? modelValue(providerPolicy.modelInputModalities) !== undefined
339
352
  ? { inputModalities: capabilityModalities ?? modelValue(providerPolicy.modelInputModalities) }
@@ -341,7 +354,7 @@ export function resolveModelPolicy(input: ResolveModelPolicyInput): ResolvedMode
341
354
  ...(modelMaxInputTokens !== undefined ? { maxInputTokens: modelMaxInputTokens } : {}),
342
355
  ...(modelMaxOutputTokens !== undefined ? { maxOutputTokens: modelMaxOutputTokens } : {}),
343
356
  ...(modelReasoningEfforts !== undefined ? { reasoningEfforts: modelReasoningEfforts } : {}),
344
- ...(modelValue(providerPolicy.modelDefaultReasoningEfforts) !== undefined ? { defaultReasoningEffort: modelValue(providerPolicy.modelDefaultReasoningEfforts) } : {}),
357
+ ...(reasoningCapabilities.supportsReasoningEffort !== false && modelValue(providerPolicy.modelDefaultReasoningEfforts) !== undefined ? { defaultReasoningEffort: modelValue(providerPolicy.modelDefaultReasoningEfforts) } : {}),
345
358
  ...(modelSupportsReasoningSummaries !== undefined ? { supportsReasoningSummaries: modelSupportsReasoningSummaries } : {}),
346
359
  ...(modelSupportsVerbosity !== undefined ? { supportsVerbosity: modelSupportsVerbosity } : {}),
347
360
  ...(modelSupportsServiceTier !== undefined ? { supportsServiceTier: modelSupportsServiceTier } : {}),
@@ -359,6 +372,13 @@ export function resolveModelPolicy(input: ResolveModelPolicyInput): ResolvedMode
359
372
  const modelProvenance: Partial<Record<keyof ResolvedPerModelStaticPolicy, StaticPolicySource>> = {
360
373
  adapter: adapterSource,
361
374
  };
375
+ for (const field of REASONING_CAPABILITY_FIELDS) {
376
+ modelProvenance[field] = reasoningCapabilities[field] === undefined ? "unknown"
377
+ : modelInList(provider.noReasoningModels, input.modelId) ? "operator"
378
+ : modelInList(entry?.noReasoningModels, input.modelId) ? "registry"
379
+ : input.modelCapabilities?.[field] !== undefined || declaredModelCapabilities(provider.modelCapabilities, input.modelId)?.[field] !== undefined
380
+ ? "operator-capability" : declaredModelCapabilities(entry?.modelCapabilities, input.modelId)?.[field] !== undefined ? "registry" : "operator";
381
+ }
362
382
  modelProvenance.contextWindow = modelOrProviderSource(provider.modelContextWindows, entry?.modelContextWindows, provider.contextWindow, entry?.contextWindow);
363
383
  if (modelProvenance.contextWindow === "unknown" && familyContextWindow !== undefined) {
364
384
  modelProvenance.contextWindow = anthropicFamilyContextWindow(provider.modelContextWindows, input.modelId) !== undefined
@@ -13,7 +13,7 @@ import { captureProviderApiKeySelection } from "./api-key-selection-capture";
13
13
  import { assertProviderDestinationAllowed } from "../lib/destination-policy";
14
14
  import { redactSecretString, redactUrlForLog } from "../lib/redact";
15
15
  import { PROVIDER_REGISTRY, registryEntryForProviderDestination } from "./registry";
16
- import { applyDirectReasoningEffortContracts, hasLegacyClinePassReasoningEfforts } from "./derive";
16
+ import { applyDirectReasoningEffortContracts, hasLegacyClinePassReasoningEfforts, registryInputModalitiesForDestination } from "./derive";
17
17
  import { cloneFastWire } from "./fastwire";
18
18
  import { fastSwitchOff } from "./fast-opt-in";
19
19
  import {
@@ -21,6 +21,7 @@ import {
21
21
  providerSupportsLiveModelDiscovery,
22
22
  } from "./static-model-discovery";
23
23
  import { resolveModelPolicy } from "./resolved-model-policy";
24
+ import { mapFill, nestedMapFill, stableUnion } from "./resolved-model-policy-merge";
24
25
 
25
26
  /** Same endpoint modulo surrounding space and trailing slashes — matches `matchBaseUrlChoice`. */
26
27
  function isSameEndpoint(a: string, b: string): boolean {
@@ -121,9 +122,21 @@ export function routedProviderConfig(providerName: string, provider: OcxProvider
121
122
  // the reasoning item the upstream answers 400 to. Destination matching refuses templated and
122
123
  // overridable base URLs, so this cannot follow a retargeted row, and an explicit value wins.
123
124
  const destination = registryEntryForProviderDestination(provider);
125
+ const inputModalities = provider.inputModalities === undefined
126
+ ? registryInputModalitiesForDestination(providerName, provider) : undefined;
124
127
  return {
125
128
  ...provider,
129
+ ...(inputModalities ? { inputModalities } : {}),
126
130
  apiKey: usableResolvedApiKey(provider.apiKey),
131
+ ...(destination?.modelDefaultReasoningEfforts ? {
132
+ modelDefaultReasoningEfforts: mapFill(destination.modelDefaultReasoningEfforts, provider.modelDefaultReasoningEfforts)[0],
133
+ } : {}),
134
+ ...(destination?.modelReasoningEffortMap ? {
135
+ modelReasoningEffortMap: nestedMapFill(destination.modelReasoningEffortMap, provider.modelReasoningEffortMap)[0],
136
+ } : {}),
137
+ ...(destination?.noStructuredOutputModels?.length ? {
138
+ noStructuredOutputModels: stableUnion(destination.noStructuredOutputModels, provider.noStructuredOutputModels)[0],
139
+ } : {}),
127
140
  ...(provider.dropResponsesReasoningItems === undefined && destination?.dropResponsesReasoningItems !== undefined
128
141
  ? { dropResponsesReasoningItems: destination.dropResponsesReasoningItems }
129
142
  : {}),
@@ -172,6 +185,7 @@ export function routedProviderConfig(providerName: string, provider: OcxProvider
172
185
  const noStopModels = staticPolicy.noStopModels;
173
186
  const noPenaltyModels = staticPolicy.noPenaltyModels;
174
187
  const noJsonSchemaModels = staticPolicy.noJsonSchemaModels;
188
+ const noStructuredOutputModels = staticPolicy.noStructuredOutputModels;
175
189
  const autoToolChoiceOnlyModels = staticPolicy.autoToolChoiceOnlyModels;
176
190
  const preserveReasoningContentModels = staticPolicy.preserveReasoningContentModels;
177
191
  const requiresReasoningPlaceholderModels = staticPolicy.requiresReasoningPlaceholderModels;
@@ -287,6 +301,11 @@ export function routedProviderConfig(providerName: string, provider: OcxProvider
287
301
  ...(provider.project === undefined && registryEntry.project !== undefined ? { project: registryEntry.project } : {}),
288
302
  ...(provider.location === undefined && registryEntry.location !== undefined ? { location: registryEntry.location } : {}),
289
303
  ...(provider.contextWindow === undefined && registryEntry.contextWindow !== undefined ? { contextWindow: registryEntry.contextWindow } : {}),
304
+ // The request path never calls enrichProviderFromRegistry(), so a row saved before the
305
+ // registry declared a provider-wide modality must inherit it here to reach the vision gate.
306
+ ...(provider.inputModalities === undefined && registryEntry.inputModalities !== undefined
307
+ ? { inputModalities: [...registryEntry.inputModalities] }
308
+ : {}),
290
309
  ...((provider.reasoningEfforts === undefined || hasLegacyClinePassReasoningEfforts(providerName, provider))
291
310
  && registryEntry.reasoningEfforts !== undefined
292
311
  ? { reasoningEfforts: [...registryEntry.reasoningEfforts] }
@@ -302,6 +321,9 @@ export function routedProviderConfig(providerName: string, provider: OcxProvider
302
321
  ...(provider.openaiChatEofTolerance === undefined && registryEntry.openaiChatEofTolerance !== undefined
303
322
  ? { openaiChatEofTolerance: registryEntry.openaiChatEofTolerance }
304
323
  : {}),
324
+ ...(provider.foldDeveloperRoleToSystem === undefined && registryEntry.foldDeveloperRoleToSystem !== undefined
325
+ ? { foldDeveloperRoleToSystem: registryEntry.foldDeveloperRoleToSystem }
326
+ : {}),
305
327
  ...(provider.reasoningWireFormat === undefined && registryEntry.reasoningWireFormat !== undefined
306
328
  ? { reasoningWireFormat: registryEntry.reasoningWireFormat }
307
329
  : {}),
@@ -325,6 +347,7 @@ export function routedProviderConfig(providerName: string, provider: OcxProvider
325
347
  ...(noStopModels ? { noStopModels } : {}),
326
348
  ...(noPenaltyModels ? { noPenaltyModels } : {}),
327
349
  ...(noJsonSchemaModels ? { noJsonSchemaModels } : {}),
350
+ ...(noStructuredOutputModels ? { noStructuredOutputModels } : {}),
328
351
  ...(autoToolChoiceOnlyModels ? { autoToolChoiceOnlyModels } : {}),
329
352
  ...(preserveReasoningContentModels ? { preserveReasoningContentModels } : {}),
330
353
  ...(requiresReasoningPlaceholderModels ? { requiresReasoningPlaceholderModels } : {}),