From 6cd4c450b13d21cc69f3f974a9e3dba28d7fd69c Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 14 Mar 2026 00:09:16 +0100 Subject: [PATCH] Assist: read mount_beads.sh via 9p client instead of shelling out Use readFile() to fetch the script over the existing 9p connection, then pipe it to bash -s. Removes dependency on the 9p CLI binary. Co-Authored-By: Claude Sonnet 4.6 --- cmd/Assist/main.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/Assist/main.go b/cmd/Assist/main.go index f65df45..c6ed73a 100644 --- a/cmd/Assist/main.go +++ b/cmd/Assist/main.go @@ -3,6 +3,7 @@ package main import ( "anvillm/internal/logging" + "bytes" "encoding/json" "flag" "fmt" @@ -2652,11 +2653,13 @@ func initBeads(prefix string, mount string) error { // mountProject mounts cwd via mount_beads.sh mcptool and returns the generated mount name. // friendly is optional (may be empty); if provided it is passed to the script for display only. func mountProject(cwd, friendly string) (string, error) { - if !isConnected() { - return "", fmt.Errorf("not connected to anvilsrv") + script, err := readFile("tools/mount_beads.sh") + if err != nil { + return "", fmt.Errorf("read mount_beads.sh: %w", err) } - args := []string{"-c", "bash <(9p read anvillm/tools/mount_beads.sh) \"$0\" \"$1\"", cwd, friendly} - out, err := exec.Command("bash", args...).Output() + cmd := exec.Command("bash", "-s", "--", cwd, friendly) + cmd.Stdin = bytes.NewReader(script) + out, err := cmd.Output() if err != nil { return "", fmt.Errorf("mount_beads.sh: %w", err) }