Commit a3c79b4
committed
fix(opencode): address final-review findings
Follow-ups from the branch-level code review. All low-risk fixes that
came up during verification/review of the otherwise-ready feature.
- RemoteHost.launch_opencode: read the opencode server password from a
mode-0600 file in the workdir via `$(cat ...)` rather than inlining
it into the command string. Previously any local user on the remote
host could read the basic-auth password from the bash process's argv
via `ps aux` during the launch window. Env variables (asyncssh
create_process env=) would be cleaner but OpenSSH's default
AcceptEnv won't forward arbitrary names, so a mode-0600 file the
command substitutes at exec time is the portable fix.
- RemoteHost.terminate_opencode(aggressive=True): use proc.kill()
(SIGKILL) instead of proc.terminate() (SIGTERM). The spec's
cancellation path expects SIGKILL; with SIGTERM an opencode that
blocks on shutdown would eat the 5-second shutdown grace period.
LocalHost was already correct.
- LocalHost.tail_log / RemoteHost.tail_log: document why we use
`tail -F -n +1` instead of the spec's `-n 0`. Fresh workdir + race-
free at-least-once delivery (an earlier `-n 0` attempt silently
dropped log lines that opencode wrote between subprocess spawn and
our tail subscribing).
- Remove unused `aiofiles>=23.0` dependency (the module docstring
mentioned it but the implementation spawns a `tail` subprocess;
aiofiles was never imported). Update host.py's module docstring.
- AGENTS.md: add a "Where the fork lives" paragraph pointing at
github.com/csillag/opencode #csillag/make-web-embeddable-in-iframes,
the upstream PR anomalyco/opencode#23912, and the build command so
someone picking up this branch cold can populate
OPTIO_OPENCODE_BINARY_DIR without hunting for the right repo.
Deferred review items (no change in this commit): remote-mode
cancellation test (spec Section 9 coverage gap), routing install
stderr through ctx.report_progress (nice-to-have), cosmetic
file-touch idiom, demo-task inner.execute clarification, SFTP-over-
SSH retry path not exercised by tests, negative-cache comment
consolidation.1 parent d0e22fa commit a3c79b4
3 files changed
Lines changed: 45 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
91 | 102 | | |
92 | 103 | | |
93 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
281 | 289 | | |
282 | 290 | | |
283 | 291 | | |
| |||
495 | 503 | | |
496 | 504 | | |
497 | 505 | | |
498 | | - | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
499 | 520 | | |
500 | 521 | | |
501 | | - | |
| 522 | + | |
502 | 523 | | |
503 | 524 | | |
504 | 525 | | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
509 | 530 | | |
510 | 531 | | |
511 | 532 | | |
| |||
543 | 564 | | |
544 | 565 | | |
545 | 566 | | |
| 567 | + | |
| 568 | + | |
546 | 569 | | |
547 | 570 | | |
548 | 571 | | |
| |||
564 | 587 | | |
565 | 588 | | |
566 | 589 | | |
567 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
568 | 594 | | |
569 | 595 | | |
570 | 596 | | |
| |||
0 commit comments