Repository navigation
fix(bots): keep version manager dirs under isolated bot homes - #780
Merged
Merged
Conversation
Codex and Grok bots replace HOME and XDG. A CLI found through a mise, asdf or Volta shim (or a launcher that runs `node` from PATH) then could not find its installs or trusted config and exited at once, so every bot turn failed with an internal harness error. Keep the device's version manager directories in the bot environment. Fixes: #190 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 16, 2026
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.
Every bot turn failed on a worker whose CLIs come from a version manager. Codex and Grok bots run with a private
HOME,USERPROFILEand XDG dirs (#190), and CLI discovery often picks a shim (e.g.~/.local/share/mise/shims/codex). A CLI launcher may also runnodefrom PATH, which can be a shim too. Under the bot's home, the shim can't find its installs or trusted config and exits right away (mise ERROR Config files in ~/.config/mise/config.toml are not trusted.). Codex then failedinitializeand was classified asinternal; Grok failed withprocess_exit. The UI only showed "Bot harness could not finish this turn". Threads were not affected because they keep the realHOME.Fix
isolatedHomeEnvironmentkeeps the device's version manager directories, taken from the worker's real environment:MISE_CONFIG_DIR,MISE_DATA_DIR,MISE_STATE_DIR,MISE_GLOBAL_CONFIG_ROOT,ASDF_DATA_DIR,VOLTA_HOME. Values the device already sets win.LOCALAPPDATA.docs/bots-harness.mddescribes the rule.Checks
apps/worker/src/bots/isolation.test.ts): Codex and Grok bots start through a shim that resolves its install from a data dir underHOME, as mise does, and must reach inference. Without the fix both fail within 10–20 ms; with it both pass.codex,claudeandgrokshims fail under an isolatedHOMEand start with the keptMISE_*dirs.bun install,bun run gen:check,bun run typecheck,bun run lint,bun run format:check, web build: clean.bun run check:tmp: 3167 passed, 3 failed, nothing left in the temp dir. None of the failures come from this change:tools/direct-inference.test.tshit its 5 s timeout on a loaded machine and passes when run alone.tests/integration/worker-profile-env.test.ts("adding variables replaces only the instance process") fails the same way ondev.apps/worker/src/providers/codex/connections.test.ts("Codex keeps full history when resuming…") fails the same way ondev.Copy audit (docs/copy.md §8)
No UI text added or changed.
Fixes: #190
🤖 Generated with Claude Code