Repository navigation
feat(ctx): bind mailbox by label - #27
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
RasulOs
previously approved these changes
Nov 30, 2026
RasulOs
approved these changes
Nov 30, 2026
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.
Summary
The context is a set of ports whose adapters differ for local, cloud and tests. A
Mailboxis now chosen by its declaration instead of by run data, the proxy comes from the device, and scripts can run against fake adapters offline.Changes
binding(label="...")on aMailboxresolves the mailbox you own with exactly that label through the SDK (paginated list), locally with your API key and in the cloud with the run key. Without a label the only mailbox is used; no match or several matches fail beforemainwith aNotAvailableErrorthat names the label.inspectoutput is unchanged:requires.mailboxstays a boolean and the label is not emitted.Proxyreads the proxy of the run's device; it no longer connects a proxy or needs run data.ProxyKind,ProxyRef,RunInfo.mailbox_id/proxyand the CLI flags--mailbox-id,--proxy-kind,--proxy-id.mobilerun_functions.testing(FakeDevice,FakeMailbox,FakeProxy,run_script) andContext(run, **ports)to inject explicit adapters; documented in the README.Testing
mypy,ruffandpytest(495 tests) pass.Runtime
UNVERIFIED — needs a run against a cloud device and mailbox after the next functions release.
Rollout
Breaking for scripts that pass
--mailbox-idor--proxy-*(the flags are gone). Scripts with a baremailbox: Mailboxkeep working when the account has exactly one mailbox. Needs a functions release before the executor image picks it up; sandbox run-start fields are removed separately.🤖 Generated with Claude Code