@bitkyc08/opencodex 2.92.0 → 2.93.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 (258) hide show
  1. package/bin/ocx.mjs +10 -5
  2. package/gui/dist/assets/{App-sUf_8afJ.js → App-CizjBqyk.js} +18 -18
  3. package/gui/dist/assets/{Tray-BSsxznDm.js → Tray-DamiMqcX.js} +1 -1
  4. package/gui/dist/assets/{index-BlFE_VB_.js → index-DQsht3vH.js} +12 -12
  5. package/gui/dist/assets/index-DRe8Hhfz.css +1 -0
  6. package/gui/dist/assets/{quota-summary-BRlbXgw0.js → quota-summary-BXu4zE8H.js} +1 -1
  7. package/gui/dist/index.html +2 -2
  8. package/package.json +5 -5
  9. package/src/adapters/anthropic.ts +28 -5
  10. package/src/adapters/coding-agent/batch-dispatcher.ts +122 -0
  11. package/src/adapters/coding-agent/profile.ts +54 -16
  12. package/src/adapters/coding-agent/turn.ts +30 -2
  13. package/src/adapters/command-code.ts +114 -7
  14. package/src/adapters/cursor/native-exec-fs.ts +11 -9
  15. package/src/adapters/devin/live-models.ts +4 -0
  16. package/src/adapters/google-wire-compiler.ts +1 -2
  17. package/src/adapters/kiro/reasoning.ts +2 -0
  18. package/src/adapters/kiro-refusal.ts +6 -1
  19. package/src/adapters/kiro-wire.ts +1 -1
  20. package/src/adapters/openai-chat/messages.ts +8 -2
  21. package/src/adapters/openai-chat/passthrough.ts +35 -14
  22. package/src/adapters/openai-chat/reasoning-replay.ts +27 -16
  23. package/src/adapters/openai-chat/reasoning-wire.ts +117 -8
  24. package/src/adapters/openai-chat/required-tool-result.ts +64 -0
  25. package/src/adapters/openai-chat.ts +7 -8
  26. package/src/adapters/openai-responses/passthrough.ts +7 -4
  27. package/src/adapters/openai-responses/reasoning.ts +13 -0
  28. package/src/adapters/openai-responses/request-strips.ts +1 -1
  29. package/src/adapters/qoder/adapter.ts +129 -8
  30. package/src/adapters/qoder/scaffold-guard.ts +5 -0
  31. package/src/adapters/reasoning-controls.ts +16 -0
  32. package/src/adapters/tool-call-id.ts +1 -3
  33. package/src/bridge/errors.ts +27 -0
  34. package/src/bridge.ts +1 -1
  35. package/src/chat/inbound.ts +4 -1
  36. package/src/chat/outbound.ts +9 -2
  37. package/src/chat/reasoning-details.ts +28 -5
  38. package/src/claude/desktop-first-party.ts +54 -4
  39. package/src/claude/desktop-picker.ts +11 -8
  40. package/src/claude/first-party-settings.ts +3 -1
  41. package/src/claude/inbound.ts +2 -1
  42. package/src/claude/intercept/local-ca.ts +2 -1
  43. package/src/claude/intercept/picker-ca-cleanup.ts +4 -2
  44. package/src/claude/intercept/picker-ca-startup.ts +3 -1
  45. package/src/claude/intercept/picker-models.ts +6 -3
  46. package/src/claude/intercept/picker-runtime.ts +3 -2
  47. package/src/claude/intercept/runtime.ts +6 -3
  48. package/src/claude/model-info.ts +31 -8
  49. package/src/cli/account-api.ts +11 -0
  50. package/src/cli/capabilities-agents-routing.ts +2 -2
  51. package/src/cli/capabilities-base.ts +7 -1
  52. package/src/cli/capabilities-observe-system.ts +10 -0
  53. package/src/cli/claude-desktop.ts +9 -8
  54. package/src/cli/claude.ts +3 -2
  55. package/src/cli/codex-shim-autorestore.ts +9 -0
  56. package/src/cli/combo-result.ts +7 -0
  57. package/src/cli/combo.ts +18 -0
  58. package/src/cli/cross-home-owner.ts +13 -1
  59. package/src/cli/dispatch.ts +25 -6
  60. package/src/cli/ensure-desired-integrations.ts +8 -6
  61. package/src/cli/export-command.ts +4 -1
  62. package/src/cli/help.ts +2 -1
  63. package/src/cli/index.ts +45 -45
  64. package/src/cli/integration-plan-dto.ts +4 -0
  65. package/src/cli/opencode.ts +20 -9
  66. package/src/cli/registry.ts +6 -4
  67. package/src/cli/root.ts +9 -0
  68. package/src/cli/status.ts +59 -1
  69. package/src/cli/stop-restore.ts +113 -0
  70. package/src/cli/sync-expectation.ts +60 -0
  71. package/src/cli/uninstall-integrations.ts +41 -7
  72. package/src/client/connect.ts +40 -3
  73. package/src/client/link-home.ts +10 -1
  74. package/src/client/machine-api.ts +3 -1
  75. package/src/client/sync-expectation.ts +118 -0
  76. package/src/clients/config-export/agent-clients.ts +96 -0
  77. package/src/clients/config-export/contracts.ts +25 -7
  78. package/src/clients/config-export/qoder.ts +38 -23
  79. package/src/clients/config-export/reasoning-metadata.ts +55 -8
  80. package/src/clients/config-export.ts +12 -0
  81. package/src/clients/lazycodex.ts +7 -2
  82. package/src/clients/reasoning-controls.ts +49 -0
  83. package/src/codex/auth-api/account-identity.ts +14 -0
  84. package/src/codex/auth-api/account-list.ts +29 -2
  85. package/src/codex/auth-api/http.ts +13 -0
  86. package/src/codex/auth-api/main-account-probe.ts +2 -2
  87. package/src/codex/auth-api/pool-mode-gate.ts +16 -3
  88. package/src/codex/auth-api/pool-quota-probe.ts +15 -0
  89. package/src/codex/auth-context.ts +15 -12
  90. package/src/codex/catalog/build-entries.ts +22 -0
  91. package/src/codex/catalog/configured-tiers.ts +70 -0
  92. package/src/codex/catalog/effort.ts +44 -10
  93. package/src/codex/catalog/gather-capture.ts +1 -0
  94. package/src/codex/catalog/heal-observation.ts +155 -13
  95. package/src/codex/catalog/metadata.ts +6 -0
  96. package/src/codex/catalog/model-hints.ts +60 -11
  97. package/src/codex/catalog/model-visibility.ts +3 -2
  98. package/src/codex/catalog/native-models.ts +18 -3
  99. package/src/codex/catalog/parsing.ts +10 -8
  100. package/src/codex/catalog/pinned-models.ts +2 -1
  101. package/src/codex/catalog/provider-models.ts +4 -5
  102. package/src/codex/catalog/retained-sync.ts +2 -1
  103. package/src/codex/catalog/routed-gather.ts +19 -20
  104. package/src/codex/catalog/write-audit.ts +3 -2
  105. package/src/codex/catalog-self-heal.ts +43 -23
  106. package/src/codex/collision-identity.ts +30 -5
  107. package/src/codex/convergence.ts +4 -3
  108. package/src/codex/data/roster-pinned-models.json +177 -1
  109. package/src/codex/desired-state.ts +6 -1
  110. package/src/codex/desktop-compatibility/installed-build.ts +88 -12
  111. package/src/codex/desktop-compatibility/runtime.ts +29 -5
  112. package/src/codex/desktop-compatibility/usage-controller.ts +2 -0
  113. package/src/codex/desktop-compatibility/windows-certificate-trust.ts +46 -12
  114. package/src/codex/inject/config-toml.ts +0 -18
  115. package/src/codex/inject/plan.ts +18 -3
  116. package/src/codex/inject/remove.ts +6 -2
  117. package/src/codex/inject.ts +1 -1
  118. package/src/codex/journal.ts +61 -1
  119. package/src/codex/model-entitlements.ts +1 -1
  120. package/src/codex/native-main-owner.ts +27 -1
  121. package/src/codex/native-profile-store.ts +2 -1
  122. package/src/codex/pool-credit-policy.ts +35 -1
  123. package/src/codex/quota-types.ts +3 -0
  124. package/src/codex/quota.ts +24 -4
  125. package/src/codex/role-auto-assign.ts +6 -2
  126. package/src/codex/subagent-defaults.ts +49 -4
  127. package/src/combos/failover.ts +17 -2
  128. package/src/combos/jev-decision-contract.ts +22 -1
  129. package/src/combos/jev-service-exchange.ts +3 -1
  130. package/src/combos/jev.ts +95 -9
  131. package/src/combos/resolve.ts +45 -1
  132. package/src/combos/types.ts +24 -0
  133. package/src/config/load-degrade.ts +5 -0
  134. package/src/config/paths.ts +19 -3
  135. package/src/config/pending-teardown.ts +22 -1
  136. package/src/config/provider-validation.ts +15 -4
  137. package/src/config/removed-opencode-free.ts +11 -0
  138. package/src/config/schema/leaf-validators.ts +5 -0
  139. package/src/generated/compatibility-version.json +314 -230
  140. package/src/generated/model-metadata.ts +5 -5
  141. package/src/images/loop.ts +16 -2
  142. package/src/integrations/catalog-refresh.ts +1 -1
  143. package/src/integrations/hermes-profiles.ts +251 -0
  144. package/src/integrations/merge.ts +8 -0
  145. package/src/integrations/mutation-plan.ts +19 -4
  146. package/src/integrations/registry.ts +5 -0
  147. package/src/integrations/state.ts +36 -1
  148. package/src/integrations/writer.ts +18 -4
  149. package/src/lib/bun-path-runtime.mjs +2 -1
  150. package/src/lib/errors.ts +62 -0
  151. package/src/lib/eventstream-decoder.ts +81 -37
  152. package/src/lib/opaque-proxy-tunnel.ts +32 -8
  153. package/src/lib/pinned-http.ts +35 -2
  154. package/src/lib/process-control.ts +13 -1
  155. package/src/lib/socks5-fetch.ts +59 -64
  156. package/src/lib/socks5-upload-waiter.ts +50 -0
  157. package/src/lib/sse-decoder.ts +7 -2
  158. package/src/lib/state-store-sweeper.ts +40 -14
  159. package/src/lib/windows-native-principal-worker.ts +14 -0
  160. package/src/lib/windows-native-principal.ts +188 -0
  161. package/src/lib/windows-secret-acl.ts +39 -3
  162. package/src/lib/windows-user-principal.ts +62 -18
  163. package/src/link/ssh-config.ts +35 -3
  164. package/src/providers/account-quota-disk.ts +12 -4
  165. package/src/providers/codebuddy-models.ts +6 -0
  166. package/src/providers/codex-capacity.ts +3 -1
  167. package/src/providers/derive.ts +28 -0
  168. package/src/providers/kiro-models.ts +3 -0
  169. package/src/providers/mimo-thinking.ts +12 -0
  170. package/src/providers/model-rename-fields.ts +1 -0
  171. package/src/providers/model-rename-migration.ts +10 -0
  172. package/src/providers/openai-sidecar-credit.ts +2 -2
  173. package/src/providers/reasoning-capabilities.ts +76 -0
  174. package/src/providers/registry/entries-core.ts +14 -12
  175. package/src/providers/registry/entries-extended.ts +63 -20
  176. package/src/providers/registry/model-ids.ts +2 -0
  177. package/src/providers/registry/model-seeds.ts +93 -28
  178. package/src/providers/registry/types.ts +10 -1
  179. package/src/providers/resolved-model-policy.ts +26 -6
  180. package/src/providers/routed-config.ts +9 -1
  181. package/src/providers/stale-model-roster-migration.ts +44 -7
  182. package/src/remote-control/workspace-pi-runtime.ts +11 -6
  183. package/src/responses/compaction-summary.ts +45 -0
  184. package/src/responses/muse-tool-name-alias.ts +1 -2
  185. package/src/responses/parser.ts +3 -2
  186. package/src/responses/schema.ts +1 -0
  187. package/src/responses/thought-signature-replay.ts +10 -2
  188. package/src/routing/capability.ts +8 -2
  189. package/src/routing/history/ingest.ts +28 -3
  190. package/src/server/auth-cors.ts +3 -2
  191. package/src/server/chat-completions.ts +7 -0
  192. package/src/server/chat-native-eligibility.ts +7 -0
  193. package/src/server/chat-native-reasoning.ts +14 -4
  194. package/src/server/direct-local-http.ts +5 -2
  195. package/src/server/effort-policy.ts +5 -1
  196. package/src/server/index/live-sideband.ts +18 -15
  197. package/src/server/index/serve-options.ts +5 -4
  198. package/src/server/management/agent-settings-routes.ts +27 -15
  199. package/src/server/management/combo-routes.ts +4 -0
  200. package/src/server/management/config-routes.ts +2 -2
  201. package/src/server/management/decision-discovery.ts +12 -2
  202. package/src/server/management/hermes-profile-routes.ts +156 -0
  203. package/src/server/management/integration-routes.ts +85 -24
  204. package/src/server/management/model-routes.ts +2 -2
  205. package/src/server/management/model-row-export-metadata.ts +25 -6
  206. package/src/server/management/model-rows.ts +15 -20
  207. package/src/server/management/native-integration-routes.ts +11 -8
  208. package/src/server/management/route-registry.ts +4 -0
  209. package/src/server/management-api.ts +5 -0
  210. package/src/server/models-capabilities.ts +21 -3
  211. package/src/server/responses/adapter-delivery.ts +11 -1
  212. package/src/server/responses/adapter-dispatch.ts +2 -2
  213. package/src/server/responses/codex-ws-exchange.ts +39 -9
  214. package/src/server/responses/codex-ws-session.ts +38 -4
  215. package/src/server/responses/codex-ws-wire.ts +6 -1
  216. package/src/server/responses/combo-required-tool-contract.ts +103 -0
  217. package/src/server/responses/combo-stream-preflight.ts +8 -1
  218. package/src/server/responses/compact.ts +4 -3
  219. package/src/server/responses/context-overflow.ts +8 -1
  220. package/src/server/responses/core-combo-failure.ts +10 -0
  221. package/src/server/responses/core-combo.ts +23 -15
  222. package/src/server/responses/core-lifetime.ts +3 -0
  223. package/src/server/responses/core-normalize.ts +11 -1
  224. package/src/server/responses/core-options.ts +2 -0
  225. package/src/server/responses/main-hard-lock-routing.ts +60 -44
  226. package/src/server/responses/passthrough-delivery.ts +40 -2
  227. package/src/server/responses/policy-fallback.ts +6 -1
  228. package/src/server/responses/request-compression.ts +12 -7
  229. package/src/server/responses/request-prepare.ts +22 -2
  230. package/src/server/responses/request-sidecar-auth.ts +2 -0
  231. package/src/server/responses/response-effects.ts +22 -10
  232. package/src/server/responses/sidecar-execution.ts +11 -3
  233. package/src/server/stop-teardown.ts +36 -1
  234. package/src/server/ws-bridge.ts +1 -1
  235. package/src/service/desktop-supervision.d.mts +7 -4
  236. package/src/service/desktop-supervision.mjs +90 -13
  237. package/src/service/ownership-mutation-lease.mjs +21 -7
  238. package/src/types/config.ts +8 -2
  239. package/src/types/provider.ts +20 -6
  240. package/src/types/request.ts +10 -0
  241. package/src/types.ts +1 -0
  242. package/src/update/bind-probe.ts +29 -0
  243. package/src/update/job.ts +10 -29
  244. package/src/update/npm-install-job.ps1 +173 -0
  245. package/src/update/npm-install.mjs +70 -0
  246. package/src/update/stop-contract.d.mts +1 -0
  247. package/src/update/stop-contract.mjs +14 -0
  248. package/src/update/stop-decision.d.mts +1 -1
  249. package/src/update/stop-decision.mjs +13 -3
  250. package/src/update/teardown-handover.ts +166 -0
  251. package/src/update/transactional-install.d.mts +14 -3
  252. package/src/update/transactional-install.mjs +33 -7
  253. package/src/usage/expected-prices.ts +64 -31
  254. package/src/usage/timeline.ts +19 -9
  255. package/src/vision/eligibility.ts +15 -5
  256. package/src/vision/plan.ts +2 -2
  257. package/src/web-search/loop.ts +16 -2
  258. package/gui/dist/assets/index-DPeB9HpV.css +0 -1
