Skip to content

Upstream/feature/add xiaomi mimo#81

Open
capitanfeeder wants to merge 3 commits into
Zoo-Code-Org:mainfrom
capitanfeeder:upstream/feature/add-xiaomi-mimo
Open

Upstream/feature/add xiaomi mimo#81
capitanfeeder wants to merge 3 commits into
Zoo-Code-Org:mainfrom
capitanfeeder:upstream/feature/add-xiaomi-mimo

Conversation

@capitanfeeder
Copy link
Copy Markdown

@capitanfeeder capitanfeeder commented May 13, 2026

Related GitHub Issue

Closes: #80

Description

Add Xiaomi MiMo as a first-class API provider with full multi-turn tool calling support.

MiMo's API requires reasoning_content to be echoed back in assistant messages during tool calling conversations. Without this, the API returns 400 "Param Incorrect". The existing message conversion (convertToOpenAiMessages) was dropping reasoning content blocks entirely, and the base tool schema conversion was adding OpenAI-specific extensions (strict: true, additionalProperties: false) that MiMo's proxy rejects.

Key implementation details:

  • MimoHandler (src/api/providers/mimo.ts): Extends OpenAiHandler with custom convertMessagesForMiMo() that extracts type: "reasoning" content blocks from Anthropic format and maps them to reasoning_content in OpenAI assistant messages. Overrides convertToolsForOpenAI() to strip strict and additionalProperties from tool schemas. Sends thinking: { type: "enabled" } via extra_body.
  • Model definitions (packages/types/src/providers/mimo.ts): mimo-v2.5-pro, mimo-v2.5, mimo-v2-flash with official pricing, correct context windows (1M/1M/256K), and max output tokens (131K/131K/65K).
  • UI settings (webview-ui/src/components/settings/providers/Mimo.tsx): Base URL dropdown with 4 options (3 Token Plan regions + Pay-as-you-go), API key input.
  • Full provider wiring: types schema, provider name registration, model picker, i18n keys, provider config, useSelectedModel hook.
  • Also fixed a pre-existing type error in openrouter.ts where convertToOpenAiMessages was called with 3 arguments instead of 2.

Previously this provider could be used via the "OpenAI Compatible" option with the base URL https://token-plan-sgp.xiaomimimo.com/v1, but it broke because MiMo's proxy rejects OpenAI-specific extensions that Roo Code sends by default. This PR adds MiMo as a dedicated provider that handles all these compatibility issues.

Test Procedure

  • Built the extension with pnpm build (web-evals failure is pre-existing and unrelated)
  • Type checks pass: tsc --noEmit for types, src, and webview-ui packages with zero new errors
  • 1228 of 1235 tests pass; 1 pre-existing timeout failure in SettingsView TTS test (unrelated)
  • Manual testing: configured MiMo provider in Roo Code settings, sent multi-turn conversations with tool calls (read_file, list_files), verified reasoning_content is preserved in history and tool calling works end to end

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A - Provider settings UI follows existing patterns (Moonshot, MiniMax). The MiMo settings tab shows a base URL dropdown with 4 regions and an API key input field.

Documentation Updates

  • No documentation updates are required.

Additional Notes

This provider is critical for users in regions where access to Western AI providers is limited. MiMo V2.5 Pro offers competitive performance with 1M context window at $1.00/M input pricing, making it a cost-effective alternative.

Get in Touch

gabrielsosa_

Summary by CodeRabbit

  • New Features

    • Added support for Xiaomi MiMo as a new API provider with configurable settings for base URL and API key
    • Integrated Git LFS hooks for repository management
  • Refactor

    • Enhanced message conversion and formatting across providers for improved compatibility
    • Improved model configuration handling

Review Change Stack

- 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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@capitanfeeder has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 35 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8541f310-5d78-47e7-91ca-3f7727d05aa6

📥 Commits

Reviewing files that changed from the base of the PR and between 5764a5b and 2cbe75a.

