Fix #97: Add daemon mode check to rename-prefix command

- Prevents nil pointer dereference when daemon is active
- Ensures direct mode or fails gracefully
- Lower Python requirement to 3.10+ for beads-mcp (#99)

Amp-Thread-ID: https://ampcode.com/threads/T-740c6f9c-b8f0-4155-8bfa-7075eea2df22
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-10-21 14:56:18 -07:00
parent 52d6fd8deb
commit ec946ee48b
2 changed files with 16 additions and 2 deletions

View File

@@ -35,6 +35,19 @@ Example:
ctx := context.Background()
// rename-prefix requires direct mode (not supported by daemon)
if daemonClient != nil {
if err := ensureDirectMode("daemon does not support rename-prefix command"); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
} else if store == nil {
if err := ensureStoreActive(); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}
if err := validatePrefix(newPrefix); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)