Skip to content

fix(sandboxr): apply srt startup-race workaround to shell command#720

Merged
mkobit merged 1 commit into
mainfrom
fix/sandboxr-shell-wrap-command
Jul 15, 2026
Merged

fix(sandboxr): apply srt startup-race workaround to shell command#720
mkobit merged 1 commit into
mainfrom
fix/sandboxr-shell-wrap-command

Conversation

@mkobit

@mkobit mkobit commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • sandboxr shell built its argv as backend.build_args() + shell_cmd, never calling backend.wrap_command() — unlike run/doctor, which both correctly do [*build_args(...), *wrap_command(cmd)].
  • For the srt backend this meant shell had no protection against the known startup-race bug (srt's internal proxy bridges aren't ready for ~150-200ms after launch — the first request can fail instantly without a grace sleep). run and doctor already work around this; shell didn't.
  • Fixed by mirroring run.py's pattern: *backend.wrap_command([shell_cmd]).

Test plan

  • Added test_shell_srt_backend_show_command_applies_startup_race_workaround, confirmed it fails against the pre-fix code (asserted sleep 0.2; exec ... is embedded in the wrapped command), then confirmed it passes after the fix.
  • Full suite (141 tests), ruff, ty all clean.
  • CI green.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

`sandboxr shell` built its argv as backend.build_args() + the raw shell
command, never calling backend.wrap_command() — unlike run/doctor, which
both correctly wrap the command. For the srt backend this meant `shell`
had no protection against the known proxy-startup race (srt's internal
proxy bridges aren't ready for ~150-200ms after launch), unlike `run`
and `doctor`.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mkobit mkobit merged commit 27c0b05 into main Jul 15, 2026
6 checks passed
@mkobit mkobit deleted the fix/sandboxr-shell-wrap-command branch July 15, 2026 13:38
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.

1 participant