feat: add sandbox remote-run (rr)#175
Open
Mukil Loganathan (langchain-infra) wants to merge 1 commit into
Open
feat: add sandbox remote-run (rr)#175Mukil Loganathan (langchain-infra) wants to merge 1 commit into
Mukil Loganathan (langchain-infra) wants to merge 1 commit into
Conversation
Mukil Loganathan (langchain-infra)
force-pushed
the
feat/sandbox-remote-run
branch
from
July 8, 2026 20:54
0d2cebc to
2573af3
Compare
Mukil Loganathan (langchain-infra)
force-pushed
the
feat/sandbox-remote-run
branch
from
July 8, 2026 20:59
2573af3 to
e0f399e
Compare
Mukil Loganathan (langchain-infra)
force-pushed
the
feat/sandbox-remote-run
branch
from
July 8, 2026 23:47
e0f399e to
7248a6e
Compare
Adds `langsmith sandbox remote-run` (alias `rr`): mirror the current git worktree into a LangSmith sandbox and run a command there. It creates or starts a deterministic per-user sandbox, provisions SSH/rsync inside it, syncs committed (HEAD) plus uncommitted local changes, and runs the command from the mirrored checkout. Supports named sandboxes, snapshot selection, opt-in secrets sync, and port tunneling (`--tunnel` forwards every port in `.env.ports.override` to localhost while the command runs).
Mukil Loganathan (langchain-infra)
force-pushed
the
feat/sandbox-remote-run
branch
from
July 9, 2026 01:10
7248a6e to
f533a2a
Compare
| cmd.Flags().BoolVar(&in.WorktreeSandbox, "worktree-sandbox", in.WorktreeSandbox, "Use a sandbox name derived from the current worktree instead of git user.email") | ||
| cmd.Flags().BoolVar(&in.NoSync, "no-sync", in.NoSync, "Skip pushing and rsyncing the repo; run against the sandbox's existing checkout") | ||
| cmd.Flags().BoolVar(&in.NoMise, "no-mise", in.NoMise, "Run the command directly instead of through mise") | ||
| cmd.Flags().BoolVar(&in.Tunnel, "tunnel", in.Tunnel, "Forward every port in .env.ports.override to localhost and keep running after the command") |
There was a problem hiding this comment.
🔍 Tunnel flag description implies persistent forwarding with commands, but forwards close when command exits
The --tunnel flag description at line 108 says 'keep running after the command', but when both --tunnel and a command are provided, the port forwards are attached to the SSH session running the command (internal/cmd/sandbox_remote_run.go:462). When the command exits, SSH exits and forwards close. Persistent forwarding only happens when --tunnel is used without a command (lines 455-459, which calls rrSSHTunnelConn). The flag description could be clarified to distinguish these two modes.
Was this helpful? React with 👍 or 👎 to provide feedback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
langsmith sandbox remote-run(aliasrr): mirror the current git worktree into a LangSmith sandbox and run a command there.dev-<git user.email>by default;--sandbox/--worktree-sandboxto override).sshd+rsyncin the box, opens an SSH tunnel to it.miseunless--no-mise).--tunnelforwards every port in.env.ports.overrideto localhost while the command runs.git,ssh,rsync, and GitHub CLI auth (orGH_TOKEN/GITHUB_TOKEN) for private-repo cloning inside the box.Provenance
Prototyped in the downstream monorepo mirror (
langchain-ai/langchainplusPR #29607) and moved here to the source-of-truth CLI repo. It will flow back intolangchainplus/sdks/clivia the usual resync.Test plan
go build ./...,go test ./internal/cmd/...,gofmt— all green (5rrunit tests + existing sandbox tests).sandbox rr --sandbox <box> -- …— committed HEAD and an untracked file both landed in the mirrored worktree on the box.sandbox rr --tunnel -- <server>— a port from.env.ports.overridewas forwarded to localhost; reached the in-box server through it and pulled synced files back; forward closed cleanly on exit.