From ab5f9705cd5fc13ae6ecdd05b7ce35556c708dae Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sun, 15 Feb 2026 11:47:11 +0100 Subject: [PATCH] Remove redundant Refresh command from Acme interface Get command now simply reads from agent/list since anvilsrv handles session state management. Removed client-side PID checking and refresh logic. --- README.md | 5 ++--- cmd/Assist/main.go | 34 +--------------------------------- 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 2b9f4cf..dad12cd 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ Type `Assist` in Acme and middle-click to open the `/AnviLLM/` session manager. ### Commands -**Main window** (`/AnviLLM/`) tag: `Get Attach Stop Restart Kill Refresh Alias Context Daemon Sandbox` +**Main window** (`/AnviLLM/`) tag: `Get Attach Stop Restart Kill Alias Context Daemon Sandbox` | Command | Description | |---------|-------------| @@ -214,7 +214,6 @@ Type `Assist` in Acme and middle-click to open the `/AnviLLM/` session manager. | `Stop ` | Stop session (preserves tmux) | | `Restart ` | Restart stopped session | | `Kill ` | Terminate session | -| `Refresh ` | Re-detect session state | | `Attach ` | Open tmux terminal | | `Alias ` | Name a session | | `Context ` | Edit context (prepended to prompts) | @@ -240,7 +239,7 @@ agent/ └── / ├── in # Write prompts ├── out # Read responses - ├── ctl # "stop", "restart", "kill", "refresh" + ├── ctl # "stop", "restart", "kill" ├── state # starting, idle, running, stopped, error, exited ├── context # Prepended to prompts (r/w) ├── alias # Session name (r/w) diff --git a/cmd/Assist/main.go b/cmd/Assist/main.go index c1846a0..6819ba9 100644 --- a/cmd/Assist/main.go +++ b/cmd/Assist/main.go @@ -12,7 +12,6 @@ import ( "regexp" "strings" "sync" - "syscall" "time" "9fans.net/go/acme" @@ -93,7 +92,7 @@ func main() { defer w.CloseFiles() w.Name(windowName) - w.Write("tag", []byte("Get Attach Stop Restart Kill Refresh Alias Context Daemon Sandbox ")) + w.Write("tag", []byte("Get Attach Stop Restart Kill Alias Context Daemon Sandbox ")) refreshList(w) w.Ctl("clean") @@ -209,20 +208,6 @@ func main() { } } refreshList(w) - case "Refresh": - if arg == "" { - // Refresh all sessions - sessions, _ := listSessions() - for _, sess := range sessions { - controlSession(sess.ID, "refresh") - } - } else { - if err := controlSession(arg, "refresh"); err != nil { - fmt.Fprintf(os.Stderr, "Failed to refresh session: %v\n", err) - continue - } - } - refreshList(w) case "Context": if arg == "" { fmt.Fprintf(os.Stderr, "Usage: Context \n") @@ -527,23 +512,6 @@ func refreshList(w *acme.Win) { buf.WriteString(fmt.Sprintf("%-5s %-10s %-9s %-16s %s\n", "-----", "----------", "---------", "----------------", strings.Repeat("-", 40))) for _, sess := range sessions { - // Check if PID is alive (server handles this via Refresh) - if sess.Pid != 0 { - if err := syscall.Kill(sess.Pid, 0); err != nil { - // Only refresh if process doesn't exist (ESRCH) - // Ignore permission errors (EPERM) - process exists but we can't signal it - if err == syscall.ESRCH { - // Process died, trigger refresh - fmt.Fprintf(os.Stderr, "Warning: session %s PID %d died, refreshing\n", sess.ID, sess.Pid) - controlSession(sess.ID, "refresh") - // Re-read session info - if updated, err := getSession(sess.ID); err == nil { - sess = updated - } - } - } - } - alias := sess.Alias if alias == "" { alias = "-"