Skip to content

fix(android): write the adb server's output to logs/adb-server.log - #1171

Merged
V3RON merged 7 commits into
mainfrom
bug/1169
Nov 1, 2026
Merged

V3RON merged 7 commits into
mainfrom
bug/1169

Conversation

@V3RON

@V3RON V3RON commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1169

Status

Implement: done (29/29 green) Review: round 1 + 3 fix-checks passed, R1, R2, R6 fixed Hardware: n/a Gate: running

Done when

  • Simlock's adb server writes its stdout and stderr to <simlock home>/logs/adb-server.log, a file created with mode 0600 and truncated each time Simlock starts a server, instead of stdio: "ignore".
  • ADB_TRACE set in the daemon's environment reaches the adb server, so its trace lands in that file.
  • The Android troubleshooting docs say where the file is and how to turn on ADB_TRACE to debug a device that drops off adb.

Assumptions

  • Assumption: how the real runner hands the log file to the child — stdio: { file }: the supervisor creates the file (0600, replaced so it is empty) through Filesystem, and NodeProcessRunner.spawn opens it for append and hands the fd to the child; the smallest change to the port.
  • Assumption: whether ADB_TRACE needs code — no: the server's env is the daemon's env spread under the scoped variables, so it passes through, and the existing spread covers it.

Review

Spec review: 1 blocking, 1 fixed, 0 notes. Code review: 3 blocking, 3 fixed, 1 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 1. Tokens: 15.4M.
Runs: 13. Cost USD: 3.0632. Agent seconds: 1157.
Assessment: complete

Rejected:

  • spec: the { file: logPath } assertion at adb-server.test.ts:100 repeats the one at line 86 — [nonblocking] line 86 is the existing start test updated for the new stdio, line 100 sits in the test the Tests line asks for

Written by an agent.

@V3RON

V3RON commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

Question: the agreed Tests line stops at the fake process runner. Nothing exercises NodeProcessRunner.spawn opening the { file } stdio (append, mode 0600) and handing the descriptor to the child (src/ports/process-runner.ts).

Options:

  • Add a test in src/ports that spawns a real child with { file } and checks that its stdout and stderr land in the file, appended, with mode 0600. If the real path is broken, users would otherwise get an empty or missing adb-server.log, and only this test catches it.
  • Leave it untested. The fake-runner test still passes even when the real runner never writes the file.

Taken: add the test. It's the conservative choice and costs one test file. Reverting it means deleting that test.

Written by an agent.

@V3RON

V3RON commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 0c75b85
Round fix-check: 50858db
Round fix-check: 5bc6e8d
Round fix-check: bee3098

Runs: 13. Cost USD: 3.0632. Agent seconds: 1157.
Tokens input 330, output 73829, cache read 6299495, cache write 487698.
- build implementer: claude-sonnet-5-5 231 s $0.5453
- audit implementer: claude-sonnet-5-5 55 s $0.1589
- fix implementer: claude-sonnet-5-5 48 s $0.1252
- review 1 reviewer: claude-sonnet-5-5 288 s $0.242
- review 1 spec: claude-sonnet-5-5 19 s $0.0955
- review 1 code both: claude-opus-5-5 211 s $0.9499
- review 1 claims: claude-sonnet-5-5 33 s $0.1394
- fix implementer: claude-sonnet-5-5 61 s $0.162
- review fix-check reviewer: claude-sonnet-5-5 53 s $0.1304
- fix implementer: claude-sonnet-5-5 36 s $0.1291
- review fix-check reviewer: claude-sonnet-5-5 82 s $0.2371
- fix implementer: claude-sonnet-5-5 26 s $0.0819
- review fix-check reviewer: claude-sonnet-5-5 14 s $0.0665
Finding outcomes: {"duplicate":1,"fixed":3,"nonblocking":2}. Classes: {"Fallow CRAP on test helper":1,"architecture 13 comment made false":1,"fd not released on sync throw":1,"testing 3 error path untested":2,"testing 7 duplicate assertion":1}.
{"findings":[{"id":"R1","role":"code","class":"architecture 13 comment made false","outcome":"fixed","path":"src/drivers/android/index.ts","round":"1","fix":"694ccb9c0"},{"id":"R2","role":"code","class":"testing 3 error path untested","outcome":"fixed","path":"src/drivers/android/adb-server.ts","round":"1","fix":"50858db65"},{"id":"R3","role":"spec","class":"testing 3 error path untested","outcome":"duplicate","path":"src/drivers/android/adb-server.ts","round":"1","canonicalId":"R2"},{"id":"R4","role":"code","class":"fd not released on sync throw","outcome":"nonblocking","path":"src/ports/process-runner.ts","round":"1"},{"id":"R5","role":"spec","class":"testing 7 duplicate assertion","outcome":"nonblocking","path":"src/drivers/android/adb-server.test.ts","round":"1"},{"id":"R6","role":"code","class":"Fallow CRAP on test helper","outcome":"fixed","path":"src/drivers/android/adb-server.test.ts","round":"fix-check","fix":"bee30986f"}]}

Written by an agent.

@V3RON

V3RON commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • code: src/ports/process-runner.ts:245-256: if spawnChildProcess throws synchronously (for example ENOTDIR), closeSync(logFd) is skipped, so each failed start leaks one file descriptor.

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 1, 2026 12:44
@V3RON
V3RON merged commit d0c2664 into main Nov 1, 2026
56 checks passed
@V3RON
V3RON deleted the bug/1169 branch November 1, 2026 13:06
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.

Simlock discards its adb server's output, so a transport drop leaves no record

1 participant