@@ -9,6 +9,7 @@ import {
9
9
  MOONSHOT_INTL_BASE_URL,
10
10
  } from "../base-url-choices";
11
11
  import { COMMAND_CODE_MODEL_REASONING_EFFORTS } from "../command-code-efforts";
12
+ import { MIMO_THINKING_CAPABILITIES, MIMO_THINKING_MODELS } from "../mimo-thinking";
12
13
  import {
13
14
  CODEBUDDY_CN_MODELS,
14
15
  CODEBUDDY_CN_MODEL_CONTEXT_WINDOWS,
@@ -38,7 +39,7 @@ import {
38
39
  MINIMAX_MODEL_INPUT_MODALITIES,
39
40
  MINIMAX_M3_REASONING_EFFORTS,
40
41
  MINIMAX_M3_REASONING_EFFORT_MAP,
41
- MINIMAX_M31_FLASH_PREVIEW,
42
+ MINIMAX_M31_FLASH,
42
43
  MINIMAX_M31_REASONING_EFFORTS,
43
44
  MINIMAX_M31_DEFAULT_REASONING_EFFORT,
44
45
  MINIMAX_REASONING_SPLIT_MODELS,
@@ -86,6 +87,8 @@ import {
86
87
  KIMI_CODING_DEFAULT_REASONING_EFFORTS,
87
88
  KIMI_CODING_REASONING_EFFORT_MAPS,
88
89
  KIMI_API_REASONING_EFFORTS,
90
+ KIMI_API_DEFAULT_REASONING_EFFORTS,
91
+ KIMI_API_REASONING_EFFORT_MAPS,
89
92
  KIMI_LOCKED_PARAMETER_MODELS,
90
93
  KIMI_AUTO_TOOL_CHOICE_ONLY_MODELS,
91
94
  KIMI_API_MODEL_CONTEXT_WINDOWS,
@@ -108,6 +111,10 @@ import {
108
111
  OPPER_MODEL_CONTEXT_WINDOWS,
109
112
  OPPER_MODEL_MAX_OUTPUT_TOKENS,
110
113
  OPPER_MODEL_INPUT_MODALITIES,
114
+ AISTUPIDLEVEL_ROUTING_MODES,
115
+ AISTUPIDLEVEL_MODEL_CONTEXT_WINDOWS,
116
+ AISTUPIDLEVEL_MODEL_MAX_OUTPUT_TOKENS,
117
+ AISTUPIDLEVEL_MODEL_INPUT_MODALITIES,
111
118
  STEPFUN_MODELS,
112
119
  STEPFUN_MODEL_CONTEXT_WINDOWS,
113
120
  STEPFUN_MODEL_INPUT_MODALITIES,
@@ -478,6 +485,8 @@ export const PROVIDER_REGISTRY_EXTENDED: readonly ProviderRegistryEntry[] = [
478
485
  modelInputModalities: KIMI_API_MODEL_INPUT_MODALITIES,
479
486
  noReasoningModels: KIMI_API_NO_REASONING_MODELS,
480
487
  modelReasoningEfforts: KIMI_API_REASONING_EFFORTS,
488
+ modelDefaultReasoningEfforts: KIMI_API_DEFAULT_REASONING_EFFORTS,
489
+ modelReasoningEffortMap: KIMI_API_REASONING_EFFORT_MAPS,
481
490
  noTemperatureModels: KIMI_API_MODELS,
482
491
  noTopPModels: KIMI_API_MODELS,
483
492
  noPenaltyModels: KIMI_API_MODELS,
@@ -1040,18 +1049,18 @@ export const PROVIDER_REGISTRY_EXTENDED: readonly ProviderRegistryEntry[] = [
1040
1049
  },
1041
1050
  {
1042
1051
  id: "minimax", label: "MiniMax — Coding Plan", baseUrl: "https://api.minimax.io/v1", adapter: "openai-chat", authKind: "key",
1043
- dashboardUrl: "https://platform.minimax.io", defaultModel: "MiniMax-M3", models: MINIMAX_MODELS,
1052
+ dashboardUrl: "https://platform.minimax.io", defaultModel: MINIMAX_M31_FLASH, models: MINIMAX_MODELS,
1044
1053
  modelContextWindows: MINIMAX_MODEL_CONTEXT_WINDOWS,
1045
1054
  modelInputModalities: MINIMAX_MODEL_INPUT_MODALITIES,
1046
- modelReasoningEfforts: { "MiniMax-M3": MINIMAX_M3_REASONING_EFFORTS, [MINIMAX_M31_FLASH_PREVIEW]: MINIMAX_M31_REASONING_EFFORTS },
1047
- modelDefaultReasoningEfforts: { "MiniMax-M3": "medium", [MINIMAX_M31_FLASH_PREVIEW]: MINIMAX_M31_DEFAULT_REASONING_EFFORT },
1055
+ modelReasoningEfforts: { "MiniMax-M3": MINIMAX_M3_REASONING_EFFORTS, [MINIMAX_M31_FLASH]: MINIMAX_M31_REASONING_EFFORTS },
1056
+ modelDefaultReasoningEfforts: { "MiniMax-M3": "medium", [MINIMAX_M31_FLASH]: MINIMAX_M31_DEFAULT_REASONING_EFFORT },
1048
1057
  modelReasoningEffortMap: { "MiniMax-M3": MINIMAX_M3_REASONING_EFFORT_MAP },
1049
1058
  preserveReasoningContentModels: MINIMAX_MODELS,
1050
1059
  // MiniMax-M3 low effort maps to thinking disabled, so a legitimate tool
1051
1060
  // round can carry no reasoning at all; only replay real recorded text,
1052
1061
  // never a fabricated placeholder (chatgpt-codex-connector P2 on #1205).
1053
1062
  requiresReasoningPlaceholderModels: [],
1054
- // M3.1-Flash-Preview ignores reasoning_split and always answers with reasoning_content,
1063
+ // M3.1-Flash ignores reasoning_split and always answers with reasoning_content,
1055
1064
  // so it stays off the split/details lists and replays as a reasoning_content string.
1056
1065
  reasoningSplitModels: MINIMAX_REASONING_SPLIT_MODELS,
1057
1066
  // With reasoning_split the upstream returns thinking as a structured
@@ -1066,11 +1075,11 @@ export const PROVIDER_REGISTRY_EXTENDED: readonly ProviderRegistryEntry[] = [
1066
1075
  },
1067
1076
  {
1068
1077
  id: "minimax-cn", label: "MiniMax — Coding Plan (CN)", baseUrl: "https://api.minimaxi.com/v1", adapter: "openai-chat", authKind: "key",
1069
- dashboardUrl: "https://platform.minimaxi.com", defaultModel: "MiniMax-M3", models: MINIMAX_MODELS,
1078
+ dashboardUrl: "https://platform.minimaxi.com", defaultModel: MINIMAX_M31_FLASH, models: MINIMAX_MODELS,
1070
1079
  modelContextWindows: MINIMAX_MODEL_CONTEXT_WINDOWS,
1071
1080
  modelInputModalities: MINIMAX_MODEL_INPUT_MODALITIES,
1072
- modelReasoningEfforts: { "MiniMax-M3": MINIMAX_M3_REASONING_EFFORTS, [MINIMAX_M31_FLASH_PREVIEW]: MINIMAX_M31_REASONING_EFFORTS },
1073
- modelDefaultReasoningEfforts: { "MiniMax-M3": "medium", [MINIMAX_M31_FLASH_PREVIEW]: MINIMAX_M31_DEFAULT_REASONING_EFFORT },
1081
+ modelReasoningEfforts: { "MiniMax-M3": MINIMAX_M3_REASONING_EFFORTS, [MINIMAX_M31_FLASH]: MINIMAX_M31_REASONING_EFFORTS },
1082
+ modelDefaultReasoningEfforts: { "MiniMax-M3": "medium", [MINIMAX_M31_FLASH]: MINIMAX_M31_DEFAULT_REASONING_EFFORT },
1074
1083
  modelReasoningEffortMap: { "MiniMax-M3": MINIMAX_M3_REASONING_EFFORT_MAP },
1075
1084
  preserveReasoningContentModels: MINIMAX_MODELS,
1076
1085
  requiresReasoningPlaceholderModels: [],
@@ -1237,10 +1246,11 @@ export const PROVIDER_REGISTRY_EXTENDED: readonly ProviderRegistryEntry[] = [
1237
1246
  liveModels: true,
1238
1247
  preserveCustomDestination: true,
1239
1248
  defaultModel: "gpt-5.6-terra",
1240
- models: ["gpt-5.6-terra"],
1241
- modelContextWindows: { "gpt-5.6-terra": 1_050_000 },
1242
- modelMaxOutputTokens: { "gpt-5.6-terra": 128_000 },
1243
- modelInputModalities: { "gpt-5.6-terra": ["text", "image"] },
1249
+ // 261027 preemptive: GPT-6.1 Terra (OpenAI API limits; TokenLab listing unverified).
1250
+ models: ["gpt-5.6-terra", "gpt-6.1-terra"],
1251
+ modelContextWindows: { "gpt-5.6-terra": 1_050_000, "gpt-6.1-terra": 1_050_000 },
1252
+ modelMaxOutputTokens: { "gpt-5.6-terra": 128_000, "gpt-6.1-terra": 128_000 },
1253
+ modelInputModalities: { "gpt-5.6-terra": ["text", "image"], "gpt-6.1-terra": ["text", "image"] },
1244
1254
  // Per-model wires from `tokenlab.accepted_request_formats` (GET /v1/models/{id}, 2026-09-30).
1245
1255
  // The provider stays on Chat, the released and end-to-end verified path, and every model
1246
1256
  // accepts it. Models that also declare Responses use it for Codex (Responses inbound) only,
@@ -1249,7 +1259,8 @@ export const PROVIDER_REGISTRY_EXTENDED: readonly ProviderRegistryEntry[] = [
1249
1259
  // gemini-3.8-flash declares Chat + Gemini native and stays on Chat. No delivery-policy
1250
1260
  // header is sent: the API key's own policy stays authoritative.
1251
1261
  modelWireDefaults: Object.fromEntries([
1252
- "gpt-6-astra", "gpt-6.1-sol", "gpt-6-sol", "gpt-6-luna", "grok-4.7",
1262
+ // 261027 preemptive: GPT-6.1 Terra (mirrors TokenLab's GPT-6.1 Sol wire).
1263
+ "gpt-6-astra", "gpt-6.1-sol", "gpt-6.1-terra", "gpt-6-sol", "gpt-6-luna", "grok-4.7",
1253
1264
  "deepseek-v4.1-flash", "deepseek-v4-pro", "kimi-k3", "glm-5.3",
1254
1265
  ].map(id => [id, { wire: "openai-responses", inbound: ["responses"] }])),
1255
1266
  modelDiscovery: {
@@ -1280,18 +1291,46 @@ export const PROVIDER_REGISTRY_EXTENDED: readonly ProviderRegistryEntry[] = [
1280
1291
  dashboardUrl: "https://modelflare.dev",
1281
1292
  preserveCustomDestination: true,
1282
1293
  defaultModel: "glm-5.3-flash",
1283
- models: ["glm-5.3-flash", "claude-sonnet-5-5", "gpt-6.1-sol", "deepseek-v4-flash"],
1284
- note: "OpenAI-compatible relay for Claude, GPT, GLM and DeepSeek chat models. The seeded models were verified with chat, streaming and tool calls; deepseek-v4.1-flash is listed upstream but currently answers 503 and is left out. An ordinary key only reaches its own routing group's models; a Smart key reaches all seeded models. Image and video models are not served through this Chat preset. Upstream latency varies widely (a few seconds to about 30 s) with occasional transient 503s.",
1294
+ // 261027 preemptive: GPT-6.1 Terra (mirrors Modelflare's GPT-6.1 Sol seed; provider listing unverified).
1295
+ models: ["glm-5.3-flash", "claude-sonnet-5-5", "gpt-6.1-sol", "gpt-6.1-terra", "deepseek-v4-flash"],
1296
+ note: "OpenAI-compatible relay for Claude, GPT, GLM and DeepSeek chat models. The original four seeded models were verified with chat, streaming and tool calls; GPT-6.1 Terra is a preemptive seed pending provider verification. deepseek-v4.1-flash is listed upstream but currently answers 503 and is left out. An ordinary key only reaches its own routing group's models; a Smart key reaches the verified seeded models. Image and video models are not served through this Chat preset. Upstream latency varies widely (a few seconds to about 30 s) with occasional transient 503s.",
1297
+ },
1298
+ {
1299
+ // AI Stupid Level Smart Router, operated by S.C. Studio Platforms S.R.L. Contract checked
1300
+ // 2026-10-26: https://aistupidlevel.info/router/docs and https://aistupidlevel.info/terms#router.
1301
+ // The router calls the model it picks with the provider keys saved on the user's own ASL
1302
+ // account, so each provider bills the user directly; ASL resells no model access. GET /v1/models
1303
+ // answers 401 without a valid key, so the default discovery URL doubles as key validation. The
1304
+ // router's /v1/messages is a plain Anthropic passthrough with no routing, so every inbound,
1305
+ // Claude Code included, stays on Chat. The env reference derived from the id is
1306
+ // ${AISTUPIDLEVEL_API_KEY}.
1307
+ id: "aistupidlevel",
1308
+ label: "AI Stupid Level",
1309
+ adapter: "openai-chat",
1310
+ baseUrl: "https://aistupidlevel.info/v1",
1311
+ authKind: "key",
1312
+ dashboardUrl: "https://aistupidlevel.info/router/keys",
1313
+ liveModels: true,
1314
+ preserveCustomDestination: true,
1315
+ defaultModel: "auto-coding",
1316
+ models: AISTUPIDLEVEL_ROUTING_MODES,
1317
+ modelContextWindows: AISTUPIDLEVEL_MODEL_CONTEXT_WINDOWS,
1318
+ modelMaxOutputTokens: AISTUPIDLEVEL_MODEL_MAX_OUTPUT_TOKENS,
1319
+ modelInputModalities: AISTUPIDLEVEL_MODEL_INPUT_MODALITIES,
1320
+ // Text only for every id, including the pinned models live discovery adds: the router
1321
+ // answers an image, audio or file part with 400 `unsupported_content`.
1322
+ inputModalities: ["text"],
1323
+ note: "Smart Router that sends each request to a model chosen from AI Stupid Level's benchmarks, using the provider keys saved on your AI Stupid Level account (OpenAI, Anthropic, Google, DeepSeek, Kimi, GLM), so each provider bills you directly with no markup. Routing modes: auto-coding (the default), auto-tooling, auto-reasoning, auto-best, plus value and speed modes. A real model id from the live list, such as claude-opus-5-5, pins one model. The X-AISM-Model response header names the model that answered. Text only.",
1285
1324
  },
1286
1325
  // Xiaomi retires mimo-v2.5 and mimo-v2.5-pro on 2026-10-21 with no redirect
1287
1326
  // (https://mimo.mi.com/docs/en-US/updates/deprecate), so the first-party presets default to V2.6.
1288
1327
  // Saved defaults are not rewritten; V2.5 stays listed until it stops answering.
1289
1328
  // Both first-party presets read the xiaomi metadata bundle for window, output, modalities and price.
1290
- { id: "xiaomi", label: "Xiaomi MiMo", baseUrl: "https://api.xiaomimimo.com/anthropic", adapter: "anthropic", authKind: "key", dashboardUrl: "https://xiaomimimo.com", defaultModel: "mimo-v2.6-pro", models: ["mimo-v2.6-pro", "mimo-v2.6-flash", "mimo-v2.6-pro-ultraspeed", "mimo-v2.5-pro", "mimo-v2.5"], jawcodeBundle: "xiaomi" },
1329
+ { id: "xiaomi", label: "Xiaomi MiMo", baseUrl: "https://api.xiaomimimo.com/anthropic", adapter: "anthropic", authKind: "key", dashboardUrl: "https://xiaomimimo.com", defaultModel: "mimo-v2.6-pro", models: ["mimo-v2.6-pro", "mimo-v2.6-flash", "mimo-v2.6-pro-ultraspeed", "mimo-v2.5-pro", "mimo-v2.5"], jawcodeBundle: "xiaomi", modelCapabilities: MIMO_THINKING_CAPABILITIES, thinkingToggleModels: [...MIMO_THINKING_MODELS] },
1291
1330
  // Xiaomi's public OpenAI-compatible endpoint is a distinct transport from both the Anthropic
1292
1331
  // preset above and the paid token-plan host below. Keep a separate fixed-destination contract
1293
- // so existing custom providers are never retargeted while the official route receives the
1294
- // strict reasoning ladder its validator enforces (#1483).
1332
+ // so existing custom providers are never retargeted. V2.6 uses the documented thinking
1333
+ // toggle; older models retain the reasoning ladder validated in #1483.
1295
1334
  {
1296
1335
  id: "xiaomi-mimo",
1297
1336
  label: "Xiaomi MiMo (OpenAI Chat)",
@@ -1301,11 +1340,13 @@ export const PROVIDER_REGISTRY_EXTENDED: readonly ProviderRegistryEntry[] = [
1301
1340
  dashboardUrl: "https://platform.xiaomimimo.com/console/balance",
1302
1341
  defaultModel: "mimo-v2.6-flash",
1303
1342
  models: ["mimo-v2.6-flash", "mimo-v2.6-pro", "mimo-v2.6-pro-ultraspeed", "mimo-v2.5"],
1343
+ modelCapabilities: MIMO_THINKING_CAPABILITIES,
1344
+ thinkingToggleModels: [...MIMO_THINKING_MODELS],
1304
1345
  jawcodeBundle: "xiaomi",
1305
1346
  reasoningEfforts: ["low", "medium", "high"],
1306
1347
  reasoningEffortMap: { xhigh: "high", max: "high", ultra: "high" },
1307
1348
  preserveCustomDestination: true,
1308
- note: "Official Xiaomi MiMo OpenAI-compatible Chat endpoint. The upstream validator accepts reasoning_effort none/low/medium/high; higher Codex tiers are clamped to high.",
1349
+ note: "Official Xiaomi MiMo OpenAI-compatible Chat endpoint. V2.6 thinking is on/off: none disables it; high is the client-compatible on value, not a distinct reasoning strength. Older models retain their existing effort contract.",
1309
1350
  },
1310
1351
  { id: "kilo", label: "Kilo", baseUrl: "https://api.kilo.ai/api/gateway", adapter: "openai-chat", authKind: "key", dashboardUrl: "https://kilo.ai" },
1311
1352
  {
@@ -1414,7 +1455,7 @@ export const PROVIDER_REGISTRY_EXTENDED: readonly ProviderRegistryEntry[] = [
1414
1455
  featured: false,
1415
1456
  dashboardUrl: "https://github.com/settings/copilot",
1416
1457
  liveModels: true,
1417
- models: ["gpt-4o", "gpt-4.1", "gpt-4.1-mini", "claude-sonnet-4", "gemini-2.5-pro", "gpt-5-mini", "gpt-5.3-codex", "gpt-5.4", "gpt-5.4-mini", "gpt-5.5", "gpt-5.6-luna", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-6.1-sol", "gpt-6-sol", "gpt-6-luna"],
1458
+ models: ["gpt-4o", "gpt-4.1", "gpt-4.1-mini", "claude-sonnet-4", "gemini-2.5-pro", "gpt-5-mini", "gpt-5.3-codex", "gpt-5.4", "gpt-5.4-mini", "gpt-5.5", "gpt-5.6-luna", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-6.1-sol", "gpt-6.1-terra", "gpt-6-sol", "gpt-6-luna"],
1418
1459
  defaultModel: "gpt-4o",
1419
1460
  // Copilot fronts a mixed-wire catalog: these models reject /chat/completions for
1420
1461
  // real Codex-agent traffic (function tools + reasoning), so every inbound wire
@@ -1436,6 +1477,8 @@ export const PROVIDER_REGISTRY_EXTENDED: readonly ProviderRegistryEntry[] = [
1436
1477
  "gpt-6-luna": "openai-responses",
1437
1478
  // GPT-6.1 Sol: GA in Copilot 2026-09-29 (github.blog changelog); rides Responses like GPT-6 Sol.
1438
1479
  "gpt-6.1-sol": "openai-responses",
1480
+ // GPT-6.1 Terra: GA in Copilot 2026-10-26; rides Responses like GPT-6.1 Sol.
1481
+ "gpt-6.1-terra": "openai-responses",
1439
1482
  "grok-4.5": "openai-responses",
1440
1483
  "grok-4.6": "openai-responses",
1441
1484
  "mai-code-1.1-flash": "openai-responses",
@@ -99,6 +99,8 @@ export const REGISTRY_FIELD_MODEL_ID_ROLES = {
99
99
  modelContextWindows: RECORD_KEYS,
100
100
  modelDisplayNames: RECORD_KEYS,
101
101
  modelInputModalities: RECORD_KEYS,
102
+ inputModalities: NONE,
103
+ modelCapabilities: RECORD_KEYS,
102
104
  defaultMaxOutputTokens: NONE,
103
105
  modelMaxOutputTokens: RECORD_KEYS,
104
106
  reasoningEfforts: NONE,
@@ -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
@@ -753,6 +754,12 @@ export const ALIBABA_TOKEN_PLAN_PRESERVE_REASONING = [
753
754
  export const KIMI_K3_STANDARD_CONTEXT_WINDOW = 262_144;
754
755
  export const KIMI_K3_1M_CONTEXT_WINDOW = 1_048_576;
755
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"];
756
763
  // 260921 Kimi K2.8: `kimi-for-coding` is the stable subscription alias Moonshot re-points
757
764
  // at each coding release. Live GET /coding/v1/models lists only kimi-for-coding[-highspeed],
758
765
  // k3, k3-256k — the k2.x ids are retired from the subscription endpoint. Since K2.8 Preview
@@ -761,10 +768,27 @@ export const KIMI_CODING_K3_MODELS = ["k3", "k3[1m]", "k3-256k"];
761
768
  // with "model token limit: 1048576" beyond that.
762
769
  // Evidence: https://www.kimi.com/code/docs/en/kimi-code/models.html
763
770
  export const KIMI_CODING_K28_MODELS = ["kimi-for-coding"];
764
- 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];
765
772
  export const KIMI_CODING_ADJUSTABLE_THINKING_MODELS = [...KIMI_CODING_LIVE_MODELS];
766
773
  export const KIMI_LEGACY_API_MODELS = ["kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6", "kimi-k2.5"];
767
- 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"];
768
792
  // Every kimi coding preset record - picker, context windows, locked-parameter lists -
769
793
  // derives from the live ids only. seeding a retired id in a metadata list would re-arm
770
794
  // the model-rename migration on every boot (#5066): the list holds the retired id but
@@ -773,7 +797,7 @@ export const KIMI_API_MODELS = ["kimi-k3", ...KIMI_LEGACY_API_MODELS];
773
797
  // repairs saved rows still naming them.
774
798
  export const KIMI_THINKING_MODELS = KIMI_CODING_LIVE_MODELS;
775
799
  export const KIMI_CODING_NO_REASONING_MODELS = KIMI_CODING_LIVE_MODELS.filter(id => !KIMI_CODING_ADJUSTABLE_THINKING_MODELS.includes(id));
776
- 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));
777
801
  export const KIMI_CODING_K3_REASONING_EFFORTS = ["low", "high", "max"];
778
802
  export const KIMI_CODING_K3_REASONING_EFFORT_MAP: Record<string, string> = {
779
803
  none: "none",
@@ -792,15 +816,33 @@ export const KIMI_CODING_DEFAULT_REASONING_EFFORTS = Object.fromEntries(
792
816
  export const KIMI_CODING_REASONING_EFFORT_MAPS = Object.fromEntries(
793
817
  KIMI_CODING_ADJUSTABLE_THINKING_MODELS.map(id => [id, KIMI_CODING_K3_REASONING_EFFORT_MAP]),
794
818
  );
819
+ // kimi-k3 keeps its launch-time max-only list; K3.1 Pro gets the documented low/high/max ladder.
795
820
  export const KIMI_API_REASONING_EFFORTS = Object.fromEntries(
796
- 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]),
797
837
  );
798
838
  export const KIMI_LOCKED_PARAMETER_MODELS = KIMI_CODING_LIVE_MODELS;
799
839
  export const KIMI_AUTO_TOOL_CHOICE_ONLY_MODELS = ["kimi-for-coding"];
800
840
  export const KIMI_API_MODEL_CONTEXT_WINDOWS: Record<string, number> = Object.fromEntries(
801
- 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"]]),
802
845
  );
803
- export const KIMI_API_MODEL_INPUT_MODALITIES = { "kimi-k3": ["text", "image"] };
804
846
 
805
847
  // 260715 NVIDIA NIM kimi family (issue #126): documented served ids on integrate
806
848
  // chat/completions per docs.api.nvidia.com/nim/reference/llm-apis; live /v1/models
@@ -884,7 +926,7 @@ export const NVIDIA_NIM_NO_VISION_MODELS = [
884
926
  "poolside/laguna-xs-2.1", "z-ai/glm-5.3", "z-ai/glm-5.2",
885
927
  ];
886
928
  export const KIMI_CODING_MODEL_CONTEXT_WINDOWS: Record<string, number> = Object.fromEntries(
887
- 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]),
888
930
  );
889
931
  export const KIMI_CODING_MODEL_INPUT_MODALITIES = Object.fromEntries(
890
932
  KIMI_CODING_ADJUSTABLE_THINKING_MODELS.map(id => [id, ["text", "image"]]),
@@ -948,6 +990,8 @@ export const DIGITALOCEAN_CHAT_COMPLETION_MODELS = [
948
990
  "arcee-trinity-large-thinking",
949
991
  "openai-gpt-5.6-sol",
950
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",
951
995
  "openai-gpt-5.6-luna",
952
996
  // 260923 preemptive: GPT-6 Sol/Luna ahead of DigitalOcean's model list.
953
997
  "openai-gpt-6-sol",
@@ -1165,6 +1209,27 @@ export const OPPER_MODEL_INPUT_MODALITIES: Record<string, string[]> = Object.fro
1165
1209
  OPPER_MODELS.map(id => [id, OPPER_TEXT_ONLY_MODELS.includes(id) ? ["text"] : ["text", "image"]]),
1166
1210
  );
1167
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
+
1168
1233
  export const STEPFUN_MODELS = [
1169
1234
  "step-5-preview",
1170
1235
  "step-3.5-flash",
@@ -318,6 +318,15 @@ export interface ProviderRegistryEntry {
318
318
  */
319
319
  modelDisplayNames?: Record<string, string>;
320
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"];
321
330
  defaultMaxOutputTokens?: number;
322
331
  modelMaxOutputTokens?: Record<string, number>;
323
332
  reasoningEfforts?: string[];
@@ -396,7 +405,7 @@ export type ProviderConfigSeed = Pick<
396
405
  "anthropicOAuthInstance" |
397
406
  "adapter" | "baseUrl" | "apiKeyTransport" | "responsesPath" | "chatCompletionsPath" | "authMode" | "keyOptional" | "freeTier" | "modelSuffixBracketStrip" | "defaultModel" | "models"
398
407
  | "liveModels" | "contextWindow" | "modelContextWindows" | "modelInputModalities"
399
- | "modelDisplayNames"
408
+ | "modelDisplayNames" | "modelCapabilities"
400
409
  | "modelMaxInputTokens" | "defaultMaxOutputTokens" | "modelMaxOutputTokens"
401
410
  | "reasoningEfforts" | "modelReasoningEfforts" | "modelDefaultReasoningEfforts" | "reasoningEffortMap" | "modelReasoningEffortMap" | "reasoningWireFormat"
402
411
  | "noVisionModels" | "noReasoningModels" | "noTemperatureModels" | "noTopPModels" | "noStopModels" | "noPenaltyModels"
@@ -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";
@@ -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[];
@@ -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])
@@ -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 {
@@ -122,8 +122,11 @@ export function routedProviderConfig(providerName: string, provider: OcxProvider
122
122
  // the reasoning item the upstream answers 400 to. Destination matching refuses templated and
123
123
  // overridable base URLs, so this cannot follow a retargeted row, and an explicit value wins.
124
124
  const destination = registryEntryForProviderDestination(provider);
125
+ const inputModalities = provider.inputModalities === undefined
126
+ ? registryInputModalitiesForDestination(providerName, provider) : undefined;
125
127
  return {
126
128
  ...provider,
129
+ ...(inputModalities ? { inputModalities } : {}),
127
130
  apiKey: usableResolvedApiKey(provider.apiKey),
128
131
  ...(destination?.modelDefaultReasoningEfforts ? {
129
132
  modelDefaultReasoningEfforts: mapFill(destination.modelDefaultReasoningEfforts, provider.modelDefaultReasoningEfforts)[0],
@@ -298,6 +301,11 @@ export function routedProviderConfig(providerName: string, provider: OcxProvider
298
301
  ...(provider.project === undefined && registryEntry.project !== undefined ? { project: registryEntry.project } : {}),
299
302
  ...(provider.location === undefined && registryEntry.location !== undefined ? { location: registryEntry.location } : {}),
300
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
+ : {}),
301
309
  ...((provider.reasoningEfforts === undefined || hasLegacyClinePassReasoningEfforts(providerName, provider))
302
310
  && registryEntry.reasoningEfforts !== undefined
303
311
  ? { reasoningEfforts: [...registryEntry.reasoningEfforts] }