📒 Files selected for processing (4)
  • packages/types/src/provider-settings.ts
  • src/api/providers/mimo.ts
  • src/api/transform/openai-format.ts
  • webview-ui/src/components/settings/providers/Mimo.tsx
📝 Walkthrough

Walkthrough

This PR integrates Xiaomi MiMo as a new LLM provider by adding model metadata, extending provider schemas, implementing an OpenAI-compatible handler that adapts MiMo's requirements, and providing frontend settings UI. The change includes wiring message conversion to be model-aware and updating existing OpenAI-compatible providers to pass model context.

Changes

Xiaomi MiMo Provider Integration

Layer / File(s) Summary
Git LFS Hook Infrastructure
dev/null/post-checkout, dev/null/post-commit, dev/null/post-merge, dev/null/pre-push
Four shell hook scripts validate git-lfs availability and exit with status code 2 when missing.
MiMo Provider Model Catalog
packages/types/src/providers/mimo.ts
Defines three MiMo models (v2.5-pro, v2.5, v2-flash) with context windows, token limits, feature support flags, and pricing; exports MimoModelId type, mimoDefaultModelId, and MIMO_DEFAULT_TEMPERATURE constant.
Provider Settings Schema Extension
packages/types/src/provider-settings.ts, packages/types/src/providers/index.ts
Registers mimo in providerNames, introduces mimoSchema with baseUrl endpoint validation and optional apiKey, wires mimo into discriminated and flat provider schemas, updates modelIdKeysByProvider and MODELS_BY_PROVIDER mappings, and adds getProviderDefaultModelId case for mimo.
Message Conversion Infrastructure for Model-Aware Behavior
src/api/transform/openai-format.ts, src/api/providers/base-openai-compatible-provider.ts
Adds optional modelId to ConvertToOpenAiMessagesOptions, implements conditional reasoning_details exclusion for MiMo models, and reformats OpenAI-compatible streaming/completion messages into explicit multi-line arrays.
MiMo Handler Implementation
src/api/providers/mimo.ts
Implements MimoHandler extending OpenAiHandler with constructor wiring of defaults, model resolution via getModel(), tool schema adaptation (stripping OpenAI-specific additionalProperties), Anthropic-to-MiMo message conversion with reasoning block extraction, and streaming createMessage yielding text/reasoning/tool events with computed usage and costs.
API Handler Factory Wiring
src/api/index.ts, src/api/providers/index.ts, src/api/providers/{openai,lite-llm,lm-studio,openrouter,qwen-code,requesty,roo}.ts
Wires MimoHandler into buildApiHandler and exports; updates seven OpenAI-compatible providers to pass modelId into convertToOpenAiMessages for model-aware message transformation.
Frontend Settings UI Component
webview-ui/src/components/settings/providers/Mimo.tsx, webview-ui/src/components/settings/providers/index.ts, webview-ui/src/i18n/locales/en/settings.json
Implements Mimo React component with baseUrl dropdown and apiKey password field, exports from provider components, and adds i18n translations for MiMo UI labels and help text.
Frontend Provider Configuration and Integration
webview-ui/src/components/settings/{constants.ts,ApiOptions.tsx}, webview-ui/src/components/settings/utils/providerModelConfig.ts, webview-ui/src/components/ui/hooks/useSelectedModel.ts
Registers MiMo in PROVIDERS and MODELS_BY_PROVIDER constants, configures service metadata and default model ID, wires provider-change defaulting logic in ApiOptions, and adds model selection logic in useSelectedModel hook.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A rabbit hops through provider skies,
MiMo's models in our eyes—
Reasoning blooms, tools adapt with grace,
UI fields find their place.
🐰✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title "Upstream/feature/add xiaomi mimo" uses vague naming conventions (Upstream/feature prefix) that don't clearly convey the main change to someone unfamiliar with the repository's branching strategy. Revise the title to be more descriptive and independent of branch naming, e.g., "Add Xiaomi MiMo as first-class API provider with tool calling support".
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description is comprehensive and well-structured, covering all required template sections including issue linkage, detailed implementation notes, test procedures, and pre-submission checklist completion.
Linked Issues check ✅ Passed All coding objectives from issue #80 are met: MiMo models added with correct specs, API compatibility ensured, OpenAI-specific extensions removed from tool schemas, reasoning_content preserved in assistant messages, and UI configuration provided.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing MiMo provider support and fixing a pre-existing bug in openrouter.ts message conversion, with no unrelated alterations detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
dev/null/post-merge (1)

