Code review fixes for park/resume commands (gt-twjr5.5)

- Remove dead sendGateWakeMail function (logic in gate.go)
- Extract parkedWorkPath helper to reduce duplication
- Handle deleted/inaccessible gates in resume gracefully
- Remove unused mail/workspace imports

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-26 00:10:44 -08:00
parent df3cbf42f2
commit 7029515451
2 changed files with 22 additions and 41 deletions
+14 -6
View File
@@ -84,10 +84,13 @@ func runResume(cmd *cobra.Command, args []string) error {
// Check gate status
gateCheck := exec.Command("bd", "gate", "show", parked.GateID, "--json")
gateOutput, err := gateCheck.Output()
gateNotFound := false
if err != nil {
// Gate might have been deleted or is inaccessible
status.GateClosed = false
status.CloseReason = "Gate not accessible"
// Gate might have been deleted (wisp cleanup) or is inaccessible
// Treat as "gate gone" - allow clearing stale parked work
gateNotFound = true
status.GateClosed = true // Treat as closed so user can clear it
status.CloseReason = "Gate no longer exists (may have been cleaned up)"
} else {
var gateInfo struct {
ID string `json:"id"`
@@ -129,9 +132,14 @@ func runResume(cmd *cobra.Command, args []string) error {
}
// Gate closed - resume work!
fmt.Printf("%s Gate %s has cleared!\n", style.Bold.Render("🚦"), parked.GateID)
if status.CloseReason != "" {
fmt.Printf(" Reason: %s\n", status.CloseReason)
if gateNotFound {
fmt.Printf("%s Gate %s no longer exists\n", style.Bold.Render("⚠️"), parked.GateID)
fmt.Printf(" The gate may have been cleaned up. Restoring parked work anyway.\n")
} else {
fmt.Printf("%s Gate %s has cleared!\n", style.Bold.Render("🚦"), parked.GateID)
if status.CloseReason != "" {
fmt.Printf(" Reason: %s\n", status.CloseReason)
}
}
// Restore hook if we have a bead