Extract timing constants to constants package (gt-795e8)

Added 6 timing constants:
- ShutdownNotifyDelay (500ms)
- ClaudeStartTimeout (15s)
- ShellReadyTimeout (5s)
- DefaultDebounceMs (100)
- DefaultDisplayMs (5000)
- PollInterval (100ms)

Updated 7 files to use these constants instead of magic numbers.

🤖 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-28 17:18:03 -08:00
parent 3421fe9303
commit 40cb3eb9fc
7 changed files with 51 additions and 27 deletions

View File

@@ -2,6 +2,29 @@
// Centralizing these magic strings improves maintainability and consistency.
package constants
import "time"
// Timing constants for session management and tmux operations.
const (
// ShutdownNotifyDelay is the pause after sending shutdown notification.
ShutdownNotifyDelay = 500 * time.Millisecond
// ClaudeStartTimeout is how long to wait for Claude to start in a session.
ClaudeStartTimeout = 15 * time.Second
// ShellReadyTimeout is how long to wait for shell prompt after command.
ShellReadyTimeout = 5 * time.Second
// DefaultDebounceMs is the default debounce for SendKeys operations.
DefaultDebounceMs = 100
// DefaultDisplayMs is the default duration for tmux display-message.
DefaultDisplayMs = 5000
// PollInterval is the default polling interval for wait loops.
PollInterval = 100 * time.Millisecond
)
// Directory names within a Gas Town workspace.
const (
// DirMayor is the directory containing mayor configuration and state.