Skip to content

fix: honour MOBILERUN_OAUTH_MANUAL across OAuth providers (part of #396) - #436

Open
8crsk wants to merge 1 commit into
droidrun:mainfrom
8crsk:fix/mobilerun-oauth-manual-env-var
Open

fix: honour MOBILERUN_OAUTH_MANUAL across OAuth providers (part of #396)#436
8crsk wants to merge 1 commit into
droidrun:mainfrom
8crsk:fix/mobilerun-oauth-manual-env-var

Conversation

@8crsk

@8crsk 8crsk commented Sep 3, 2026

Copy link
Copy Markdown

Part of #396.

While working out what's left of the droidrun to mobilerun rename I found one
user-facing environment variable that got missed. It's a functional gap rather
than a cosmetic one.

The gap

The rename gave every user-facing env var a MOBILERUN_* spelling, keeping the
legacy DROIDRUN_* name as a fallback:

Variable MOBILERUN_* supported?
MOBILERUN_CONFIG yes, with a DeprecationWarning for the old name
MOBILERUN_TELEMETRY_ENABLED yes
MOBILERUN_STREAM_SCREENSHOTS yes, 3 call sites
OAUTH_MANUAL no, DROIDRUN_OAUTH_MANUAL only

OAUTH_MANUAL is read in all three OAuth login paths and each one only checked
DROIDRUN_OAUTH_MANUAL. Anyone setting MOBILERUN_OAUTH_MANUAL, which is the
spelling consistent with every other documented variable, silently got the
interactive browser flow instead. On a headless box that
_is_headless_environment() doesn't catch, there was no working way to force the
copy/paste login.

What this changes

  • Reads MOBILERUN_OAUTH_MANUAL first and falls back to DROIDRUN_OAUTH_MANUAL,
    matching the pattern in ConfigLoader.load and is_telemetry_enabled.
  • Documents the variable in docs/sdk/configuration.mdx. It wasn't documented
    under either name.
  • Fixes the telemetry docstrings and the user-facing "telemetry disabled" message,
    which still told people to set DROIDRUN_TELEMETRY_ENABLED even though the code
    prefers MOBILERUN_TELEMETRY_ENABLED and the docs already use the new name.

What I deliberately didn't rename

#396 reads like it could be a repo-wide find and replace, but a mechanical rename
would break existing installs. These droidrun references look load-bearing to
me, so I left them alone:

  • compat/droidrun/, the intentional backwards-compat shim package.
  • ~/.droidrun/user_id and the "droidrun" platformdirs app name. That's on-disk
    state, so renaming it orphans every existing user's config file and resets their
    anonymous telemetry id. Feels like it wants a migration step rather than a
    rename.
  • The droidrun.* OpenTelemetry span and attribute names
    (droidrun.screenshot, droidrun.vision.enabled, droidrun_version), since
    that's wire format already being consumed by existing dashboards.
  • github.com/droidrun/mobilerun URLs, because the org is still droidrun.

Happy to do the on-disk config and telemetry migration as a separate PR if you
want it. It needs a real migration path so it seemed worth keeping out of this
one.

Tests

tests/test_oauth_manual_env_var.py, 45 cases across all three providers: both
spellings, precedence when both are set, and falsy or unset values. I checked they
fail (18 failures) with the source change reverted.

Full suite: 643 passed, with the same 4 pre-existing Windows encoding failures
that occur on a clean main. ruff, black and bandit are clean.

…om telemetry docs

Part of droidrun#396 (droidrun -> mobilerun rename).

The rename gave every user-facing env var a MOBILERUN_* spelling with the
legacy DROIDRUN_* name kept as a fallback -- MOBILERUN_CONFIG,
MOBILERUN_TELEMETRY_ENABLED and MOBILERUN_STREAM_SCREENSHOTS all do this.
OAUTH_MANUAL was missed, so it remained readable only as
DROIDRUN_OAUTH_MANUAL across all three OAuth providers. A user following the
current docs had no working way to force the manual/headless login flow.

- Read MOBILERUN_OAUTH_MANUAL first, falling back to DROIDRUN_OAUTH_MANUAL,
  in the Anthropic, Gemini and OpenAI login paths.
- Document the variable in docs/sdk/configuration.mdx.
- Fix telemetry docstrings and the user-facing "telemetry disabled" message,
  which still told users to set DROIDRUN_TELEMETRY_ENABLED even though the
  code prefers MOBILERUN_TELEMETRY_ENABLED and the docs already use it.
- Add tests covering both spellings, precedence, and falsy/unset values.

Deliberately left alone, since renaming them would break existing installs
rather than finish the rename:
- compat/droidrun/, the intentional backwards-compat shim package
- ~/.droidrun/user_id and the "droidrun" platformdirs app name (on-disk
  state; renaming orphans existing users' config and telemetry ids)
- droidrun.* OpenTelemetry span and attribute names (wire format consumed
  by existing dashboards)
- github.com/droidrun/mobilerun URLs, which are the live repo paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant