Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
`artemis batch` had no device option and dropped ADB_DEVICE_SERIAL / ARTEMIS_DEVICE_ID on both paths, so with several devices attached the goals ran on whichever device the tool picked (first idle device via the daemon queue, first listed device standalone). - batch: add `--device-serial/-s`, falling back to ADB_DEVICE_SERIAL / ARTEMIS_DEVICE_ID; pass it to submit_batch_to_daemon() and bind it with for_device() in run_batch_tasks(). - AgentConfigBuilder.build(): an env-provided serial now defaults device_platform to ANDROID. Agent._init_internal() falls back to get_first_device() when either field is missing, which silently discarded the serial. Fixes google#135
LunarECL
force-pushed
the
fix/batch-device-serial
branch
from
September 20, 2026 02:03
e5ade39 to
f4f3393
Compare
Author
|
@googlebot I signed it! |
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
artemis batchignores the requested device serial (no--device-serial; ADB_DEVICE_SERIAL / ARTEMIS_DEVICE_ID silently dropped) and can run goals on another phone #135.artemis batchignores the requested device. There is no--device-serialoption, andADB_DEVICE_SERIAL/ARTEMIS_DEVICE_IDare silently dropped, so the goals run on whichever device the tool picks (first idle device via the daemon queue, first listed device standalone) while the batch still reportsPASS.batch.pynever passed a serial tosubmit_batch_to_daemon()(which already acceptsdevice_serial) and never calledfor_device()on the standalone builder.AgentConfigBuilder.build()copied the env serial intodevice_idbut leftdevice_platformasNone;Agent._init_internal()falls back toget_first_device()when either field is missing.batchgains--device-serial/-sand threads it through both paths; an env-provided serial now defaults the platform toANDROID, the same defaultfor_device(str)already applies. Explicitfor_device()/-sstill win over the environment, and with no serial anywhere the first-device fallback is unchanged.AgentConfigBuilder.build()already used: explicit value, thenARTEMIS_DEVICE_ID, thenADB_DEVICE_SERIAL.batchreads the environment in the same order, so with both variables set the CLI and the SDK config resolve to the same device (covered by tests on both routing paths).Regression evidence
Ten new tests; six of them fail on
371aa6dand pass with this change (the other four pin the unchanged behaviour: no-serial fallback, explicit override, env precedence):git checkout 371aa6d -- artemis/):uv run pytest tests/unit/test_cli.py -k device_serial -q→4 failed;uv run pytest tests/unit/sdk/test_agent_config_builder_device.py -q→2 failed, 2 passeduv run pytest tests/unit/test_cli.py -k batch tests/unit/sdk/test_agent_config_builder_device.py -q→12 passedOn a real farm (6 Samsung devices over wireless adb,
10.60.0.101:5555listed first),uv run artemis batch -f goals.txt -p flash -s 10.60.0.108:5555now logsDevice ID: 10.60.0.108:5555on both the daemon path and--standalone; before the change both logged10.60.0.101:5555.Verification
make test(uv run pytest) on this branch: 4 failed, 2197 passed, 6 skipped, 8 deselected (60.8 s)make teston untouched371aa6dwith only the new test files present: 6 failed, 2187 passed — the same 4 pre-existing failures plus the 2 new builder tests that are expected to fail before the fixuv run ruff check/uv run ruff format --checkon the four changed files → cleanuv run python scripts/quality_ratchet.py→ unchanged (754 / 0 / 18)make typecheck→ 0 errors, 0 warningsScope
Existing full-suite limitations
The 4 failures are identical on the untouched base commit on this machine (macOS 27 arm64, Python 3.12.13) and are unrelated to the batch/builder code paths touched here:
tests/unit/mcp/test_adb_server_contract.py::test_adb_server_manifest_matches_fixturetests/unit/mcp/test_device_utils.py::test_ensure_emulator_uses_windows_creation_flags(see test_ensure_emulator_uses_windows_creation_flags can only pass on Windows #97)tests/unit/test_cli.py::test_cli_mcp_install_alltests/unit/test_cli.py::test_cli_mcp_install_codex_preserves_config_and_is_idempotent