Startup hooks nudge Deacon for GUPP backstop (gt-vdprb.3)
- Add special handling for 'deacon' target in gt nudge command - Maps 'deacon' to gt-deacon session, gracefully handles if not running - Add gt nudge deacon session-started to SessionStart hooks - Updated settings-autonomous.json, settings-interactive.json, and ensurePatrolHooks() template 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
"hooks": [
|
"hooks": [
|
||||||
{
|
{
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"command": "gt prime"
|
"command": "gt prime && gt nudge deacon session-started"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"hooks": [
|
"hooks": [
|
||||||
{
|
{
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"command": "gt prime && gt mail check --inject"
|
"command": "gt prime && gt mail check --inject && gt nudge deacon session-started"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"hooks": [
|
"hooks": [
|
||||||
{
|
{
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"command": "gt prime"
|
"command": "gt prime && gt nudge deacon session-started"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -410,6 +410,7 @@ func ensurePatrolHooks(workspacePath string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Standard patrol hooks
|
// Standard patrol hooks
|
||||||
|
// Note: SessionStart nudges Deacon for GUPP backstop (agent wake notification)
|
||||||
hooksJSON := `{
|
hooksJSON := `{
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"SessionStart": [
|
"SessionStart": [
|
||||||
@@ -418,7 +419,7 @@ func ensurePatrolHooks(workspacePath string) error {
|
|||||||
"hooks": [
|
"hooks": [
|
||||||
{
|
{
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"command": "gt prime && gt mail check --inject"
|
"command": "gt prime && gt mail check --inject && gt nudge deacon session-started"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var nudgeCmd = &cobra.Command{
|
var nudgeCmd = &cobra.Command{
|
||||||
Use: "nudge <rig/polecat> <message>",
|
Use: "nudge <target> <message>",
|
||||||
GroupID: GroupComm,
|
GroupID: GroupComm,
|
||||||
Short: "Send a message to a polecat session reliably",
|
Short: "Send a message to a polecat or deacon session reliably",
|
||||||
Long: `Sends a message to a polecat's Claude Code session.
|
Long: `Sends a message to a polecat's or deacon's Claude Code session.
|
||||||
|
|
||||||
Uses a reliable delivery pattern:
|
Uses a reliable delivery pattern:
|
||||||
1. Sends text in literal mode (-l flag)
|
1. Sends text in literal mode (-l flag)
|
||||||
@@ -28,9 +28,13 @@ Uses a reliable delivery pattern:
|
|||||||
This is the ONLY way to send messages to Claude sessions.
|
This is the ONLY way to send messages to Claude sessions.
|
||||||
Do not use raw tmux send-keys elsewhere.
|
Do not use raw tmux send-keys elsewhere.
|
||||||
|
|
||||||
|
Special targets:
|
||||||
|
deacon Maps to the Deacon session (gt-deacon)
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
gt nudge gastown/furiosa "Check your mail and start working"
|
gt nudge gastown/furiosa "Check your mail and start working"
|
||||||
gt nudge gastown/alpha "What's your status?"`,
|
gt nudge gastown/alpha "What's your status?"
|
||||||
|
gt nudge deacon session-started`,
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
RunE: runNudge,
|
RunE: runNudge,
|
||||||
}
|
}
|
||||||
@@ -65,6 +69,32 @@ func runNudge(cmd *cobra.Command, args []string) error {
|
|||||||
|
|
||||||
t := tmux.NewTmux()
|
t := tmux.NewTmux()
|
||||||
|
|
||||||
|
// Special case: "deacon" target maps to the Deacon session
|
||||||
|
if target == "deacon" {
|
||||||
|
// Check if Deacon session exists
|
||||||
|
exists, err := t.HasSession(DeaconSessionName)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("checking deacon session: %w", err)
|
||||||
|
}
|
||||||
|
if !exists {
|
||||||
|
// Deacon not running - this is not an error, just log and return
|
||||||
|
fmt.Printf("%s Deacon not running, nudge skipped\n", style.Dim.Render("○"))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := t.NudgeSession(DeaconSessionName, message); err != nil {
|
||||||
|
return fmt.Errorf("nudging deacon: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("%s Nudged deacon\n", style.Bold.Render("✓"))
|
||||||
|
|
||||||
|
// Log nudge event
|
||||||
|
if townRoot, err := workspace.FindFromCwd(); err == nil && townRoot != "" {
|
||||||
|
LogNudge(townRoot, "deacon", message)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Check if target is rig/polecat format or raw session name
|
// Check if target is rig/polecat format or raw session name
|
||||||
if strings.Contains(target, "/") {
|
if strings.Contains(target, "/") {
|
||||||
// Parse rig/polecat format
|
// Parse rig/polecat format
|
||||||
|
|||||||
Reference in New Issue
Block a user