Add MiniMax Code (mcode) to the agents panel and default agent switch - #11367
Open
joshleblanc wants to merge 7 commits into
Open
joshleblanc wants to merge 7 commits into
joshleblanc wants to merge 7 commits into
Conversation
- New omarchy-agent-usage-mcode collector scans ~/.minimax/v2/sessions/ for assistant message transcripts, sums per-day and per-model token counts, and prints the panel record contract (with MCODE_HOME override and a 30-day scan window). - mcode joins the default providers in shell/plugins/agents/manifest.json and gains an assets/mcode.svg mark so the panel can render it. - omarchy-default-agent recognises mcode (and the minimax-code / minimax aliases), installing npm:@minimax-ai/code via mise the same way it installs every other global CLI agent. - omarchy-agent launches mcode via the floating terminal the way it launches every other agent, threading a prompt through as a positional argument when one is supplied. - omarchy-menu.jsonc exposes setup.default.agent.mcode so the menu can pick mcode like any other supported provider. - README + default-agent and menu tests updated to cover the new provider; new agent-usage-mcode-scanner-test.sh covers the collector's happy and edge cases.
added 3 commits
September 11, 2026 18:57
The first pass pointed omarchy-default-agent at npm:@minimax-ai/code
through mise, which installs the binary on PATH but leaves
better-sqlite3 without its optional native binding. mcode's npm
postinstall script verifies the binding and the binary then crashes on
first sqlite touch.
This pass adds bin/omarchy-install-ai-mcode, an installer that:
- installs via 'npm install -g @minimax-ai/code --foreground-scripts
--include=optional --allow-scripts=@minimax-ai/code,better-sqlite3'
-- the same flags the mcode binary itself uses for its self-update
-- so the optional prebuild lands and the postinstall runs;
- writes a marked wrapper at ~/.local/bin/mcode that execs the npm
binary, the same way the user_install check on PATH expects;
- recognises and defers to ~/.minimax-code/bin/mcode, the official
install path, dropping a stale wrapper that would shadow it;
- leaves any foreign wrapper at the slot untouched (--now, --remove,
--owns);
- matches the --check / --now / --owns / --remove contract of
omarchy-install-hermes-cli and omarchy-install-openclaw-cli.
omarchy-default-agent's mcode case now sets agent_installer to the new
script. The default-agent test removes mcode from the mise-loop
expected_agents/expected_packages tables (the loop only exercises
mise-installed agents) and adds assert_launch/assert_bypass lines so
the launcher still covers mcode.
New test/shell.d/agent-usage-mcode-installer-test.sh exercises
--check / --owns / --now / --remove across the fresh-install,
foreign-wrapper, official-install-present, and post-remove cases
(20 assertions).
The collector now probes the platform coding-plan endpoint at /v1/api/openplatform/coding_plan/remains on the openplatform host (platform.minimax.io for en, www.minimaxi.com for cn), picks the first non-media model_remains entry, and emits Session + Weekly rows with fraction percent (0.0-1.0), an ISO resetsAt string, and unlimited: true when status === 3. The panel renders the new fields: limitWindow now passes unlimited through, LimitRow.alarming ignores unlimited windows, and the percent column shows 'Unlimited' instead of '0%'. The record also picks up the same UX signals the other collectors already carry: - scope: 'account' limits are account-wide, so sync merge keeps a single view rather than summing machines - retryAdvised set on transport failure so the shell retries sooner than its regular interval - usageStatusText / authHelpText 'Sign-in expired' on 401/403, 'MiniMax limits unavailable' on transport failure with no cache fallback, otherwise empty
The test stubs urllib.request.urlopen (and urllib.error.HTTPError for 401) and exercises the collector's happy path, unlimited path, media-only fallback, empty / error responses, cn vs en region routing, Authorization header + GET method, --limits-only reuse, scope: 'account' on the record, Sign-in expired on 401, and the connection-error / MiniMax limits unavailable path. Follows the pattern of agent-usage-claude-limits-test.sh: each case runs the collector with a throwaway MCODE_HOME and the test asserts on the JSON record via jq.
Contributor
Author
added 3 commits
September 11, 2026 23:10
The omarchy-install-ai-mcode installer already exists and omarchy-default-agent mcode routes through it when the binary isn't on PATH, so the menu is the missing user-facing discovery surface. Empty icon glyph matches the existing setup.default.agent.mcode entry; a real one can land alongside the mcode.svg hero mark when one is sourced.
Replace the placeholder </> icon with the official MiniMax M-mark. The source SVG had a 300x250 viewBox, which would letterbox inside the panel's square hero slot. Squared it to 300x300 and removed the y-offset from the transform matrix so the mark sits centered with matching top/bottom padding.
The agents panel and the install/default menus now reference U+E90F, the next free slot in the omarchy icon font, which renders the M-mark in monochrome so the menu can pick it up under the active theme's foreground color. The glyph was built from the same artwork used by the agents panel hero mark (shell/plugins/agents/assets/mcode.svg) so the two glyphs stay visually consistent. The source SVG is kept next to the font under default/fonts/omarchy/mcode.svg, matching the convention hermes.svg already uses. - default/fonts/omarchy/omarchy.ttf: +1 glyph at U+E90F, cmap + hmtx + maxp + hhea + post.glyphOrder updated to match. - default/fonts/omarchy/mcode.svg: source SVG for the glyph, kept alongside the font so future maintainers can rebuild it. - default/fonts/omarchy/README.md: documents the new slot. - default/omarchy/omarchy-menu.jsonc: setup.default.agent.mcode and install.ai.mcode now reference U+E90F under iconFont: omarchy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
bin/omarchy-agent-usage-mcodereads mcode's JSONL session transcripts under~/.minimax/v2/sessions/(override withMCODE_HOME), walks every assistant turn, and emits the panel record contract: per-day totals, per-model breakdown (input / output / cacheRead / cacheWrite), today vs. last-week vs. all-time, and an auth-status probe. mcode has no OAuth rate-limit endpoint, so limits are empty and the panel renders the by-day / by-model chart the way it does for every collector without limits.mcodejoinsclaude,codex, andfireworksinshell/plugins/agents/manifest.json, so a fresh install ships with the tab on and the widget self-hides on machines that have never run mcode (the same behaviour the panel already has for every other agent).shell/plugins/agents/assets/mcode.svgso the panel chip, hero, and subscription chip render the agent instead of falling back to the generic bar glyph.omarchy-default-agent mcode(and theminimax-code/minimaxaliases) routes throughbin/omarchy-install-ai-mcode, which installs@minimax-ai/codevia npm with--foreground-scripts --include=optional --allow-scripts=@minimax-ai/code,better-sqlite3(the same flags mcode's binary uses for its self-update) and writes a marked wrapper at~/.local/bin/mcode. The installer defers to an existing~/.minimax-code/bin/mcode(mcode's official install) and drops any stale wrapper that would shadow it.omarchy-agent mcodethen launches mcode the same way it launches every other agent through the floating TUI container, threading the prompt straight in.default/omarchy/omarchy-menu.jsoncexposessetup.default.agent.mcodeso the menu can pick mcode like any other supported provider.mcode, and the MCODE_HOME override is documented alongsideCLAUDE_CONFIG_DIR/CODEX_HOME.agent-usage-mcode-scanner-test.shcovers the collector's no-sessions, auth-present, multi-session totals, cache split, totals-only fallback, user-only ignore, andMCODE_HOMEoverride cases. Newagent-usage-mcode-installer-test.shcovers--check/--owns/--now/--removeacross the fresh-install, foreign-wrapper, official-install-present, and post-remove cases.default-agent-test.shandmenu-test.share extended so the existing launcher and sort-alphabetically loops exercise the new provider.Notes for reviewers
inputas non-cached input andcacheReadseparately (totalTokens = input + output + cacheRead + cacheWrite). The collector therefore does NOT subtract cache from input the way the Claude/Codex collectors do — the test data asserts both halves of the split. Seeagent-usage-mcode-scanner-test.shfor the contract.assets/mcode.svgmark is a generic terminal/code-bracket glyph. A branded mark in the omarchy icon font should followomarchy dev font add mcode <source>peragents/skills/icon-font.md— that workflow is package-owned (omarchy-settingsships the font), so it's a separate concern from this PR.--check/--now/--owns/--removecontract used byomarchy-install-hermes-cliandomarchy-install-openclaw-cli. The reason for an installer rather than amise use -g npm:@minimax-ai/codeline inomarchy-default-agentis that mcode's npm package ships a postinstall that depends onbetter-sqlite3's optional native binding; mise's npm: shorthand drops both--include=optionaland--allow-scripts, so the bare install leaves the binary on PATH but unable to load sqlite on first touch. The installer's npm flags are taken straight from the npm commands embedded in the mcode binary itself, so they should track upstream when those change.joshleblanc/omarchy) since I don't have write access toomacom/omarchydirectly.Testing