fix: prevent settings.json race that drops MLflow env vars#154
Merged
datasciencemonkey merged 5 commits intomainfrom Apr 30, 2026
Merged
fix: prevent settings.json race that drops MLflow env vars#154datasciencemonkey merged 5 commits intomainfrom
datasciencemonkey merged 5 commits intomainfrom
Conversation
11f539e to
0cbe1b6
Compare
Two changes: 1. setup_claude.py and _configure_all_cli_auth() now read-merge-write settings.json instead of overwriting it. This preserves env vars added by other setup scripts (e.g. setup_mlflow.py). 2. setup_mlflow.py now runs sequentially after the parallel agent setup batch, not inside it. This eliminates the race where setup_claude.py and setup_mlflow.py both write settings.json concurrently. Fixes #153
The test_returns_empty_list test failed when run after other test classes because sessions leaked across classes. Adding session cleanup at fixture setup (not just teardown) fixes the ordering dependency.
- setup_codex.py, setup_gemini.py, setup_opencode.py: retry npm install up to 3 times with 5s delay, print full stderr/stdout on failure - tests/test_session_limit.py: clear leaked sessions before slot-freeing test - .gitignore: add codex and agent-plane-ref entries
Skills already live in ~/.agents/skills/ (copied by setup_codex.py). Copying them again into ~/.gemini/skills/ caused Gemini CLI to log "Skill conflict detected" warnings for every skill on startup.
f2c5ac1 to
46f05c6
Compare
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
setup_claude.pyand_configure_all_cli_auth()were overwriting~/.claude/settings.jsonfrom scratch, nuking MLflow env vars added bysetup_mlflow.pysetup_mlflow.pyran in parallel withsetup_claude.py, creating a race condition on the same fileChanges
setup_claude.py: read-merge-write instead of overwrite — preserves existing env vars (hooks, MLflow config, etc.)app.py:_configure_all_cli_auth(): same read-merge-write patternapp.py:run_setup():setup_mlflow.pynow runs sequentially after the parallel agent setup batch, not inside itTest plan
~/.claude/settings.jsonafter setup completesFixes #153