Skip to content

feat(driver): CloudDriver forwards X-Owner-Id (DRO-1682)#379

Merged
RasulOs merged 1 commit into
mainfrom
lucius/dro-1682-clouddriver-owner
Jul 6, 2026
Merged

feat(driver): CloudDriver forwards X-Owner-Id (DRO-1682)#379
RasulOs merged 1 commit into
mainfrom
lucius/dro-1682-clouddriver-owner

Conversation

@lutz-grex

Copy link
Copy Markdown
Contributor

Summary

  • CloudDriver.__init__ gains an optional owner_id: str | None = None parameter.
  • When user_id is set and owner_id is provided, X-Owner-Id is added to default_headers alongside the existing X-User-ID header. When owner_id is None, behavior is unchanged (header omitted).
  • This lets the cloud device driver forward the tenancy header that devices-api now requires (devices-api #503, merged/live on dev), fixing dev device-driving 400s for the tasks-api agent.

Release / rollout note (action required by a human)

  • This PR alone does not fix the live dev incident. A new mobilerun release (e.g. 0.6.0rc6) must be cut from this change, and tasks-api's pyproject.toml pin (mobilerun[langfuse]==0.6.0rc5) must be bumped to that release, before owner_id can actually be passed through and take effect.
  • Until that release + pin bump happens, the corresponding tasks-api change is being tracked as a comment/placeholder in PR Automation #224 (lucius/dro-1682-tasks-owner-threading) — it is NOT wired up yet because the currently-pinned 0.6.0rc5 has no owner_id param and would TypeError if called with one.
  • Do not merge or release this yet — prepared as part of the dev-incident fix, still needs review/coordination with the release + pin-bump step.

Test plan

  • Added two unit tests to tests/test_cloud_driver_sdk.py:
    • test_owner_id_forwarded_as_x_owner_id_header — constructs CloudDriver(device_id="d", user_id="u", owner_id="o") and asserts the client's default_headers contains X-Owner-Id: o (no network call, mocked AsyncMobilerun).
    • test_owner_id_omitted_when_not_provided — asserts X-Owner-Id is absent when owner_id is not passed.
  • uv run pytest — full suite green (220 passed).

Part of DRO-1682

Add optional owner_id param to CloudDriver.__init__; when set alongside
user_id, include X-Owner-Id in default_headers so cloud calls carry the
tenancy header devices-api now requires (#503).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lutz-grex lutz-grex requested a review from RasulOs July 3, 2026 16:50
@RasulOs RasulOs merged commit a7ba0e9 into main Jul 6, 2026
8 checks passed
@lutz-grex lutz-grex mentioned this pull request Jul 6, 2026
2 tasks
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.

2 participants