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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user