1-4: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Confusing directory name: dev/null/ resembles the Unix special file.

The path dev/null/ is easily confused with the Unix special file /dev/null. Consider renaming the directory to something clearer like git-hooks/, hooks-template/, or scripts/git-lfs-hooks/.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@dev/null/post-merge` around lines 1 - 4, The repository includes a hook
script named post-merge stored under a confusing directory named dev/null;
rename that directory to a clear name like git-hooks or hooks-template and move
the post-merge script there, then update any configuration or references that
point to dev/null (e.g., custom core.hookspath settings, CI config, or
documentation) so they point to the new directory; ensure the script file
retains executable permissions and that the script content (the post-merge hook
invoking git lfs) remains unchanged and continues to work under the new
location.
dev/null/post-commit (1)

1-4: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Confusing directory name: dev/null/ resembles the Unix special file.

The path dev/null/ is easily confused with the Unix special file /dev/null. Consider renaming the directory to something clearer like git-hooks/, hooks-template/, or scripts/git-lfs-hooks/.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@dev/null/post-commit` around lines 1 - 4, The directory name "dev/null" is
confusing because it resembles the Unix special file; rename the directory to a
clearer name (e.g., "git-hooks", "hooks-template", or "scripts/git-lfs-hooks"),
move the "post-commit" hook into that new directory, update any references to
"dev/null/post-commit" (search the repo, CI configs, and documentation) and
ensure the file keeps its executable bit and the repository's core.hookspath (if
set) points to the new directory so git-lfs post-commit continues to run.
dev/null/post-checkout (1)

1-4: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Confusing directory name: dev/null/ resembles the Unix special file.

The path dev/null/ is easily confused with the Unix special file /dev/null. If these are hook templates or source files to be installed elsewhere, consider renaming the directory to something clearer like git-hooks/, hooks-template/, or scripts/git-lfs-hooks/.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@dev/null/post-checkout` around lines 1 - 4, The directory name "dev/null" is
confusing and should be renamed; move or rename the hook file "post-checkout"
out of the misleading dev/null folder to a clearer directory such as "git-hooks"
or "hooks-template" and update any references/installation scripts that point to
"dev/null/post-checkout" so they point to the new location, ensuring the shebang
and the "git lfs post-checkout \"$@\"" invocation remain unchanged in the moved
"post-checkout" file.
dev/null/pre-push (1)

1-4: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Confusing directory name: dev/null/ resembles the Unix special file.

The path dev/null/ is easily confused with the Unix special file /dev/null. Consider renaming the directory to something clearer like git-hooks/, hooks-template/, or scripts/git-lfs-hooks/.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@dev/null/pre-push` around lines 1 - 4, The directory name "dev/null/" is
confusing; rename the directory containing the pre-push hook (currently shown as
dev/null/pre-push) to a clear, descriptive name such as git-hooks,
hooks-template, or scripts/git-lfs-hooks, update any references to that path
(e.g., where you set core.hookspath or any scripts/installers that copy or
reference the pre-push file), keep the pre-push file contents and executable bit
unchanged, and verify hooks still run (or update core.hookspath) after the
rename.
🧹 Nitpick comments (4)
dev/null/post-merge (1)

2-2: 💤 Low value

Very long line impairs readability.

Line 2 exceeds 280 characters. Consider breaking the error message and logic into multiple lines for maintainability.

