Skip to content

Add minimax-in-wsl Mini App: run the MiniMax Code agent inside WSL - #212

Open
jeisux92 wants to merge 1 commit into
MiniMax-AI:mainfrom
jeisux92:add-minimax-in-wsl
Open

jeisux92 wants to merge 1 commit into
MiniMax-AI:mainfrom
jeisux92:add-minimax-in-wsl

Conversation

@jeisux92

@jeisux92 jeisux92 commented Dec 5, 2026 •

Copy link
Copy Markdown

Run the MiniMax Code agent inside a WSL distro and watch every turn stream in as a chat. You pick a distro and a working directory, and the app starts a real mcode exec --output-format stream-json inside that distro, rendering the agent's messages, reasoning, tool calls and token usage as they arrive. It can also install the CLI into the distro and start the sign-in flow for you.

Tested environment

  • MiniMax Code 3.1.23 on Windows 11 (arm64), with the package installed from this directory and opened through the Agent.
  • The package declares surface.window, so it needs MiniMax Code 3.1.2 or later.
  • WSL 2 with Ubuntu 24.04.1 (aarch64) and the MiniMax Code CLI 0.8.2 installed inside the distro.

What was tested

  • The status probe read the CLI version, the configured default model and the sign-in state from the distro.
  • The workspace picker listed the detected project directories of the distro.
  • The setup panel offered the official installer when the CLI was missing, and the sign-in flow when it was not authenticated. The installer ran inside the distro and the CLI became usable.
  • The sign-in flow printed the authorization URL and the user code, the request was approved in an external browser, and the state then read as authenticated.
  • Three real agent turns ran end to end and streamed agent messages, reasoning and tool calls (run_code, bash) into the transcript, with token count, duration and model in the footer.
  • A follow-up turn continued the same CLI session and answered from the earlier context.
  • The transcript survived a page reload.
  • A long-running turn was cancelled with the Stop button; the CLI and the tool it had started both stopped, with no orphan process left behind and the stdout pipe released.
  • Browser console: 0 errors. Network: 0 failed, 4xx or 5xx requests during the run.

Not verified

  • macOS and Linux hosts, where wsl.exe does not exist.
  • A distro whose shell is not bash.
  • The China account region.
  • A host that can reach the npm registry from inside the distro. The install path was exercised on a distro whose npm could not reach the registry, so it ran through the installer's fallback that provisions a private Node.js runtime; the ordinary npm path was not exercised.

Check results

  • npm run validate reports plugins/jeisux92/minimax-in-wsl: OK — 0 errors, 0 warnings. This package contributes no remaining warnings; every warning printed by the run belongs to another author's package.
  • npm run check runs validate followed by the repository test suite. On this Windows machine the suite reports 111 pass, 2 fail, 2 skipped. The two failures are files: a symlink inside the package is an error and files: a package root that is itself a symlink is rejected before walking; both fail with EPERM: operation not permitted, symlink while creating a symlink inside the Windows temp directory, which needs a privilege this account does not hold. I confirmed they fail identically on the untouched base commit, with these changes stashed away, and they exercise the plugins/tester/hello-miniapp fixture in a temp directory, so they are pre-existing and unrelated to this package. On a host that can create symlinks they are expected to pass.

Access declared

The package declares no permissions at all: it runs no Host Agent turns, reads no conversations, calls no connector or MCP tools, and uses no microphone, camera, notifications, Host navigation or file-extension handlers, so the plugin details show no switchable grants.

Everything the app does touch stays inside the distro and is listed in the package README under ## Data & access: the CLI's own config and sign-in-state files (only the status field is read, never the tokens), directory names below the distro home and /mnt/c/Users/*, a conversation.json in the Mini App's own data directory, and temporary files under /tmp that are removed when a run ends. The Mini App's own process makes no outbound request; all network access is made by the CLI and by the official installer inside the distro (account.minimax.io, the MiniMax API endpoints, filecdn.minimax.chat, nodejs.org and registry.npmjs.org).

Written by MiniMax-M3.1-Flash

Package

