Repository navigation
fix(mimo): keep MiMo's login and sessions by injecting the status plugin via MIMOCODE_CONFIG_DIR - #33668
Conversation
…MIMOCODE_HOME MIMOCODE_HOME moves MiMo's data, cache and state too, so an Orca-launched mimo lost the canonical auth.json and failed with 401. MIMOCODE_CONFIG_DIR is an extra config layer: user config, plugins and auth stay where they are. A user's own MIMOCODE_CONFIG_DIR is mirrored, never linked through, and an older build's MIMOCODE_HOME overlay is dropped from nested panes. Fixes #9132 Co-authored-by: BluesYoung-web <[email protected]>
Walkthrough
Priority: Severity of issue fixed: Medium Merge Risk:
|
… files Older builds kept MiMo data under <userData>/mimocode-hooks/shared, so a login made only inside Orca would vanish after the switch. Copy that auth.json into MiMo's normal data dir once (owner-only, never overwriting). Re-mirror a user's MIMOCODE_CONFIG_DIR by manifest so plugin deps MiMo installs in the overlay survive launches, preserve an explicit pane value, and drop inherited MiMo overlay markers like OpenCode's. Co-authored-by: BluesYoung-web <[email protected]>
…e MIMOCODE_HOME Co-authored-by: BluesYoung-web <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ba694618-a559-47d2-8254-ea0423d090b5
Files selected for processing: 26-
src/main/__fixtures__/shell-wrapper-snapshots/daemon-bash-rcfile.txtsrc/main/__fixtures__/shell-wrapper-snapshots/daemon-zsh-zshenv.txtsrc/main/__fixtures__/shell-wrapper-snapshots/local-bash-rcfile.txtsrc/main/__fixtures__/shell-wrapper-snapshots/local-zsh-zshenv.txtsrc/main/__fixtures__/shell-wrapper-snapshots/relay-bash-rcfile.txtsrc/main/__fixtures__/shell-wrapper-snapshots/relay-zsh-zshenv.txtsrc/main/daemon/daemon-bash-shell-ready-rcfile.tssrc/main/daemon/pty-subprocess-managed-agent-env.test.tssrc/main/daemon/pty-subprocess-test-harness.tssrc/main/daemon/shell-ready.test.tssrc/main/ipc/pty-ipc-mock-registry.tssrc/main/ipc/pty-ipc-suite-environment.tssrc/main/ipc/pty/host-env/assembly.tssrc/main/ipc/pty/host-env/pi-agent.tssrc/main/ipc/pty/pty-spawn-env-agent-overlays.test.tssrc/main/mimo/hook-service.test.tssrc/main/mimo/hook-service.tssrc/main/powershell-osc133-bootstrap.test.tssrc/main/powershell-osc133-bootstrap.tssrc/main/providers/local-pty-provider-spawn-env.test.tssrc/main/providers/local-pty-shell-ready-bash-rcfile.tssrc/main/providers/local-pty-shell-ready-wrapper-generation.test.tssrc/main/providers/windows-shell-args.test.tssrc/main/shell-startup-features.tssrc/main/shell-wrapper-generated-file-snapshot.test.tssrc/main/zsh-startup-wrapper-builder.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
|
|
||
| export const mimoHookServiceModuleMock = () => ({ | ||
| mimoCodeHookService: { | ||
| carryOverLegacyAuth: vi.fn(), |
There was a problem hiding this comment.
Add an explicit type to the carryOverLegacyAuth spy. The typecheck step fails in CI.
The pipeline reports TS2883 at line 125. The inferred return type of mimoHookServiceModuleMock now includes a bare vi.fn(). TypeScript cannot name that type without Vitest's internal Procedure type. The typecheck:ci step exits with code 1, so this change blocks the build.
buildPtyEnv does not have this problem because it references mimoCodeBuildPtyEnvMock, which is annotated as Mock at line 26. Give the new spy the same annotation.
🐛 Proposed fix
-
--- "a/src/main/ipc/pty-ipc-mock-registry.ts" +++ "b/src/main/ipc/pty-ipc-mock-registry.ts" @@ -124,7 +124,7 @@ export const mimoHookServiceModuleMock = () => ({ mimoCodeHookService: { - carryOverLegacyAuth: vi.fn(), + carryOverLegacyAuth: vi.fn() as Mock, buildPtyEnv: mimoCodeBuildPtyEnvMock } })
An alternative is to annotate the factory's return type explicitly, for example
(): { mimoCodeHookService: Record<string, Mock> } =>.
Committable suggestion
-
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.Suggested changecarryOverLegacyAuth: vi.fn(), carryOverLegacyAuth: vi.fn() as Mock,
Source: Pipeline failures
Co-authored-by: BluesYoung-web <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Make the plugin overlay write atomic when several MiMo PTYs share one… · hook-service.ts:89-94
src/main/mimo/hook-service.ts:89-94
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winMake the plugin overlay write atomic when several MiMo PTYs share one source config.
Each PTY launch that uses the same source config rewrites
plugins/orca-mimocode-status.jsin place.writeFileSynctruncates the file before it writes the new content. A launch that starts while another launch reads that file can read an empty or partial plugin. Write the new content to a temporary file, then rename it over the target.🐛 Suggested fix
- writeFileSync( - join(pluginsDir, ORCA_MIMOCODE_PLUGIN_FILE), - getOpenCodeFamilyPluginSource('/hook/mimo-code', { emitSessionStart: false }) - ) + const pluginPath = join(pluginsDir, ORCA_MIMOCODE_PLUGIN_FILE) + const tmpPath = `${pluginPath}.${process.pid}.${Date.now()}.tmp` + writeFileSync( + tmpPath, + getOpenCodeFamilyPluginSource('/hook/mimo-code', { emitSessionStart: false }) + ) + renameSync(tmpPath, pluginPath)The rename keeps the per-source overlay design. On Windows, a rename can fail while another process holds the target open. The existing
catchthen returns the fallback, so the launch continues without the new overlay.

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5c25ec8a-bc6d-412a-9ba2-4fdf467731d8
Files selected for processing: 2-
src/main/mimo/hook-service.test.tssrc/main/mimo/hook-service.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
…' into nwparker/agint-mimo-home-overlay
There was a problem hiding this comment.
Actionable comments posted: 3

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
eebff553-0d22-4a0f-bb17-874e9e748801
Files selected for processing: 2-
src/main/ipc/pty/host-env/assembly.tssrc/main/ipc/pty/host-env/pi-agent.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
-
| restoreOrStripOverlayEnv(baseEnv, { | ||
| primary: 'MIMOCODE_HOME', | ||
| overlay: 'ORCA_MIMOCODE_HOME', | ||
| source: 'ORCA_MIMOCODE_SOURCE_HOME' | ||
| }) |
There was a problem hiding this comment.
🔎 Supported by static analysis
-
Script executed:
rg -n 'restoreOrStripOverlayEnv' src/main sed -n '90,135p' src/main/ipc/pty/host-env/assembly.ts
Repository: stablyai/orca
Length of output: 2995
Script executed:
sed -n '1,220p' src/shared/agent-overlay-env.ts rg -n -F --glob '*.ts' -e 'preserveExplicitPrimary' -e 'restoreOrStripOverlayEnv(' src/main src/shared
Repository: stablyai/orca
Length of output: 2230
Preserve explicit MiMo directories when clearing legacy markers.
restoreOrStripOverlayEnv restores sourceValue whenever a source marker exists unless preservePrimary is true. The MIMOCODE_HOME call does not enable that option, so an explicit home can be replaced. The config-directory call enables it, but the helper only preserves the explicit value when an overlay marker also exists. A source-only marker can still replace an explicit config directory.
Suggested fix
-
const preservePrimary = keys.preserveExplicitPrimary && - Boolean(overlayValue) && baseEnv[keys.primary] !== undefined && baseEnv[keys.primary] !== overlayValuerestoreOrStripOverlayEnv(baseEnv, { primary: 'MIMOCODE_HOME', overlay: 'ORCA_MIMOCODE_HOME', - source: 'ORCA_MIMOCODE_SOURCE_HOME' + source: 'ORCA_MIMOCODE_SOURCE_HOME', + preserveExplicitPrimary: true })
| if (opts.agentStatusHooksEnabled && isMimoLaunchCommand(launchCommandHint)) { | ||
| mimoCodeHookService.carryOverLegacyAuth({ ...process.env, ...baseEnv }) | ||
| const overlay = mimoCodeHookService.buildPtyEnv(id, mimoSourceConfigDir).MIMOCODE_CONFIG_DIR | ||
| if (overlay && overlay !== mimoSourceConfigDir) { | ||
| baseEnv.MIMOCODE_CONFIG_DIR = overlay |
There was a problem hiding this comment.
🔎 Supported by static analysis
-
Script executed:
#!/bin/bash # Inspect WSL launch classification and MiMo environment transfer without running repository code. rg -n -C 4 'buildPtyHostEnv\(|isMimoLaunchCommand\(|MIMOCODE_CONFIG_DIR|isWsl:' \ src/main/ipc/pty src/main/providers src/main/mimo
Repository: stablyai/orca
Length of output: 41747
Script executed:
set -eu printf '%s\n' '--- buildPtyHostEnv signature and MiMo branch ---' nl -ba src/main/ipc/pty/host-env/assembly.ts | sed -n '40,135p' printf '%s\n' '--- WSL provider call chain ---' nl -ba src/main/providers/local-pty-spawn-environment.ts | sed -n '1,80p' rg -n -C 5 -F -- 'buildPtyHostEnv(' src/main/ipc/pty src/main/providers printf '%s\n' '--- WSL environment transfer and path translation references ---' rg -n -C 6 -e 'WSLENV' -e 'MIMOCODE_CONFIG_DIR' -e 'wslDistro' -e 'isWsl' src/main/ipc/pty src/main/providers src/shared | head -n 1000 printf '%s\n' '--- changed file diff against supplied merge base ---' git diff --no-ext-diff --unified=25 1ff73e808d9e38a16f5e372b015ad312fe801c11 8927bfcfbc8d6eca6490760e416d86c659c5a184 -- src/main/ipc/pty/host-env/assembly.ts src/main/providers/local-pty-spawn-environment.ts src/main/ipc/pty
Repository: stablyai/orca
Length of output: 42247
Script executed:
set -eu printf '%s\n' '--- exact MIMOCODE_CONFIG_DIR and WSLENV ownership ---' rg -n -F --glob '*.{ts,tsx}' -e 'MIMOCODE_CONFIG_DIR' -e 'WSLENV' src/main src/shared printf '%s\n' '--- host environment construction ---' nl -ba src/main/ipc/pty/spawn-host-env.ts | sed -n '180,255p' printf '%s\n' '--- local provider spawn implementation references ---' rg -n -C 8 -e 'spawn\\(' -e 'wsl.exe' -e 'launchWslDistro' -e 'plan.isWslShell' src/main/providers src/main/ipc/pty | head -n 700 printf '%s\n' '--- WSL environment helper definitions ---' rg -n -C 12 -e 'function .*Wsl' -e 'WSLENV' -e 'toWsl' -e 'wsl.*Env' src/main src/shared | head -n 1000
Repository: stablyai/orca
Length of output: 41556
Script executed:
set -eu printf '%s\n' '--- WSL carrier helper ---' nl -ba src/main/pty/wsl-orca-env.ts | sed -n '1,155p' printf '%s\n' '--- WSL carrier call sites ---' rg -n -C 10 -e 'apply.*Wsl' -e 'wsl-orca-env' -e 'ORCA_OPENCODE_CONFIG_DIR/u' -e 'ORCA_OMP_STATUS_EXTENSION' src/main src/shared printf '%s\n' '--- Windows local PTY spawn environment ---' nl -ba src/main/providers/local-pty-windows-spawn-environment.ts | sed -n '1,150p' printf '%s\n' '--- host environment tail after MiMo branch ---' nl -ba src/main/ipc/pty/host-env/assembly.ts | sed -n '128,230p' printf '%s\n' '--- OMP WSL environment helper ---' nl -ba src/main/ipc/pty/host-env/omp-launch-environment.ts | sed -n '1,100p'
Repository: stablyai/orca
Length of output: 42410
Script executed:
set -eu rg -n -C 12 -F -- 'addOrcaWslInteropEnv' src/main/daemon/pty-subprocess src/main/providers src/main
Repository: stablyai/orca
Length of output: 42315
Do not inject the host MiMo overlay into WSL.
A WSL mimo launch can enter this branch. The WSL carrier does not forward MIMOCODE_CONFIG_DIR or ORCA_MIMOCODE_CONFIG_DIR, so the guest receives neither the plugin overlay nor the mirrored host config. Build a guest-resident overlay and pass it with /u, or skip the host overlay for WSL and leave the guest config unchanged.
Source: Coding guidelines
| 'ORCA_MIMOCODE_CONFIG_DIR', | ||
| 'ORCA_MIMOCODE_SOURCE_CONFIG_DIR' |
There was a problem hiding this comment.
🔎 Supported by static analysis
-
Script executed:
rg -n 'restoreOrStripOverlayEnv|getInheritedAgentHookEnvKeysToDelete|resolveMimocodeSourceConfigDir' src/main sed -n '60,180p' src/main/ipc/pty/host-env/assembly.ts
Repository: stablyai/orca
Length of output: 7718
Script executed:
set -o pipefail printf '%s\n' '--- agent-overlay-env references ---' rg -n -F --glob '*.ts' -e 'export function restoreOrStripOverlayEnv' -e 'restoreOrStripOverlayEnv' -e 'MIMOCODE_CONFIG_DIR' src/shared src/main/ipc/pty src/main/daemon | sed -n '1,240p' printf '%s\n' '--- helper implementation ---' rg -n -F --glob '*.ts' -- 'export function restoreOrStripOverlayEnv' src/shared helper=$(rg -l -F --glob '*.ts' -- 'export function restoreOrStripOverlayEnv' src/shared | head -n 1) if [ -n "$helper" ]; then sed -n '1,180p' "$helper" fi printf '%s\n' '--- pi-agent block ---' sed -n '110,190p' src/main/ipc/pty/host-env/pi-agent.ts printf '%s\n' '--- assembly relevant blocks ---' sed -n '80,135p' src/main/ipc/pty/host-env/assembly.ts sed -n '190,235p' src/main/ipc/pty/host-env/assembly.ts printf '%s\n' '--- ambient merge and call sites ---' rg -n -F --glob '*.ts' -e '...process.env' -e 'Object.assign(baseEnv' -e 'baseEnv = {' -e 'spawnEnv' src/main/ipc/pty/host-env src/main/ipc/pty | sed -n '1,260p' printf '%s\n' '--- relevant tests ---' rg -n -F --glob '*test*.ts' -e 'resolveMimocodeSourceConfigDir' -e 'ORCA_MIMOCODE_CONFIG_DIR' -e 'MIMOCODE_CONFIG_DIR' src/main src/shared | sed -n '1,260p'
Repository: stablyai/orca
Length of output: 19949
Script executed:
set -o pipefail printf '%s\n' '--- spawn environment assembly ---' sed -n '1,155p' src/main/ipc/pty/ipc/spawn-env.ts printf '%s\n' '--- spawn options assembly ---' sed -n '1,95p' src/main/ipc/pty/spawn-options-assembly.ts printf '%s\n' '--- local provider ambient merge ---' rg -n -F --glob '*.ts' -e 'getInheritedAgentHookEnvKeysToDelete' -e 'process.env' -e 'envToDelete' src/main/providers src/main/ipc/pty | sed -n '1,260p' printf '%s\n' '--- overlay tests ---' sed -n '230,350p' src/main/ipc/pty/pty-spawn-env-agent-overlays.test.ts printf '%s\n' '--- all direct cleanup assignments ---' rg -n -F --glob '*.ts' -e 'delete baseEnv.MIMOCODE_CONFIG_DIR' -e 'delete env.MIMOCODE_CONFIG_DIR' -e 'MIMOCODE_CONFIG_DIR: undefined' -e 'MIMOCODE_CONFIG_DIR' src/main/ipc/pty src/main/providers src/shared | sed -n '1,260p'
Repository: stablyai/orca
Length of output: 41602
Script executed:
set -o pipefail printf '%s\n' '--- local provider environment builder ---' sed -n '1,125p' src/main/providers/local-pty-spawn-environment.ts printf '%s\n' '--- host assembly invocation and environment inputs ---' rg -n -F --glob '*.ts' -e 'assemblePtyHostEnv' -e 'assemblePtyHostEnvironment' -e 'assemblePtyIpcSpawnEnv' -e 'baseEnv' src/main/ipc/pty | sed -n '1,240p' printf '%s\n' '--- MiMo overlay test setup and helper ---' sed -n '1,120p' src/main/ipc/pty/pty-spawn-env-agent-overlays.test.ts sed -n '120,235p' src/main/ipc/pty/pty-spawn-env-agent-overlays.test.ts printf '%s\n' '--- direct MIMOCODE cleanup outside inspected helper ---' rg -n -F --glob '*.ts' -e 'delete process.env.MIMOCODE_CONFIG_DIR' -e 'delete baseEnv.MIMOCODE_CONFIG_DIR' -e 'delete env.MIMOCODE_CONFIG_DIR' -e 'delete inheritedEnv.MIMOCODE_CONFIG_DIR' -e 'MIMOCODE_CONFIG_DIR' src/main/providers/local-pty-spawn-environment.ts src/main/ipc/pty/host-env src/main/ipc/pty/runtime src/main/ipc/pty/ipc
Repository: stablyai/orca
Length of output: 30951
Script executed:
set -o pipefail printf '%s\n' '--- daemon PTY environment merge ---' sed -n '1,125p' src/main/daemon/pty-subprocess/spawn-environment.ts printf '%s\n' '--- daemon managed-agent environment tests ---' sed -n '120,190p' src/main/daemon/pty-subprocess-managed-agent-env.test.ts printf '%s\n' '--- daemon host spawn deletion flow ---' sed -n '1,90p' src/main/ipc/pty/runtime/spawn-options.ts sed -n '145,210p' src/main/ipc/pty/spawn-host-env.ts
Repository: stablyai/orca
Length of output: 13218
Script executed:
sed -n '120,270p' src/main/daemon/pty-subprocess/spawn-environment.tsRepository: stablyai/orca
Length of output: 4742
Strip the inherited public config path with an orphaned overlay marker.
For daemon or remote launches with a sparse baseEnv, remove MIMOCODE_CONFIG_DIR when it is inherited and matches ORCA_MIMOCODE_CONFIG_DIR. Preserve an explicit pane value.
The daemon merges process.env before applying envToDelete. Add the public key to the inherited cleanup list. Its existing env[key] === undefined filter preserves explicit pane values.
🐛 Suggested fix
-
--- "a/src/main/ipc/pty/host-env/pi-agent.ts" +++ "b/src/main/ipc/pty/host-env/pi-agent.ts" @@ -136,9 +136,10 @@ 'ORCA_CLAUDE_CONFIG_DIR', 'ORCA_OPENCODE_AGENT', 'ORCA_OPENCODE_CONFIG_DIR', 'ORCA_OPENCODE_SOURCE_CONFIG_DIR', 'ORCA_MIMOCODE_CONFIG_DIR', - 'ORCA_MIMOCODE_SOURCE_CONFIG_DIR' + 'ORCA_MIMOCODE_SOURCE_CONFIG_DIR', + 'MIMOCODE_CONFIG_DIR' ].filter((key) => env[key] === undefined) }
Committable suggestion
-
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.Suggested change'ORCA_MIMOCODE_CONFIG_DIR', 'ORCA_MIMOCODE_SOURCE_CONFIG_DIR' 'ORCA_MIMOCODE_CONFIG_DIR', 'ORCA_MIMOCODE_SOURCE_CONFIG_DIR', 'MIMOCODE_CONFIG_DIR'
ELI5
To add its status plugin, Orca pointed MiMo Code at a whole replacement home folder. That folder also replaced where MiMo keeps your login (
auth.json), sessions and history. So MiMo started inside Orca without your credentials, and requests failed with 401. Now Orca adds one extra config folder that holds only its plugin. Your login, sessions, config and plugins stay where MiMo normally keeps them.What Changed
MimoCodeHookService.buildPtyEnvnow returnsMIMOCODE_CONFIG_DIR=<userData>/mimocode-hooks/configinstead ofMIMOCODE_HOME=<userData>/mimocode-hooks/shared. That directory holds onlyplugins/orca-mimocode-status.js. Nodata/,cache/orstate/is created, and user config is not mirrored, because MiMo still loads its normal config dir.MIMOCODE_CONFIG_DIR, Orca mirrors that dir into a per-source overlay and adds its plugin there. A symlinkedplugins/folder is mirrored entry by entry, so Orca's file never lands in the user's folder. This folds in the fix from fix: preserve user plugins behind linked MiMo configuration #23203.host-env/assembly.ts) records and restoresORCA_MIMOCODE_CONFIG_DIR/ORCA_MIMOCODE_SOURCE_CONFIG_DIRthe same way OpenCode's overlay does. It also strips an older build'sMIMOCODE_HOMEoverlay (ORCA_MIMOCODE_HOMEmarkers) from nested panes. A user's ownMIMOCODE_HOMEis left alone.<userData>/mimocode-hooks/shared/data/auth.json. On a MiMo launch, if MiMo's normal data dir ($MIMOCODE_HOME/data, else$XDG_DATA_HOME/mimocode, else~/.local/share/mimocode) has noauth.json, Orca moves the old one across once:COPYFILE_EXCL, so it never overwrites, and gets mode0600.auth.json.migrated. This also happens without copying when MiMo already has its ownauth.json. Either way, the Orca-only login is never restored later, even if the user deletes the normal one.MIMOCODE_HOMEis skipped, because MiMo rejects relative paths.mimocode.db(plus-wal/-shm). Anymimocommand, evenmimo debug paths, creates that DB, so "the normal store is empty" can't be detected reliably. Merging two DBs isn't safe either. Orca-only sessions from main stay readable under<userData>/mimocode-hooks/shared/data, and can be reached withMIMOCODE_HOME=<userData>/mimocode-hooks/shared mimo.MIMOCODE_CONFIG_DIRoverlay is re-mirrored using the OpenCode overlay manifest instead of being wiped on every launch. This keeps thenode_modules/package.jsonthat MiMo installs into config dirs. An explicit per-paneMIMOCODE_CONFIG_DIRbeats inherited markers (preserveExplicitPrimary, as for OpenCode). The MiMo marker keys are also dropped with the OpenCode ones ingetInheritedAgentHookEnvKeysToDelete.MIMOCODE_CONFIG_DIRafter user rc files instead ofMIMOCODE_HOME.Why
MiMo Code (
@mimo-ai/cli0.1.15, darwin-arm64 binary, probed in a tempHOME):mimo debug pathsdatamimo auth list(placeholderauth.jsonin the canonical data dir)mimo debug config)mimocode.jsonmodelMIMOCODE_HOME=<Orca overlay>(main)<overlay>/data<overlay>/data/auth.json)MIMOCODE_CONFIG_DIR=<Orca plugin dir>(this PR)~/.local/share/mimocodeplugin_origins.source = <Orca dir>)openai/agint-user-model)Like OpenCode's
OPENCODE_CONFIG_DIR,MIMOCODE_CONFIG_DIRadds a config layer: global config and user plugins load alongside it. This matches the reporter's root-cause analysis in #9132.#9133 does the same env switch but adds about 1.4k lines of ownership records and per-PTY hashing. This PR reuses the existing overlay-mirror helpers instead. It changes 78 production lines.
Linked Issue
Fixes #9132
Visual Proof
N/A. This is environment and config plumbing with no UI change.
Testing
I manually tested these changes locally
Automated tests added/updated
Carry-over, run with
env -iand a tempHOME: put a placeholderauth.jsononly in the old shared overlay, then ran this branch'scarryOverLegacyAuth+buildPtyEnv.~/.local/share/mimocode/auth.jsonwith mode-rw-------, andmimo auth listshowed 1 credential.mimoran, the overlay heldnode_modules,package.json,package-lock.jsonand.gitignore. All four survived the next launch's re-mirror.Real CLI, macOS:
MimoCodeHookServiceagainst a temp userData.env -iand a tempHOME, which gave the table above.pnpm test src/main/ipc src/main/providers src/main/daemon/pty-subprocess src/main/mimo src/main/opencodepasses.pnpm tcandcheck:code-quality:changedare clean.Not run: a full prompt turn showing
/hook/mimo-codestatus. The plugin source is unchanged; only where it loads from moved.Already failing on main:
src/main/daemon/shell-ready.test.tshas 4 fish/zsh timeouts that fail identically on main on this machine.Review
Risk is low to medium.
MIMOCODE_HOMEonly ifORCA_MIMOCODE_HOMEis set, and new builds no longer set it, so the worst case is no restore after user rc files. That is the same as a non-wrapped shell.Co-authored-by: BluesYoung-web [email protected]