♻️ Suggested refactor
-command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-merge' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
+if ! command -v git-lfs >/dev/null 2>&1; then
+  printf >&2 "\n%s\n\n" \
+    "This repository is configured for Git LFS but 'git-lfs' was not found on your path. " \
+    "If you no longer wish to use Git LFS, remove this hook by deleting the 'post-merge' " \
+    "file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."
+  exit 2
+fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@dev/null/post-merge` at line 2, The single long printf in the post-merge hook
makes the line >280 chars hard to read; refactor by extracting the multi-line
error text into a readable variable (e.g., MESSAGE) or by splitting the printf
into multiple shorter printf/echo calls and then call exit 2; locate the hook
logic around the "command -v git-lfs" check in the post-merge script and replace
the single huge printf string with a multi-line message variable or multiple
print statements for readability and maintainability.
dev/null/pre-push (1)

2-2: 💤 Low value

Very long line impairs readability.

Line 2 exceeds 280 characters. Consider breaking the error message and logic into multiple lines for maintainability.

♻️ Suggested refactor
-command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
+if ! command -v git-lfs >/dev/null 2>&1; then
+  printf >&2 "\n%s\n\n" \
+    "This repository is configured for Git LFS but 'git-lfs' was not found on your path. " \
+    "If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' " \
+    "file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."
+  exit 2
+fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@dev/null/pre-push` at line 2, The pre-push hook has a single very long printf
call that exceeds 280 chars and hurts readability; refactor the command -v
git-lfs ... || { printf >&2 "..."; exit 2; } by splitting the error message into
multiple concatenated printf calls or using a multi-line here-doc so the message
text is wrapped across lines, keep the same stderr redirection (printf >&2) and
the exit 2 behavior, and preserve the existing check invocation (command -v
git-lfs) so the logic in the pre-push hook remains identical but more
maintainable.
dev/null/post-checkout (1)

2-2: 💤 Low value

Very long line impairs readability.

Line 2 exceeds 280 characters. Consider breaking the error message and logic into multiple lines for maintainability.

