Repository navigation
Closed
1 / 11 of 1 issue completedClosed
1 / 11 of 1 issue completed
Copy link
Labels
feature:plannedSplit into tasks. Never picked up itself.
Description
Request: #1172
Problem
simlock adb and simlock simctl against a gateway never run their command when stdin is a pipe that stays open. They wait for stdin to close first, so a caller that spawns the CLI with a piped stdin it never closes hangs forever with no output. Coding agents and scripts often start child processes that way.
Who it is for
A coding agent, CI job or script that runs simlock adb or simlock simctl through a gateway, from a harness that hands the CLI a piped stdin and never closes it.
Outcome
- Through a gateway,
simlock adbandsimlock simctlrun their command at once, whatever stdin is: an open pipe, a closed pipe, a file or a terminal. - A caller that wants to send input passes
--stdin. The CLI then reads stdin to its end (Ctrl-D at a terminal) and sends it to the command. - Without
--stdin, the command gets empty input and sees end of input at once. - On a worker nothing changes: the command runs here with the caller's own stdin, and
--stdinis accepted and ignored.
How it works for the user
flowchart TD
A[agent runs simlock adb ... through a gateway] --> B{--stdin given?}
B -->|no| C[command runs at once, empty input]
B -->|yes| D[CLI reads stdin to its end]
D -->|stdin ends| E[command runs with that input]
D -->|stdin never ends| F[waits, as the caller asked]
C --> G[output streams back, CLI exits with the tool's code]
E --> G
Before, through a gateway, from a harness whose stdin pipe stays open:
$ simlock adb shell getprop ro.build.version.sdk
(nothing; never returns)
$ echo hello | simlock adb shell cat
hello
After:
$ simlock adb shell getprop ro.build.version.sdk
36
$ echo hello | simlock adb shell cat
(prints nothing: cat gets empty input)
$ echo hello | simlock adb --stdin shell cat
hello
$ simlock adb --lease w1.3f9c --stdin shell cat < notes.txt
(the contents of notes.txt)
Examples
| Command through a gateway | stdin | Today | After |
|---|---|---|---|
simlock adb shell getprop |
pipe left open | hangs forever | runs at once |
simlock adb shell getprop |
terminal | runs | runs |
simlock adb shell getprop |
< /dev/null |
runs | runs |
echo x | simlock adb shell cat |
closed pipe | prints x |
prints nothing |
echo x | simlock adb --stdin shell cat |
closed pipe | --stdin goes to adb as an argument |
prints x |
simlock adb --stdin shell cat |
terminal | --stdin goes to adb as an argument |
reads until Ctrl-D, then prints it |
simlock adb --stdin --lease L shell cat < f |
file | --stdin goes to adb as an argument |
prints f |
simlock adb --lease L --stdin shell cat < f |
file | --stdin goes to adb as an argument |
prints f |
simlock adb shell cat |
terminal | waits until the exec timeout | prints nothing, exits at once |
simlock adb shell --stdin |
any | --stdin goes to adb |
--stdin still goes to adb (after the tool's first argument) |
What could go wrong
- A script that pipes input into a remote
adb shellwithout the new flag sends nothing, and its command sees empty input. Likely now and then until scripts add--stdin; the release notes say so. - A caller passes
--stdinfrom a harness whose pipe never closes, and the command waits. That is what it asked for.
Words used
- stdin: the input a command reads, e.g. the text in
echo x | simlock adb shell cat. - through a gateway: the CLI talks to a gateway, and the command runs on the worker that holds the lease.
- one-shot input: the whole input is read first, then sent once; nothing is sent while the command runs.
Non-goals
- Sending input while the command runs, or a real interactive
adb shell(no live keystrokes, no terminal on the far side). A separate request. - Any change on a worker, over HTTP, in MCP or on the gateway uplink.
- A deprecation period or a warning release.
Completion conditions
- Through a gateway,
simlock adbwith a piped stdin left open runs its command and exits with the tool's code (fast e2e, fake devices). - Through a gateway,
--stdinsends what stdin carried, and without it the command gets empty input. - On a worker,
--stdinis accepted and ignored. - The CLI reference and the CLI's manual describe
--stdin, and the known gap about the hang is gone.
Open questions
none
Decisions
- ADR 0058 (PR docs(adr): 0058 through a gateway, simlock adb and simctl send stdin only with --stdin #1175, Accepted — not yet implemented) — Through a gateway,
simlock adbandsimlock simctlsend stdin only with--stdin; narrows ADR 0005 §19c.
Shared values
none
Behaviours
| Behaviour (invoker, action, what it sees) | Seam | Cases | Task |
|---|---|---|---|
A user runs simlock adb or simlock simctl through a gateway, and device.exec carries stdin only when --stdin was given |
runCli in src/cli/index.test.ts, fake gateway client |
adb and simctl; no flag with a stdin that never ends → sent with stdin: "", stdin never read; --stdin → stdin's contents sent; --stdin before --lease and after it; --stdin after the tool's first argument → passed to the tool |
#1176 |
A user runs simlock adb --stdin on a worker, and the flag is accepted and ignored |
runCli in src/cli/index.test.ts, fake worker client |
--stdin alone; with --lease |
#1176 |
A user passes --stdin at a terminal, and the CLI reads what they type until it ends |
readPipedStdin tests in src/cli/index.test.ts |
terminal stdin → its chunks joined; piped stdin as today | #1176 |
An agent runs simlock adb through a real gateway with a piped stdin left open, and the command runs, gets empty input and exits with the tool's code |
e2e/gateway-smoke.test.ts, fake devices |
the existing exec step without input: "", with --fake-exec-echo-stdin showing "" |
#1176 |
Tasks
- Through a gateway, simlock adb and simctl send stdin only with --stdin #1176 Through a gateway,
simlock adbandsimlock simctlsend stdin only with--stdin— a caller on an open pipe no longer hangs. Risk: a script that pipes input without the flag silently sends nothing.
Completion conditions: all four are #1176's Done when.
Open work in the same area:
- A remote caller's leased device reaches ports on the caller's machine, and back #1110's tunnel stack (PRs feat(tunnel): reverse a leased Android device's port over a lease WebSocket on a worker #1121–feat(tunnel): simlock tunnel forward reaches a leased device's port from the caller's machine #1127): touches
src/cli/(a newtunnelcommand,remote-lease.ts) but notpassthrough.tsorstdio.ts. No Depends on. - The fleet serves only agent-device users: CLI agents, CI runners and operators each hit a gap #945 (request): CLI remote mode. A later remote
adbreuses the same rule. No Depends on.
Written by an agent.
Sub-issues
Collapse Sub-issuesSub-issues
Loading 1 sub-issues
Metadata
Metadata
Assignees
Labels
feature:plannedSplit into tasks. Never picked up itself.
Activity
V3RON commentedon Nov 1, 2026
Spec updated: Problem through Behaviours written, with ADR 0058 (PR #1175) and task #1176.
Written by an agent.
docs(adr): 0058 cites the lines that read stdin (#1174)
docs(adr): 0058 is accepted, not yet implemented (#1174)
docs(adr): 0058 through a gateway, simlock adb and simctl send stdin …
feat(cli)!: through a gateway, simlock adb and simctl send stdin only…
github-actions commentedon Nov 1, 2026
Closing: all 1 sub-issues are closed. The PR that closed the last one walks the completion conditions (delivery rule 9); reopen this if one does not hold on
main. Flip its ADRs to Accepted if delivery has not.V3RON commentedon Nov 1, 2026
Delivery run
Merged: #1175 (ADR 0058, now Accepted), #1178 (#1176)
Written by an agent.