Repository navigation
fix(dev-harness): keep local desktop auth-scoped calls off production - #17302
Merged
Merged
Conversation
The local dev harness desktop profile set OMI_PYTHON_API_URL and OMI_DESKTOP_API_URL but not OMI_AUTH_API_URL, so the macOS app's DesktopBackendEnvironment.authBaseURL() fell back to the production API for auth-scoped calls (GET /v2/desktop/prompts, GET /v1/csat/config). A local named bundle sent its Firebase Auth emulator token to production, got 401, and AuthSessionCoordinator treated the post-refresh 401 as a dead session (invalidateSession reason=postRefreshHTTP401), signing every local desktop profile out about a second after signing in. Point OMI_AUTH_API_URL at the local python backend, same as OMI_PYTHON_API_URL, so auth-scoped calls stay on the local backend. Verified locally: with the fix the bundle stays signed in and those calls return 200 from the local backend; scripts/dev-harness/tests/test_desktop_profile.py passes (5 tests). Co-Authored-By: ZCode (GLM-5.3) on behalf of Claude Code session
Member
Author
|
Hygiene /
cc @beastoin — flagging since #17284 is yours; happy to take a follow-up if you want the lane repaired. |
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.
Bug
The local dev-harness desktop profile (
scripts/dev-harness/dev_harness/desktop_profile.py) setOMI_PYTHON_API_URLandOMI_DESKTOP_API_URLbut notOMI_AUTH_API_URL. The macOS app'sDesktopBackendEnvironment.authBaseURL()therefore fell back to the production API for auth-scoped calls (GET /v2/desktop/prompts,GET /v1/csat/config). A local named bundle sent its Firebase Auth emulator token to production, got 401, andAuthSessionCoordinatortreated the post-refresh 401 as a dead session (invalidateSession reason=postRefreshHTTP401) — so every local desktop profile signed itself out about a second after signing in.Fix
Set
OMI_AUTH_API_URLto the local python backend (same value asOMI_PYTHON_API_URL) so auth-scoped calls stay on the loopback backend instead of silently defaulting to production.Verification
python -m pytest -q scripts/dev-harness/tests/test_desktop_profile.py→5 passed in 0.02s(interpreter selected the wayscripts/dev-harness/run-tests.shselects it).bash scripts/dev-harness/run-tests.sh→550 passed, 6 skipped, 20 xfailed, 23 subtests passed in 100.35s, run with the documented local setup:backend/.venvprovisioned byscripts/dev-harness/lane-backend.sh,PYTHONPATH=<repo>/backend, and a non-symlinkedTMPDIR(macOS/tmp→/private/tmpbreaks threetest_native_probe_buildspath tests locally; CI's Linux runners are unaffected).GET /v2/desktop/promptsandGET /v1/csat/configreturn 200 from the local backend.Found while validating #17281.
Note on the dev-harness-unit-tests check (pre-existing on main, unrelated to this diff)
#17284 (current
mainHEAD) addedfrom utils.llm.model_config import LUNA_MODELto the shared fakebackend/testing/e2e/fakes/llm.py, which this lane loads by file path. In the lean interpreter environments the lane runs under (no backend package onsys.path, noopenai/langchain-openaideps — exactly CI's Repo Checks Hygiene job), that import chain fails withModuleNotFoundError: No module named 'utils', taking ~12 tests red. Reproduced on cleanorigin/main(268e04e) with this branch's change stashed: the same tests fail identically. No PR since #17284 has selected this check (backend-only paths don't trigger it), so CI has not surfaced it yet. This PR's two-file diff doesn't touch the fake or the loader; the failure is expected to track main until #17284's collateral is fixed upstream.Product invariants affected
none
Failure class (fixes)
Failure-Class: FC-hermetic-suite-points-at-remote-api
The violated contract — a local development context must not send its traffic to a non-loopback API — is the same shape here: an unset auth endpoint let the desktop profile silently fall back to the production API, like the leftover remote
API_BASE_URLthat class was minted for.🤖 Generated with Claude Code