feat: auto-bypass daemon for wisp operations (bd-ta4r)
Wisp operations (mol wisp *, mol burn, mol squash) and commands operating on ephemeral issue IDs (bd-eph-*, gt-eph-*, eph-*) now auto-bypass the daemon. Since wisps are ephemeral (Ephemeral=true) and never exported to JSONL, the daemon cannot help with them anyway. This eliminates the need to manually add --no-daemon for every wisp operation. Changes: - Add isWispOperation() helper to detect wisp commands and ephemeral IDs - Add FallbackWispOperation constant for daemon status tracking - Insert wisp detection in PersistentPreRunE daemon connection logic - Update error messages in wisp.go, mol_burn.go, mol_squash.go - Add comprehensive unit tests for isWispOperation()
This commit is contained in:
@@ -66,14 +66,10 @@ func runMolSquash(cmd *cobra.Command, args []string) {
|
||||
|
||||
ctx := rootCtx
|
||||
|
||||
// mol squash requires direct store access
|
||||
// mol squash requires direct store access (daemon auto-bypassed for wisp ops)
|
||||
if store == nil {
|
||||
if daemonClient != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error: mol squash requires direct database access\n")
|
||||
fmt.Fprintf(os.Stderr, "Hint: use --no-daemon flag: bd --no-daemon mol squash %s ...\n", args[0])
|
||||
} else {
|
||||
fmt.Fprintf(os.Stderr, "Error: no database connection\n")
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "Error: no database connection\n")
|
||||
fmt.Fprintf(os.Stderr, "Hint: run 'bd init' or 'bd import' to initialize the database\n")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user