Repository navigation
feat(computer): a driver may run beside the device it drives, over adb on Android (FD-6950) - #922
michaelzheng67 wants to merge 1 commit into
Conversation
Comments Outside DiffThese findings could not be posted inline.
|
faa769a to
a4bd660
Compare
a4bd660 to
d7e5caa
Compare
d7e5caa to
ca6bdcc
Compare
…b on Android (FD-6950)
ca6bdcc to
2b4ed92
Compare
| assignments = "".join(f"{shlex.quote(f'{name}={value}')} " for name, value in (env or {}).items()) | ||
| command = (f"cd {folder} 2>/dev/null || {{ echo '{CANNOT_RUN} no such folder' >&2; exit 127; }}; " | ||
| f"command -v {program} >/dev/null 2>&1 || {{ echo '{CANNOT_RUN} not found' >&2; exit 127; }}; " | ||
| f"exec {'env ' + assignments if assignments else ''}{shlex.join(argv)}") |
There was a problem hiding this comment.
run_in_session checks command -v before applying env. A caller that supplies a custom PATH to run a program in /data/local/tmp, for example, gets InvalidArgument even though that program exists in the requested environment. Check for the program using the supplied environment too.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/agentenv-protocol/src/agentenv_protocol/computer/_adb.py
Line: 39-42
Comment:
**Custom program paths fail**
`run_in_session` checks `command -v` before applying `env`. A caller that supplies a custom `PATH` to run a program in `/data/local/tmp`, for example, gets `InvalidArgument` even though that program exists in the requested environment. Check for the program using the supplied environment too.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
What and why
this patch looks to provide initial support for an android environment by 1. allowing for drivers to run beside the device as android driver will reach its device emulator through adb and 2. allow for read / write of files on android through adb commands
note: since we don't run in-device, things such as probes are replaced with ops through the dataplane instead of python logic, etc
How it was tested
unit tests pass, adb commands confirmed with emulator run
Fix the program lookup in
_adb.pybefore merging so commands honor the caller'sPATH.Fix with agent prompt
Summary
Adds groundwork for drivers that run beside a device and reach Android through adb.
Downloadfolder.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR Caller --> Driver[Computer driver beside device] Driver -->|commands and file transfers| ADB[adb] ADB --> Device[Android device] Driver -->|keeps recordings| Home[Driver home] Device -->|device files| Export[data/get] Home -->|recording files| ExportReviews (5) · Last reviewed commit: "feat(computer): a driver may run beside ..." · Reviewed by Greptile