Repository navigation
feat(lens): coordinate worker releases and bundled installs - #44428
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@greptileai @veria-ai Please review the current tip for release regressions, incompatible worker versions, unsafe upgrades, and missed failure paths |
|
bugbot run Please review the current tip for release regressions, incompatible worker versions, unsafe upgrades, and missed failure paths |
# Conflicts: # litellm/proxy/lens/inference.py
|
|
@greptileai @veria-ai Please review the current tip for release regressions, incompatible worker versions, unsafe upgrades, and missed failure paths |
|
bugbot run Please review the current tip for release regressions, incompatible worker versions, unsafe upgrades, and missed failure paths |
|
@greptileai @veria-ai Please review the current tip for release regressions, incompatible worker versions, unsafe upgrades, and missed failure paths |
|
bugbot run Please review the current tip for release regressions, incompatible worker versions, unsafe upgrades, and missed failure paths |
|
@greptileai @veria-ai Please review the current tip for release regressions, incompatible worker versions, unsafe upgrades, and missed failure paths |
|
bugbot run Please review the current tip for release regressions, incompatible worker versions, unsafe upgrades, and missed failure paths |
|
@greptileai @veria-ai Please review the current tip for release regressions, incompatible worker versions, unsafe upgrades, and missed failure paths |
|
bugbot run Please review the current tip for release regressions, incompatible worker versions, unsafe upgrades, and missed failure paths |
|
@greptileai @veria-ai Please review the latest build-identity guard, source development setup, and recovery checks for release regressions and missing failure paths. |
|
bugbot run Please review the latest build-identity guard, source development setup, and recovery checks for release regressions and missing failure paths. |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 61703ef. Configure here.
TLDR
Problem this solves:
How it solves it:
Intentional product change: worker setup selects the matching release and exposes a private token for Compose and Helm. Existing Lens workers must upgrade before they can claim work
User Flow
Before: the setup command installs a pinned worker that can lag behind LiteLLM
After: the command selects the matching release, with a token option for managed deployments
Pre-Submission checklist
61703efa3e; previous Greptile confidence was 5/5Screenshots / Proof of Fix
Before (3defa90)
LITELLM_RELEASE_TAGghcr.io/berriai/litellm-lens-worker:v1.105.0, using the installed package version even though the checkout can contain different sourceAfter (61703ef)
LITELLM_RELEASE_TAGand a private admin keyGET http://127.0.0.1:4419/health/livelinessreturns HTTP 200POST http://127.0.0.1:4419/lens/workers/registerwith a valid registration body returns HTTP 503 andThis LiteLLM build has no release identity. Use a published release, make lens-dev, or build the gateway and worker from the same commit with the same LITELLM_RELEASE_TAG.No worker credential is createdThe latest source revision stops unlabelled containers, editable checkouts, and direct source installs from guessing a published worker version. Published package-index installs retain version-based selection.
make lens-devgives the proxy and worker the same source identity, overriding unrelated inherited release settingsThe production Compose check now also recreates the gateway without its identity, verifies setup and claims are refused, then restores the original identity and checks that the worker and trace recover. The hosted production Compose check passes, including refusal and recovery on an unversioned gateway (run)
The paired dashboard screenshots in User Flow were captured at
fd14e51ecfandcbd403778ausing the same URL, registration, and real database. The frontend is unchanged between the captured revision and this tip. Clipboard checks verified the matching image and separately copied private token; no token appears in the screenshotsValidation
The earlier full Compose test at cbd403778a builds the production image and starts LiteLLM, PostgreSQL, ClickHouse, and the worker. It writes and reads a real trace, verifies the recommended image and authenticated heartbeat, rejects a wrong release with HTTP 409, restarts the services, and checks that the trace, worker identity, token, and billing assignment remain intact. The runtime, gateway, backend, UI, and migration image jobs pass, along with Buildkite end-to-end tests
On isolated Render services, upgraded the monolith and standalone worker from test release
v0.0.1-lens-testtov0.0.2-lens-testusing the same databases, keys, and worker token. A normal paidPOST /v1/chat/completionsreturned HTTP 200, answer4, and 22 tokens both before and after the upgrade. The existing dashboard session and saved findings survivedAgainst the component backend at
cbd403778a, a real Helm-installed worker completedPOST /lens/{id}/runswith{"lookback_hours":1}.GET /lens/{id}returnedcompleted, two screened and investigated traces, two findings includingbrief, and cost$0.0480805. The original saved finding was retained. The worker used a non-root user, read-only root filesystem, memory-backed temporary storage, and a limited token from the existing Kubernetes Secret. The Secret survived the worker image upgrade and scale-to-zero/resume cycleThe upgraded standalone Render worker recovered an interrupted investigation after its five-minute lease expired, using the original worker token. The same job completed on its second attempt with two reviewed traces and cost
$0.0747985. Separately, copied a newly registered worker token through the dashboard atcbd403778aand deployed it to Render. That investigation completed on its first attempt with two reviewed traces, two saved findings containingbrief, and cost$0.0485835. Both runs retained the existing findingAn old protocol and wrong release each returned HTTP 409 without claiming a queued investigation or increasing its attempt count. Production worker imports, release metadata, and writable temporary storage pass on both amd64 and arm64. The full-storage recovery smoke passes
make checkpasses. Focused backend tests pass 84 cases, UI tests pass 19, Helm lint/render and 166 chart tests pass. The combined Lens suite passes 200 tests and the PostgreSQL lifecycle suite passes eight cases. Devin's merged budget fix #44431 is included through the main merge. The duplicate #44430 is closedRevision
3defa90b09also normalizes numeric Helm backend tags, rejects unversioned worker Docker builds, and isolates Compose storage with generated passwords. Compose URL-encodes those passwords before the original production entrypoint runs. Localmake checkand 166 chart tests pass. The hosted full-stack smoke passes at this tip using URL-reserved password characters and verifying that the worker cannot reach either datastore directly. All production image builds, the image vulnerability scan, and the hosted PostgreSQL migration suite passQA runbook
tests/e2e/migrations/lens_compose_smoke.sh: real bundled startup and restart persistenceLITELLM_IMAGEto its local tag; Docker Compose, curl, jq, and OpenSSL are requireddeploy/lens/stack.yamlwith a private master key, salt key, version, and port; wait forGET /health/livelinessPOST /v1/traces; read the same trace and span IDs fromGET /v1/traces/{trace_id}POST /lens/workers/register, and verify the returned image matches the chosen releaseGET /lensmust show a new authenticated heartbeatworker_release=v0.0.0-old; expect HTTP 409 with upgrade guidanceCompanion changes
project-releaser #291 publishes matching GHCR and Docker Hub worker releases. litellm-ops #219 adds the worker to hourly selected-commit builds and dev chart rollouts. Documentation #2055 covers new installations, existing deployments, standalone hosting, and upgrades
Caveats
Severe
Medium
Low
61703efa3e, production Compose, image builds/scan, migrations, and all three bot reviews pass; broader Buildkite chore(deps): bump svgo from 3.3.2 to 3.3.3 in /docs/my-website #22840 passes in 33 minutes, 21 secondsThe same CodeQL
LogInjection.qlresult-size failure occurs on main and on this PR at3defa90b09. This is an incomplete analysis, not a passing security check. The PR author accepts this existing tooling failure; scanner configuration is unchanged. At3defa90b09, patch coverage is 94.87%, above the 81.11% target; Greptile gives 5/5, Veria passes, Bugbot reports no new issues, and Buildkite #22806 passes. The61703efa3efollow-up passes localmake check, 205 Lens cases, and 65 focused identity, endpoint, and development-script cases; its production Compose check, image builds/scan, migrations, and fresh reviews now pass (Greptile 5/5, Veria pass, Bugbot clean). Buildkite #22840 passes in 33 minutes, 21 seconds. No production registries or shared deployments were modified by this agentType
Bug fix, deployment support, documentation
Note
Medium Risk
Changes Lens worker claiming and registration (protocol 4, release matching) and deployment defaults, so existing workers must upgrade images; misconfigured builds without LITELLM_RELEASE_TAG will refuse setup until fixed.
Overview
Lens gateway and worker releases are now tied together so setup no longer pins a stale worker digest and upgrades cannot silently mix versions.
Gateway and worker images carry
LITELLM_RELEASE_TAG(build-arg on main Dockerfiles and the Lens worker image, which fails the build if the tag is missing).litellm/proxy/lens/release.pyderives the recommended worker image from that tag (with optionalLENS_WORKER_IMAGEoverride). Worker registration returns the matchingimage;/lens/worker/claimbumps to protocol 4 and requiresworker_releaseto match—otherwise HTTP 409 with upgrade text, or HTTP 503 when the gateway has no release identity (no guessing from the installed package version).Installation paths: new
deploy/lens/stack.yaml+config.yamlfor a full Compose stack; worker-only Compose switches from digest pins toLITELLM_VERSIONtags. Helm adds an opt-inlensWorkerdeployment and setsLENS_WORKER_IMAGEon the backend. The dashboard install command uses the API image, drops forced amd64, and adds Compose/Helm token copy.make lens-devand CI smoke tests align proxy and worker on the same release tag.Reviewed by Cursor Bugbot for commit 61703ef. Bugbot is set up for automated code reviews on this repo. Configure here.