Drop per-task port blocks; previews use any free loopback port
This commit is contained in:
@@ -39,7 +39,7 @@ func (m *Manager) bashTool(l *live) mcp.Tool {
|
||||
return mcp.Tool{
|
||||
Name: "bash",
|
||||
Description: "Run a shell command on the Mac byre runs on, in your task's worktree, with $SHELL as a login shell, and get its exit status and output (stdout and stderr together, the last 64 KiB). " +
|
||||
"byre runs it itself, outside any sandbox your own shell tool has, with byre's environment and $PORT set to this task's first port. " +
|
||||
"byre runs it itself, outside any sandbox your own shell tool has, with byre's environment. " +
|
||||
"Stdin is empty. The command runs in its own process group, which is killed at the timeout.",
|
||||
InputSchema: json.RawMessage(`{
|
||||
"type": "object",
|
||||
@@ -65,10 +65,6 @@ func (m *Manager) bash(ctx context.Context, l *live, raw json.RawMessage) (strin
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
task, err := m.store.GetTask(ctx, l.taskID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
shell := os.Getenv("SHELL")
|
||||
if shell == "" {
|
||||
return "", errors.New("SHELL is not set in byre's environment")
|
||||
@@ -78,7 +74,6 @@ func (m *Manager) bash(ctx context.Context, l *live, raw json.RawMessage) (strin
|
||||
defer cancel()
|
||||
cmd := procgroup.CommandContext(cctx, shell, "-l", "-c", args.Command)
|
||||
cmd.Dir = l.dir
|
||||
cmd.Env = append(os.Environ(), portEnv(task)...)
|
||||
cmd.WaitDelay = 5 * time.Second
|
||||
out := &tailWriter{}
|
||||
cmd.Stdout = out
|
||||
|
||||
Reference in New Issue
Block a user