Repository navigation
fix: keep personal Codex hooks and AGENTS.md out of subscription runs - #22
Merged
Merged
Conversation
Codex has no flag to skip a personal ~/.codex/hooks.json or ~/.codex/AGENTS.md: with --ignore-user-config it still runs and reads them (verified with marker-writing hooks), so every chatgpt-login rollout and improver session fired the user's own hooks. Claude Code's flags, by contrast, do keep user hooks and plugins out (verified the same way). chatgpt-login now runs Codex on a home kept for harness2, ~/.local/state/harness2/codex-home, which the user signs in to ChatGPT once with the new `harness2 login codex`; that is a separate login, so the user's own ~/.codex is never read or changed and its refresh token is never used. `providers.chatgpt-login.home` points runs at another home instead, and doctor then lists the personal files every run will include. `harness2 login` shows whether both subscription logins are ready, and init and the agent guide point at it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
5 of 6 tasks
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
I checked hook isolation with marker-writing hooks in a temporary config home, running each CLI against a local capture server with no model calls.
So Claude Code was already isolated, but on this machine every
chatgpt-loginrollout and improver session also ran the personal~/.codex/hooks.json, which here holds Paseo integration hooks. Logging in with an access token only is not possible with this Codex version, because it accepts only an agent-identity JWT.The fix:
chatgpt-loginnow runs Codex on a home kept for harness2,~/.local/state/harness2/codex-home. harness2 never writes config, hooks or instructions there.harness2 login codexsigns that home in to ChatGPT once. This is a separate login: the user's~/.codexand its refresh token are never touched.providers.chatgpt-login.homecan point runs at another home.doctorthen reports the non-emptyAGENTS.md/hooks.jsonthat every run will include.harness2 login(no argument) shows whetherclaude-loginandchatgpt-loginare ready.init, the agent guide, README, configuration and cli docs, and the CHANGELOG are updated.Test plan
harness2 login codexwith a real browser sign-in: needs the user🤖 Generated with Claude Code