Repository navigation
fix(bots): isolate user homes and disable codex skills - #190
Merged
Merged
Conversation
Codex 0.164.0 discovers user skills outside CODEX_HOME. Isolate Codex and Grok bot homes, disable Codex skills and explicitly use its linked file login. Keep Claude's HOME for macOS login discovery while isolating CLAUDE_CONFIG_DIR. Rebuild cached bot sessions and capture official Claude, Codex and Grok requests with seeded user skills and instructions. Preserve tool schemas, selected instance login paths and thread skills. Document file auth and the existing keyring-only limitation. Fixes: #97
nixuuu
added a commit
that referenced
this pull request
Nov 5, 2026
Platform threads no longer read the device owner's global instruction files. A new scratch thread on a Mac quoted the owner's `~/.claude/CLAUDE.md` (rules about a plugin that the thread does not have). **Cause:** Claude Code (CLI 2.1.308, Agent SDK 0.3.316) loads global user memory (`~/.claude/CLAUDE.md`) and `CLAUDE.md` files from parent directories even with `settingSources: ["project", "local"]`. A real-CLI capture of scratch and project threads contained both fixture texts. **Fix** - **Claude:** threads pass `claudeMdExcludes` for the device's `~/.claude/**` and for `CLAUDE.md`, `CLAUDE.local.md`, `AGENTS.md` and `.claude/**` in every directory above the workspace root. Instructions inside the workspace or repo stay. `HOME` and the login setup are unchanged, so macOS Keychain sign-in is not affected. - **Codex:** threads keep the real `HOME`, `USERPROFILE` and XDG paths, so git identity, SSH keys, `gh` and tool configs keep working in agent shells. The device's skills are left out through Codex's own skill-path settings; library skills in the isolated `CODEX_HOME` stay. Scratch threads use `project_root_markers: []`, so no `AGENTS.md` above them is collected. - **Grok:** threads keep the real home. An isolated `GROK_HOME`, the compatibility flags and `[skills].ignore` keep global context out. Grok's native rules and root instruction files stay. - **Bots:** unchanged; they stay fully isolated (#190). **Limitations** - Codex: a newly installed device skill is picked up only after an app-server or worker restart. - Grok: Claude and Cursor compatibility rules and skills are off inside projects as well. **Tests:** `apps/worker/src/providers/instruction-isolation.test.ts` captures requests from the real Claude, Codex and Grok CLIs for scratch and project threads, using a temporary `HOME` with fixture files. It checks that: - global and ancestor instructions are absent; - repo instructions and assigned library instructions are present; - agent subprocesses see the real `HOME` and git identity. Bot isolation tests pass. `check:tmp`: 1398 passed, 0 failed. Docs: `agent-environment.md`, `claude-adapter.md`, `codex-adapter.md`, `grok-adapter.md`, `worker-config.md`. Copy audit: no UI text changed.
This was referenced Nov 13, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 15, 2026
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 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.
Bots no longer see the device owner's skills or instructions.
Leak: Codex 0.164 finds skills in
HOME/.agents/skillsregardless ofCODEX_HOME. Captured Codex bot requests held a<skills_instructions>block with local skill names and paths, even though the bot catalog setsinclude_skills_usage_instructions: false. Grok leaked a seeded skill the same way. Claude was clean.Fix:
Codex bots run with a private
HOME,USERPROFILEandXDG_*under the bot session. They also run with these settings:skills.include_instructions=false;skills.bundled.enabled=false;features.skip_host_skill_discovery=true.Credentials stay file-based in
CODEX_HOME/auth.json, linked from the selected instance as before.Grok bots run with a private
HOME. Their login stays available through an absoluteGROK_AUTH_PATH.Claude bots keep the inherited
HOME, so login discovery on macOS (Keychain) is unchanged. OnlyCLAUDE_CONFIG_DIRpoints at the session home, as before.Existing bot sessions are rebuilt once (session key
isolation: 2), so context that may have leaked earlier is not carried over.Thread sessions keep their skills.
Tests:
apps/worker/src/bots/isolation.test.tsseeds a fake user skill plus userAGENTS.md/CLAUDE.mdand runs the real CLIs. It asserts that the Claude, Codex and Grok bot requests contain no skill names, no skill paths and no instruction text. The existing tool-schema assertions are unchanged.check:tmp: 1278 passed, 154 skipped, 0 failed.Not verified:
Docs:
docs/bots-harness.md.Copy audit: no UI text changed.
Fixes: #97