Commit c2f77db
authored
feat: Add Xiaomi MiMo as a first-class API provider (#81)
* FEATURE: Add Xiaomi MiMo as a first-class API provider
- New MimoHandler with reasoning_content passthrough for multi-turn tool calling
- Custom message conversion preserving MiMo's interleaved thinking chain
- Strip OpenAI-specific extensions (strict, additionalProperties) from tool schemas
- Models: mimo-v2.5-pro, mimo-v2.5, mimo-v2-flash with official pricing
- UI settings with 4 base URL options (3 Token Plan regions + Pay-as-you-go)
- Full wiring: types, schema, model picker, i18n, provider config
* Update openrouter.ts
* Preserve Mimo reasoning fields & switch AMS endpoint
Update Mimo provider config and UI to use the token-plan-ams endpoint instead of the old FRA host. Allow Mimo assistant messages with string content to include and preserve a reasoning_content field when present. Also avoid attaching mapped reasoning_details when converting messages for Mimo models (skip mapping if modelId matches /mimo/i) to preserve the provider's original shape. Types, API handler, transform logic, and the settings UI were updated to keep Mimo-specific reasoning data intact and align the endpoint selection.
* Add MiMo i18n translations to all 17 locales and unit tests
Also hide the "not sure which model" hint for the MiMo provider
since it's a static model list, not fetched dynamically.
* Address CodeRabbit review feedback
Fix Japanese translation consistency, strengthen base URL tests to
verify actual values, and add ModelPicker test for MiMo hint hiding.
* Expand MiMo test coverage and remove dev/null files from PR
Added tests for tool_call_partial streaming, cache token usage,
API error handling, message conversion pipeline, empty delta chunks,
and tools parameter presence/absence. Removed dev/null/ hook files
that were accidentally included in the branch.
* Use data-testid for automaticFetch hint instead of i18n key matching
* Remove mimo-v2-flash model that no longer supports thinking mode
* Replace mimo-v2-flash with mimo-v2-pro model
* Drop mimo-v2-flash since it doesn't support thinking mode
* Address maintainer feedback: revert unrelated changes, add i18n, fix stream_options
* Update doc links to use puter developer URLs
* Fix i18n: JP spacing, FR translations, add multimodal support to message conversion
* Add docstrings and document mimo-v2-flash exclusion rationale
* Address edelauna review: sanitize tool IDs, use handleProviderError, fix prompt cache, clean up comments
* Fold text into last tool message to preserve reasoning continuity
* Refactor: use shared convertToR1Format, processToolCalls, cleanup unused imports/props
* Remove dead temperature param, add 2-tier pricing, clarify strict stripping
* Remove strict/additionalProperties stripping — proxy no longer rejects it
* Use longContextPricing instead of tiers for cost calculation
* Remove stale convertToolsForOpenAI tests (stripping removed)1 parent 7245680 commit c2f77db
35 files changed
Lines changed: 1216 additions & 6 deletions
File tree
- packages/types/src
- providers
- src/api
- providers
- __tests__
- transform
- webview-ui/src
- components
- settings
- __tests__
- providers
- utils
- ui/hooks
- i18n/locales
- ca
- de
- en
- es
- fr
- hi
- id
- it
- ja
- ko
- nl
- pl
- pt-BR
- ru
- tr
- vi
- zh-CN
- zh-TW
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| 125 | + | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
| |||
334 | 336 | | |
335 | 337 | | |
336 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
337 | 351 | | |
338 | 352 | | |
339 | 353 | | |
| |||
417 | 431 | | |
418 | 432 | | |
419 | 433 | | |
| 434 | + | |
420 | 435 | | |
421 | 436 | | |
422 | 437 | | |
| |||
451 | 466 | | |
452 | 467 | | |
453 | 468 | | |
| 469 | + | |
454 | 470 | | |
455 | 471 | | |
456 | 472 | | |
| |||
525 | 541 | | |
526 | 542 | | |
527 | 543 | | |
| 544 | + | |
528 | 545 | | |
529 | 546 | | |
530 | 547 | | |
| |||
617 | 634 | | |
618 | 635 | | |
619 | 636 | | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
620 | 642 | | |
621 | 643 | | |
622 | 644 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| 90 | + | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| 171 | + | |
| 172 | + | |
170 | 173 | | |
171 | 174 | | |
172 | 175 | | |
| |||
0 commit comments