fix(crew): Use NudgeSession instead of SendKeys for gt prime
SendKeys has an Enter-concatenation bug that causes the nudge to fail. NudgeSession is the canonical way to message Claude and works reliably. Fixes cold starts of crew workers (gt crew start). (gt-7swyi) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
d94fb4669b
commit
b020b2634e
@@ -351,7 +351,7 @@ func runCrewRestart(cmd *cobra.Command, args []string) error {
|
||||
// Non-fatal: session works without beacon
|
||||
}
|
||||
|
||||
if err := t.SendKeys(sessionID, "gt prime"); err != nil {
|
||||
if err := t.NudgeSession(sessionID, "gt prime"); err != nil {
|
||||
// Non-fatal: Claude started but priming failed
|
||||
style.PrintWarning("Could not send prime command to %s: %v", arg, err)
|
||||
}
|
||||
@@ -522,7 +522,7 @@ func restartCrewSession(rigName, crewName, clonePath string) error {
|
||||
beacon := session.SessionBeacon(address, "")
|
||||
_ = t.NudgeSession(sessionID, beacon) // Non-fatal
|
||||
|
||||
if err := t.SendKeys(sessionID, "gt prime"); err != nil {
|
||||
if err := t.NudgeSession(sessionID, "gt prime"); err != nil {
|
||||
// Non-fatal
|
||||
}
|
||||
|
||||
|
||||
@@ -753,7 +753,7 @@ func runStartCrew(cmd *cobra.Command, args []string) error {
|
||||
style.PrintWarning("Timeout waiting for Claude to start: %v", err)
|
||||
}
|
||||
time.Sleep(constants.ShutdownNotifyDelay)
|
||||
if err := t.SendKeys(sessionID, "gt prime"); err != nil {
|
||||
if err := t.NudgeSession(sessionID, "gt prime"); err != nil {
|
||||
style.PrintWarning("Could not send prime command: %v", err)
|
||||
}
|
||||
} else {
|
||||
@@ -806,7 +806,7 @@ func runStartCrew(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
// Send gt prime to initialize context
|
||||
if err := t.SendKeys(sessionID, "gt prime"); err != nil {
|
||||
if err := t.NudgeSession(sessionID, "gt prime"); err != nil {
|
||||
style.PrintWarning("Could not send prime command: %v", err)
|
||||
}
|
||||
|
||||
@@ -945,7 +945,7 @@ func startCrewMember(rigName, crewName, townRoot string) error {
|
||||
_ = t.NudgeSession(sessionID, beacon) // Non-fatal
|
||||
|
||||
// Send gt prime to initialize context (non-fatal: session works without priming)
|
||||
_ = t.SendKeys(sessionID, "gt prime")
|
||||
_ = t.NudgeSession(sessionID, "gt prime")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user