fix(peek): Support cross-rig crew paths like beads/crew/dave

gt peek now correctly handles crew worker paths by detecting the crew/
prefix and using the proper crew session name format (gt-{rig}-crew-{name}).

Changes:
- Add CaptureSession method to Manager for raw session ID capture
- Detect crew/ prefix in peek command and use CrewSessionName
- Update help text with crew path examples

Fixes: gt-yud21

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
nux
2026-01-04 15:13:08 -08:00
committed by Steve Yegge
parent 507402dfca
commit ae9741ad7f
2 changed files with 39 additions and 6 deletions

View File

@@ -395,6 +395,21 @@ func (m *Manager) Capture(polecat string, lines int) (string, error) {
return m.tmux.CapturePane(sessionID, lines)
}
// CaptureSession returns the recent output from a session by raw session ID.
// Use this for crew workers or other non-polecat sessions where the session
// name doesn't follow the standard gt-{rig}-{polecat} pattern.
func (m *Manager) CaptureSession(sessionID string, lines int) (string, error) {
running, err := m.tmux.HasSession(sessionID)
if err != nil {
return "", fmt.Errorf("checking session: %w", err)
}
if !running {
return "", ErrSessionNotFound
}
return m.tmux.CapturePane(sessionID, lines)
}
// Inject sends a message to a polecat session.
// Uses a longer debounce delay for large messages to ensure paste completes.
func (m *Manager) Inject(polecat, message string) error {