♻️ Suggested refactor
-command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-checkout' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
+if ! command -v git-lfs >/dev/null 2>&1; then
+  printf >&2 "\n%s\n\n" \
+    "This repository is configured for Git LFS but 'git-lfs' was not found on your path. " \
+    "If you no longer wish to use Git LFS, remove this hook by deleting the 'post-checkout' " \
+    "file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."
+  exit 2
+fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@dev/null/post-checkout` at line 2, The single long command in the
post-checkout hook reduces readability; refactor the check and message by
converting the one-liner into a clear if-statement that uses either multiple
printf/echo lines or a here-document for the multi-line error message (replace
the inline use of "command -v git-lfs >/dev/null 2>&1 || { ... }" with a
multi-line if ! command -v git-lfs >/dev/null 2>&1; then ... fi), and move the
long message currently passed to printf into separate lines to keep line length
under 280 characters while preserving the exact wording and the exit 2
behaviour.
dev/null/post-commit (1)

2-2: 💤 Low value

Very long line impairs readability.

Line 2 exceeds 280 characters. Consider breaking the error message and logic into multiple lines for maintainability.

♻️ Suggested refactor
-command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-commit' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
+if ! command -v git-lfs >/dev/null 2>&1; then
+  printf >&2 "\n%s\n\n" \
+    "This repository is configured for Git LFS but 'git-lfs' was not found on your path. " \
+    "If you no longer wish to use Git LFS, remove this hook by deleting the 'post-commit' " \
+    "file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."
+  exit 2
+fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@dev/null/post-commit` at line 2, The long single-line hook check using
"command -v git-lfs >/dev/null 2>&1 || { printf >&2 \"...\"; exit 2; }" should
be split for readability: perform the check with "if ! command -v git-lfs
>/dev/null 2>&1; then" then emit a multi-line error via a heredoc or multiple
printf >&2 lines (preserving the original message text), and finish with "exit
2; fi"; update the block around "command -v git-lfs", "printf >&2" and "exit 2"
accordingly so the same behavior remains but the message and logic are on
separate lines.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/api/providers/mimo.ts`:
- Around line 109-193: The loop over anthropicMessages currently only handles
assistant messages when msg.content is an array, so assistant turns with a
string content are dropped; update the branch around "if (msg.role ===
'assistant' && Array.isArray(msg.content))" to also handle "msg.role ===
'assistant' && typeof msg.content === 'string'" by creating an assistantMsg
object (same shape used later) with role: "assistant", content: msg.content, and
ensure we still set reasoning_content and tool_calls when present (or leave them
absent/empty), then push that assistantMsg into converted; reference the
existing loop, assistantMsg variable and converted array to locate where to add
the string-content handling.

In `@src/api/transform/openai-format.ts`:
- Around line 318-320: The MiMo model guard that prevents setting
reasoning_details for MiMo-bound requests is only applied in the assistant
message branch that treats content as a string; update the assistant
array-content branch (the code that sets (baseMessage as any).reasoning_details
when content is an array) to use the same guard: check options?.modelId against
/mimo/i and only assign reasoning_details when not MiMo (i.e., wrap the existing
assignment of (baseMessage as any).reasoning_details = mapped with the same
condition used earlier: mapped && !(options?.modelId &&
/mimo/i.test(options.modelId || "")). This ensures both assistant paths (string
and array content) respect the MiMo exclusion.

In `@webview-ui/src/components/settings/providers/Mimo.tsx`:
- Around line 36-52: Replace the incorrect Europe endpoint value in the Mimo.tsx
provider options: locate the VSCodeOption currently using
"https://token-plan-fra.xiaomimimo.com/v1" (inside the VSCodeDropdown bound to
apiConfiguration.mimoBaseUrl) and change its value to the official AMS region
"https://token-plan-ams.xiaomimimo.com/v1"; optionally update the visible label
(e.g., "Token Plan - Europe" → "Token Plan - Europe (AMS)") to reflect the
region.

---

Outside diff comments:
In `@dev/null/post-checkout`:
- Around line 1-4: The directory name "dev/null" is confusing and should be
renamed; move or rename the hook file "post-checkout" out of the misleading
dev/null folder to a clearer directory such as "git-hooks" or "hooks-template"
and update any references/installation scripts that point to
"dev/null/post-checkout" so they point to the new location, ensuring the shebang
and the "git lfs post-checkout \"$@\"" invocation remain unchanged in the moved
"post-checkout" file.

In `@dev/null/post-commit`:
- Around line 1-4: The directory name "dev/null" is confusing because it
resembles the Unix special file; rename the directory to a clearer name (e.g.,
"git-hooks", "hooks-template", or "scripts/git-lfs-hooks"), move the
"post-commit" hook into that new directory, update any references to
"dev/null/post-commit" (search the repo, CI configs, and documentation) and
ensure the file keeps its executable bit and the repository's core.hookspath (if
set) points to the new directory so git-lfs post-commit continues to run.

In `@dev/null/post-merge`:
- Around line 1-4: The repository includes a hook script named post-merge stored
under a confusing directory named dev/null; rename that directory to a clear
name like git-hooks or hooks-template and move the post-merge script there, then
update any configuration or references that point to dev/null (e.g., custom
core.hookspath settings, CI config, or documentation) so they point to the new
directory; ensure the script file retains executable permissions and that the
script content (the post-merge hook invoking git lfs) remains unchanged and
continues to work under the new location.

In `@dev/null/pre-push`:
- Around line 1-4: The directory name "dev/null/" is confusing; rename the
directory containing the pre-push hook (currently shown as dev/null/pre-push) to
a clear, descriptive name such as git-hooks, hooks-template, or
scripts/git-lfs-hooks, update any references to that path (e.g., where you set
core.hookspath or any scripts/installers that copy or reference the pre-push
file), keep the pre-push file contents and executable bit unchanged, and verify
hooks still run (or update core.hookspath) after the rename.

---

Nitpick comments:
In `@dev/null/post-checkout`:
- Line 2: The single long command in the post-checkout hook reduces readability;
refactor the check and message by converting the one-liner into a clear
if-statement that uses either multiple printf/echo lines or a here-document for
the multi-line error message (replace the inline use of "command -v git-lfs
>/dev/null 2>&1 || { ... }" with a multi-line if ! command -v git-lfs >/dev/null
2>&1; then ... fi), and move the long message currently passed to printf into
separate lines to keep line length under 280 characters while preserving the
exact wording and the exit 2 behaviour.

In `@dev/null/post-commit`:
- Line 2: The long single-line hook check using "command -v git-lfs >/dev/null
2>&1 || { printf >&2 \"...\"; exit 2; }" should be split for readability:
perform the check with "if ! command -v git-lfs >/dev/null 2>&1; then" then emit
a multi-line error via a heredoc or multiple printf >&2 lines (preserving the
original message text), and finish with "exit 2; fi"; update the block around
"command -v git-lfs", "printf >&2" and "exit 2" accordingly so the same behavior
remains but the message and logic are on separate lines.

In `@dev/null/post-merge`:
- Line 2: The single long printf in the post-merge hook makes the line >280
chars hard to read; refactor by extracting the multi-line error text into a
readable variable (e.g., MESSAGE) or by splitting the printf into multiple
shorter printf/echo calls and then call exit 2; locate the hook logic around the
"command -v git-lfs" check in the post-merge script and replace the single huge
printf string with a multi-line message variable or multiple print statements
for readability and maintainability.

In `@dev/null/pre-push`:
- Line 2: The pre-push hook has a single very long printf call that exceeds 280
chars and hurts readability; refactor the command -v git-lfs ... || { printf >&2
"..."; exit 2; } by splitting the error message into multiple concatenated
printf calls or using a multi-line here-doc so the message text is wrapped
across lines, keep the same stderr redirection (printf >&2) and the exit 2
behavior, and preserve the existing check invocation (command -v git-lfs) so the
logic in the pre-push hook remains identical but more maintainable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 28fc3ca6-fd78-47f5-aedc-3adc9597e1d8

📥 Commits

Reviewing files that changed from the base of the PR and between d191fe0 and 5764a5b.

📒 Files selected for processing (26)
  • dev/null/post-checkout
  • dev/null/post-commit
  • dev/null/post-merge
  • dev/null/pre-push
  • packages/types/src/provider-settings.ts
  • packages/types/src/providers/index.ts
  • packages/types/src/providers/mimo.ts
  • src/api/index.ts
  • src/api/providers/base-openai-compatible-provider.ts
  • src/api/providers/index.ts
  • src/api/providers/lite-llm.ts
  • src/api/providers/lm-studio.ts
  • src/api/providers/mimo.ts
  • src/api/providers/openai.ts
  • src/api/providers/openrouter.ts
  • src/api/providers/qwen-code.ts
  • src/api/providers/requesty.ts
  • src/api/providers/roo.ts
  • src/api/transform/openai-format.ts
  • webview-ui/src/components/settings/ApiOptions.tsx
  • webview-ui/src/components/settings/constants.ts
  • webview-ui/src/components/settings/providers/Mimo.tsx
  • webview-ui/src/components/settings/providers/index.ts
  • webview-ui/src/components/settings/utils/providerModelConfig.ts
  • webview-ui/src/components/ui/hooks/useSelectedModel.ts
  • webview-ui/src/i18n/locales/en/settings.json

Comment thread src/api/providers/mimo.ts
Comment thread src/api/transform/openai-format.ts
Comment thread webview-ui/src/components/settings/providers/Mimo.tsx
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Xiaomi MiMo models

1 participant