From e99562b0094b41472c71b189628ea888e2b2e9fb Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 30 Apr 2026 03:00:46 +0000 Subject: [PATCH] compat-matrix: shim tests/claude_code from dev checkout when missing on resolved tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The resolver picks the latest `v*-stable` tag of BerriAI/litellm. Until the compat matrix work itself lands in a stable release, that tag's tree won't contain `tests/claude_code/` at all — the proxy config and test files only exist on the work-in-progress stack. Without a shim, the cron dies with 'proxy config not found at .../test_config.yaml' on every run. Fix: after `git checkout `, if `/tests/claude_code/test_config.yaml` is missing, copy the directory from ${LITELLM_REPO} (the dev checkout, which has the in-flight matrix work). The `git clean -e tests/claude_code` line preserves the shim across runs. Once the matrix work is in the resolved tag, the if-branch is a no-op and the shim is never used. No code path needs to be removed later; the bridge self-disables. --- tests/claude_code/cron_vm/run_daily.sh | 29 +++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/tests/claude_code/cron_vm/run_daily.sh b/tests/claude_code/cron_vm/run_daily.sh index cf0f3a21ccc..50347d39b6c 100755 --- a/tests/claude_code/cron_vm/run_daily.sh +++ b/tests/claude_code/cron_vm/run_daily.sh @@ -136,13 +136,32 @@ fi log "updating worktree to ${LITELLM_VERSION}" git -C "${WORKTREE}" fetch --tags --force git -C "${WORKTREE}" reset --hard -# Keep the venv and the .uv-bin cache around — uv sync will reconcile -# the venv and we don't want to re-download the pinned uv binary on -# every run. Drop everything else (compat-results.json, __pycache__, -# etc.) so each run starts clean. -git -C "${WORKTREE}" clean -fdx -e .venv -e .uv-bin +# Keep the venv, the .uv-bin cache, and any tests/claude_code/ we may +# have shimmed in (see below) around — uv sync will reconcile the +# venv, we don't want to re-download the pinned uv binary every run, +# and the test files may not exist on the resolved tag yet. Drop +# everything else so each run starts clean. +git -C "${WORKTREE}" clean -fdx -e .venv -e .uv-bin -e tests/claude_code git -C "${WORKTREE}" checkout --force "${LITELLM_VERSION}" +# Bridge for the pre-stable window: until the compat matrix work hits a +# v*-stable tag, the resolver will pick a tag whose tree predates +# tests/claude_code/ entirely. In that case we shim in the dev +# checkout's copy of the test tree so the proxy config + tests are +# discoverable. Once the matrix work is in the resolved tag, this +# block is a no-op (the if-branch falls through). The shimmed files +# are untracked, so the next run's `git clean -e tests/claude_code` +# preserves them across runs. +if [[ ! -f "${WORKTREE}/tests/claude_code/test_config.yaml" ]]; then + if [[ -d "${LITELLM_REPO}/tests/claude_code" ]]; then + log "tests/claude_code missing on ${LITELLM_VERSION}; shimming from ${LITELLM_REPO}" + mkdir -p "${WORKTREE}/tests" + cp -r "${LITELLM_REPO}/tests/claude_code" "${WORKTREE}/tests/" + else + die "tests/claude_code missing on ${LITELLM_VERSION} and no shim source at ${LITELLM_REPO}/tests/claude_code" + fi +fi + # litellm pins an exact uv version in pyproject.toml's [tool.uv] # `required-version` field, so a system uv that's newer or older # refuses to sync. We pin our own local copy at the version the