plugins/jeisux92/minimax-in-wsl/ — plugin ID minimax-in-wsl, display name "MiniMax in WSL", category Code. The directory name matches the name in .minimax-plugin/plugin.json, and the ID is not used by any other package in the repository.

.minimax-plugin/plugin.json
LICENSE                                  (MIT, Copyright (c) 2026 jeisux92)
README.md
icon.png
package.json
miniapp/miniapp.json
miniapp/client/app.js
miniapp/client/index.html
miniapp/client/styles.css
miniapp/node/mcode.mjs
miniapp/node/miniapp-api.ts
miniapp/node/server.mjs
miniapp/node/wsl.mjs

The package is self-contained: no build step, no dependencies beyond the Node.js runtime the Client already provides, and no files outside the package directory.

How it works

  • wsl.mjs wraps wsl.exe. Its output is UTF-16LE on this host, so the reader decodes it instead of treating the NUL bytes as text.
  • Every command is passed as an argument array. The prompt and the working directory are base64-encoded into a fixed script that is delivered on standard input to bash -s -- <token>, so user text never reaches a command line and cannot alter the command.
  • mcode.mjs orchestrates the CLI: the status probe, the workspace discovery, the npm health check, the official installer, mcode login --region <region> --no-browser, and the mcode exec runs. The stream-json contract was read from the published @minimax-ai/code-sdk source rather than guessed.
  • server.mjs serves the client over the assigned loopback port and exposes the status, workspace, conversation, install, login, run and cancel routes. The cancel route tracks the run's process group.
  • The CLI is started under setsid, so it leads its own process group. A cancel signals that whole group, which is why a stopped turn does not leave a tool running in the background.
  • The client is a chat surface with a setup panel (distro, directory, permission policy), a transcript that renders agent messages, reasoning and tool calls, and a composer. It follows the repository's client conventions: --mcode-* CSS variables, light and dark themes, and no framework.

Root README tables

One row at the top of the MiniApp table in each root README:

  • README.md: [MiniMax in WSL](plugins/jeisux92/minimax-in-wsl/) | Run the MiniMax Code agent inside WSL: pick a distro and a working directory, then watch every turn stream in as a chat with tool calls, token usage and a working Stop button | [jeisux92](https://github.com/jeisux92)
  • README.zh-CN.md: the same row with the sentence in Chinese.

Sensitive-information review

Every text file in the package was read and scanned for credentials, private endpoints, personal data and real business data. The matches that turned up are all false positives and were kept: internal run identifiers, OAuth field names, and the /mnt/c/Users/* path pattern that the workspace picker searches. There are no API keys, tokens, passwords, private keys, e-mail addresses, phone numbers, real names, absolute local paths, real session records, logs or screenshots in the package. The only personal identifier is the GitHub handle jeisux92, used in the author field and the MIT copyright line.


Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Copy link
Copy Markdown
Collaborator

This pull request can't be merged yet. The directory picker does not match what the README says, and the UI has no way to type a path.

In "Using it" (lines 46 to 50), the README says the picker lists project directories under the distro home and under /mnt/c/Users/* that contain a .git, package.json, pyproject.toml, Cargo.toml, go.mod, or AGENTS.md file. It also says "the list is a convenience, not a limit."

The discovery script in miniapp/node/mcode.mjs (WORKSPACES_SCRIPT, around lines 70 and 73) actually runs find … -maxdepth 2 -mindepth 1 -type d \( -name .git -o -name package.json -o … \) and prints the parent of each matching directory. I ran that same command on a controlled tree:

  • A project that only has a package.json file does not appear.
  • A repository deeper than two levels, such as $HOME/code/repo, does not appear.
  • A directory literally named package.json does make its parent appear.

The page only has <select id="workspace">. There is no field for entering a path. The server would accept an absolute path, but that path cannot be chosen from the UI, so the list is a limit.

Please make discovery match the documented "contains these files" behavior and a useful search depth, or update the README and let the user enter a path that the list missed. Ordinary file-based projects need to be selectable either way.

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.

2 participants