Bug
setup_mlflow.py merges MLflow env vars (MLFLOW_TRACKING_URI, MLFLOW_EXPERIMENT_NAME, etc.) into ~/.claude/settings.json, but they get silently wiped by two separate code paths:
1. _configure_all_cli_auth() overwrites settings.json from scratch
app.py:294-309 creates a fresh dict and writes it, nuking any existing content:
settings = {
"env": {
"ANTHROPIC_MODEL": ...,
"ANTHROPIC_AUTH_TOKEN": token,
...
}
}
with open(settings_path, "w") as f:
json.dump(settings, f, indent=2)
This runs in configure_pat() before run_setup() kicks off, so it overwrites any MLflow vars from a prior setup.
2. setup_claude.py and setup_mlflow.py run in parallel
Both are in the parallel_steps list in run_setup(). If setup_claude.py writes settings.json, it can clobber what setup_mlflow.py just merged — race condition on the same file.
Fix
_configure_all_cli_auth() should read-merge-write instead of overwriting settings.json
setup_mlflow.py should run after setup_claude.py (sequentially), not in parallel
Bug
setup_mlflow.pymerges MLflow env vars (MLFLOW_TRACKING_URI,MLFLOW_EXPERIMENT_NAME, etc.) into~/.claude/settings.json, but they get silently wiped by two separate code paths:1.
_configure_all_cli_auth()overwrites settings.json from scratchapp.py:294-309creates a fresh dict and writes it, nuking any existing content:This runs in
configure_pat()beforerun_setup()kicks off, so it overwrites any MLflow vars from a prior setup.2.
setup_claude.pyandsetup_mlflow.pyrun in parallelBoth are in the
parallel_stepslist inrun_setup(). Ifsetup_claude.pywritessettings.json, it can clobber whatsetup_mlflow.pyjust merged — race condition on the same file.Fix
_configure_all_cli_auth()should read-merge-write instead of overwriting settings.jsonsetup_mlflow.pyshould run aftersetup_claude.py(sequentially), not in parallel