style(smolmachines): address PR #83 review comments
- bottle.py:_PTY_RESIZE_SCRIPT docstring: strip the speculative cwd-dependence explanation. The real reason to use absolute path is just that the wrapper is self-contained; the original rationale (tmux pane cwd) was a hypothesis we never confirmed and wasn't load-bearing once we found the libkrun race. - pty_resize.py:main: drop the long comment duplicating `_STARTUP_SYNC_DELAY_SEC`'s docstring. Keep a one-liner pointing at the constant + the operational note about daemon=True. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -132,23 +132,9 @@ def main(argv: list[str]) -> int:
|
||||
signal.signal(signal.SIGWINCH, sync)
|
||||
|
||||
proc = subprocess.Popen(inner)
|
||||
# Defer the initial sync. Firing it immediately races
|
||||
# libkrun's per-exec OCI config write: both `smolvm machine
|
||||
# exec` invocations stash a config.json in the same smolvm
|
||||
# state dir during their bringup window, libkrun loads one
|
||||
# mid-write, and the main exec dies with SIGKILL (rc=137)
|
||||
# or libkrun's "parse error: trailing garbage" depending on
|
||||
# scheduling. Trivial inner commands finish before the
|
||||
# overlap matters; claude's slower startup hits the race
|
||||
# every time, only inside tmux (the outside-tmux foreground
|
||||
# handoff path takes a different bringup sequence that
|
||||
# happens to dodge the window).
|
||||
#
|
||||
# A 2s timer is past the bringup window on a warm VM, so
|
||||
# the side-channel writes a fresh config.json without
|
||||
# collision, and the in-VM PTY is sized before claude has
|
||||
# finished rendering its first frame. daemon=True so the
|
||||
# timer doesn't block exit when the child finishes quickly.
|
||||
# Initial sync is deferred — see _STARTUP_SYNC_DELAY_SEC.
|
||||
# daemon=True so the timer doesn't block exit when the child
|
||||
# finishes before the delay elapses.
|
||||
timer = threading.Timer(_STARTUP_SYNC_DELAY_SEC, sync)
|
||||
timer.daemon = True
|
||||
timer.start()
|
||||
|
||||
Reference in New Issue
Block a user