Commit Graph
100 Commits
Author SHA1 Message Date
arkonandClaude Opus 4.5 2e4d89496f fix: Ralph wizard uses file-based prompt to avoid screen escaping issues
- Add /api/sessions/:id/ralph-prompt/write endpoint to write prompt to @ralph_prompt.md
- Wizard now writes full prompt to file, then sends simple read command to Claude
- Fix session readiness check to wait for prompt character instead of notWorking flag
- Add E2E test infrastructure for ralph-loop workflow (port 3190)
- Add ralph-wizard-prod.mjs script for production testing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 17:46:43 +01:00
arkonandClaude Opus 4.5 c4e5337480 fix: remove cpulimit, use nice only for CPU priority
cpulimit -f interfered with Claude's Ink terminal UI causing duplicate
prompt rendering. Replaced with nice-only approach.

- Remove cpulimit entirely (was causing display issues)
- Rename CpuLimitConfig -> NiceConfig for clean naming
- Simplify wrapWithCpuLimit -> wrapWithNice
- Update UI labels and settings key (cpuLimit -> nice)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:43:20 +01:00
arkonandClaude Opus 4.5 f92d009034 fix: Ralph Loop wizard screen creation and session idle detection
- Fix screen creation failing when using cpulimit/nice (env vars were passed
  as command args instead of shell variables)
- Fix session status never becoming 'idle' after startInteractive()
- Add automatic state file cleanup on startup (removes orphaned sessions)
- Add /api/cleanup-state endpoint for manual cleanup
- Make frontend session readiness check more robust (20 attempts, multiple checks)
- Add fallback to direct PTY write if writeViaScreen fails

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:02:02 +01:00
arkon 2d8597a66f chore: bump version to 0.1394 2026-01-27 02:38:37 +01:00
arkonandClaude Opus 4.5 2a89f2aa51 fix: add cpulimit availability check to app settings
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 01:59:35 +01:00
arkonandClaude Opus 4.5 59b406f73f feat: add CPU limiting and Ralph Loop wizard plan generation
CPU Limiting:
- Add CpuLimitConfig type and settings in App Settings
- Use nice command for process priority (-20 to 19)
- Optional cpulimit integration for hard CPU limits (if installed)
- Applied to new sessions via screen-manager and session modules

Ralph Loop Wizard:
- 3-step wizard: Describe → Plan → Launch
- New /api/generate-plan endpoint generates implementation steps via Claude
- Plan editor with checkboxes, priorities (P0/P1/P2), reordering
- Skip plan option for manual workflows
- Compact wizard modal layout

UI Updates:
- Form section headers for grouped settings
- CPU limit status indicator (cpulimit availability)
- Wizard modal wider layout and inline fields

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 01:58:14 +01:00
arkonandClaude Opus 4.5 7cb7bc96e9 fix: subagent window parent attachment and stale name after rename
Bug 1 - Wrong parent attachment with same workingDir:
- Rewrote findParentSessionForSubagent() with two-strategy approach
- Strategy 1: Sibling matching - check if another subagent with same
  Claude sessionId already has a parent assigned, use that
- Strategy 2: Heuristic fallback - if multiple sessions match by
  workingDir, prefer the most recently created session
- Removes bias toward active session that caused wrong attachment

Bug 2 - Stale parentSessionName after rename:
- Added updateSubagentParentNames() method to refresh cached names
- Called from session:updated SSE handler when session changes
- Updates both the agent object and window header DOM element
- Refreshes connection lines after name updates

Also includes unrelated plan generation wizard changes that were
already staged in app.js.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 01:23:12 +01:00
arkonandClaude Opus 4.5 3d52509bfe feat: add file browser panel and compact settings grid layout
- Add File Browser panel (right-side) showing project files in a tree view
  - API endpoints: /api/sessions/:id/files, /api/sessions/:id/file-content
  - Tree view with expand/collapse, filtering, file icons by type
  - File preview overlay for text, images, and video
  - Excludes common large directories (.git, node_modules, etc.)

- Refactor App Settings with compact 2-column grid layout
  - Display tab: Header Displays, Panels, Subagent Options sections
  - Notifications tab: Master Control, Alerts, Notification Levels sections
  - Smaller switches (28x16px) with tooltips instead of form hints
  - ~35% vertical space reduction

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 01:07:02 +01:00
arkonandClaude Opus 4.5 3ab03cfd19 feat: add @fix_plan.md integration (Phase 2.3)
API Endpoints:
- GET /api/sessions/:id/fix-plan - Generate fix plan markdown from todos
- POST /api/sessions/:id/fix-plan/import - Import todos from markdown
- POST /api/sessions/:id/fix-plan/write - Write @fix_plan.md to working dir
- POST /api/sessions/:id/fix-plan/read - Read and import from working dir

RalphTracker Methods:
- generateFixPlanMarkdown() - Creates structured markdown with priority sections
- importFixPlanMarkdown() - Parses markdown and imports todos with priorities

UI Features:
- Menu dropdown in Ralph panel (hamburger icon)
- View Fix Plan modal with copy/write buttons
- Import from file button
- Reset Circuit Breaker button
- Fix plan modal with syntax-highlighted textarea

Bump version to 0.1392

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 01:02:38 +01:00
arkonandClaude Opus 4.5 925ea09cca feat: add smart respawn integration and priority todos (Phase 2)
Smart Respawn Integration (2.5):
- Check circuit breaker OPEN state before respawn (blocks cycle)
- Check RALPH_STATUS EXIT_SIGNAL=true to stop respawn
- Check STATUS=BLOCKED to pause respawn for human intervention
- Use RECOMMENDATION from RALPH_STATUS in update prompt
- Emit respawn:blocked SSE event with reason and details
- Show notification when respawn is blocked
- Visual blocked state with pulsing red indicator

Priority-based Todos (part of 2.3):
- Add RalphTodoPriority type (P0/P1/P2/null)
- Parse priority from todo content (P0:, Critical:, High Priority, etc.)
- Add priority field to RalphTodoItem interface
- Update frontend to display priority badges with colors
- Sort todos by priority (P0 > P1 > P2) then by status
- Add CSS for priority badges and highlighted cards

Bump version to 0.1391

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 00:54:02 +01:00
arkon 59b22337a5 chore: bump version to 0.1390 2026-01-27 00:41:00 +01:00
arkonandClaude Opus 4.5 11d4666d19 feat: add RALPH_STATUS block parsing and circuit breaker pattern
Phase 1 Ralph enhancement implementation:
- Parse RALPH_STATUS blocks from Claude output (status, tasks, files, tests)
- Circuit breaker state machine (CLOSED → HALF_OPEN → OPEN) for stuck detection
- Dual-condition exit gate (completion indicators >= 2 AND EXIT_SIGNAL)
- Frontend: circuit breaker badge (yellow warning, red stuck), status block display
- API: circuit breaker reset endpoint, ralph status endpoint
- Notifications when circuit breaker opens or exit gate is met

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 00:29:38 +01:00
arkonandClaude Opus 4.5 b896478ca6 fix: subagent tabs render to correct parent session after restart
- restoreSubagentWindowStates now discovers parent sessions before restoring
- closeSubagentWindow discovers parent before minimizing to prevent wrong tab
- Fixed async handling in subagent:completed event handler

chore: bump version to 0.1389

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 23:37:14 +01:00
arkonandClaude Opus 4.5 a730a295b1 fix: tab blinking for hook events persists through session:working
Implement pending hooks state machine to track hook events per session.
Tab alerts now derive from pending hooks rather than being set directly,
so session:working events don't clear alerts when prompts are still pending.

- Add pendingHooks Map to track permission_prompt, elicitation_dialog, idle_prompt
- Action hooks (permission/elicitation) take priority over idle for alert type
- hook:stop clears all pending hooks when Claude finishes responding
- selectSession() only clears idle hooks; action hooks persist until user input
- User input clears all pending hooks (they've addressed the prompt)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 23:00:47 +01:00
arkonandClaude Opus 4.5 cbc572593b docs: add agent visualization, run summary, and subagent API to README
- Add Live Agent Visualization section with floating windows, connection lines, status indicators
- Add Project Insights Panel section for real-time tool visibility
- Add Run Summary section for "what happened while away" feature
- Add Subagents API endpoints documentation
- Add Run Summary API endpoint
- Update architecture diagram with Subagent Watcher and Background Agents
- Update tagline to include "Visualize agents"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 22:16:10 +01:00
arkon a0ffec7eb6 fix: exclude full terminal buffers from SSE init to prevent browser freezes
- Add getLightState() and getLightSessionsState() methods
- SSE init payload reduced from ~1.9MB to ~5KB (~400x smaller)
- Terminal buffers are fetched on-demand when switching tabs
- Fixes UI becoming unresponsive on SSE reconnect

chore: bump version to 0.1388
2026-01-26 21:27:08 +01:00
arkonandClaude Opus 4.5 035d752cfa ui: agent badge shows AGENT or AGENTS (n)
- Single agent: "AGENT"
- Multiple: "AGENTS (2)", "AGENTS (3)", etc.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 20:43:39 +01:00
arkonandClaude Opus 4.5 e763599bab fix: allow reopening completed subagent windows + add Agent label
- Subagent windows now always minimize instead of being removed
- restoreSubagentWindow recreates window if it was deleted
- Badge now shows "Agent 1" instead of just "1"
- Use activeSessionId as fallback parent for orphan agents

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 20:07:00 +01:00
arkonandClaude Opus 4.5 45332b6438 feat: parallel session creation and improved minimized agents UI
- Session creation now parallelized (3x faster for multiple tabs)
- Minimized agents badge: compact, hover-triggered, auto-hide
- Removed "Minimized Agents" header, status dots instead of text
- Click to pin dropdown open, hover for quick access

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 19:42:01 +01:00
arkonandClaude Opus 4.5 47622917e6 docs: update next available test port to 3155
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:02:39 +01:00
arkonandClaude Opus 4.5 428556e831 refactor: extract magic numbers to named constants
Low severity code quality improvements:
- session.ts: Add timing constants (SCREEN_STARTUP_DELAY_MS, etc.)
- screen-manager.ts: Add EXEC_TIMEOUT_MS, CR_MAX_ATTEMPTS, etc.
- subagent-watcher.ts: Add display length constants
- server.ts: Add STATS_COLLECTION_INTERVAL_MS, SESSION_LIMIT_WAIT_MS, etc.
- spawn-orchestrator.ts: Add budget ratio constants
- respawn-controller.ts: Use pre-compiled ANSI_ESCAPE_PATTERN
- state-store.ts: Use ES6 import for unlinkSync instead of dynamic require
- app.js: Add notification timing constants

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 14:27:21 +01:00
arkonandClaude Opus 4.5 3c2e89f427 fix: address medium severity issues from code review
- Fix inconsistent null handling in state-store (use ?? instead of ||)
- Add JSON.stringify error handling with specific messages
- Add error handling for SSE init event in app.js
- Fix spawn orchestrator silent failures (add logging)
- Fix statSync race condition in subagent-watcher
- Fix unbounded _taskNumberToContent Map in ralph-tracker
- Fix YAML pattern case sensitivity in ralph-config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 13:58:34 +01:00
arkonandClaude Opus 4.5 e81dc4665a fix: high severity memory leaks and bugs
- Add warningTimer to AgentContext and clean it up in cleanupAgent
- Clear all state in subagent-watcher stop() for clean restart
- Add cleanupStaleAgents() to remove completed agents older than 24h
- Delete pendingToolCalls entries after lookup to prevent memory leak
- Add FSWatcher error handlers to prevent unhandled exceptions
- Bump version to 0.1382

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:50:39 +01:00
arkonandClaude Opus 4.5 fe334c2ea6 fix: improve stability with memory leak fixes and atomic writes
Session Manager:
- Store event handlers for proper cleanup on session stop
- Add resetSessionManager() for test isolation

State Store:
- Use atomic write pattern (temp file + rename) to prevent corruption
- Add tokenStats to AppState interface

Subagent Watcher:
- Clean up pendingToolCalls on agent completion
- Add cleanupStaleAgents() for 24h+ old agents
- Clear all state maps on stop() for clean restart

Web Server:
- Remove listeners from transcript watcher before stopping
- Clean up respawn timers when session is deleted
- Use cleanupSession() in spawn orchestrator for proper resource cleanup

Frontend:
- Close existing EventSource before reconnecting to prevent duplicates
- Close failed connection before scheduling reconnect

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:35:00 +01:00
arkonandClaude Opus 4.5 6e4564abd1 fix: add validation to prevent token counter corruption
- Add max 500k tokens per session limit (Claude's context is ~200k)
- Add max 100k tokens per update to prevent sudden jumps from parsing errors
- Reject "M" suffix values > 0.5M to prevent false matches in output text
- Add validation to restoreTokens() to reject corrupted values from state.json
- Add validation to addToGlobalStats() for negative and absurd values
- Fix daily sessions count: track unique session IDs instead of incrementing
  on every 5-minute recording interval
- Pass sessionId to recordDailyUsage() for accurate session counting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:22:05 +01:00
arkonandClaude Opus 4.5 b697bcfea2 chore: bump version to 0.1381
Add web UI keyboard shortcuts to CLAUDE.md.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 11:10:21 +01:00
arkonandClaude Opus 4.5 32e0d6126c fix: read subagent descriptions directly from parent transcript
Instead of timing-based correlation between terminal output and subagent
files, now reads the Task tool's description parameter directly from the
parent session's transcript. This provides 100% reliable mapping between
agent IDs and their short descriptions, fixing issues where multiple
agents spawned in quick succession would get the same window title.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 11:06:35 +01:00
arkonandClaude Opus 4.5 1c9a7dc077 chore: remove temporary respawn monitoring files
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 10:51:55 +01:00
arkonandClaude Opus 4.5 cf470c9ad5 feat: use 24-hour time format for subagent activity timestamps
Bump version to 0.1379

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 10:46:34 +01:00
arkonandClaude Opus 4.5 fc940e153b fix: correct Task tool description extraction for subagent window titles
- Add parseTaskDescriptionsFromTerminalData() to parse raw terminal data in
  interactive sessions (not just one-shot mode)
- Strip ANSI codes before regex matching since terminal output has embedded
  codes like [1mExplore[0m
- Fix getTaskDescriptionForSubagent() to check ALL sessions with matching
  project hash (not just the first one found) since multiple sessions can
  share the same working directory
- Add tool_result event forwarding for subagent SSE broadcasts

The pattern Explore(Description) in terminal output is now correctly parsed
and used as the subagent window title instead of extracting from the prompt.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 10:42:04 +01:00
arkonandClaude Opus 4.5 f06240f4ef feat: use Task tool description for subagent window titles + auto-minimize completed
- Extract short description from TaskTracker (params.description) for subagent windows
- Correlate subagents with sessions by working directory and timing
- Auto-minimize subagent windows when agents complete
- Persist minimized/open window states to server for cross-browser sync
- Restore window states on reconnection/page reload
- New API: GET/PUT /api/subagent-window-states
- State file: ~/.claudeman/subagent-window-states.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 09:06:49 +01:00
arkonandClaude Opus 4.5 f95ffd12e2 chore: remove stale respawn monitoring files
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 08:43:48 +01:00
arkonandClaude Opus 4.5 3f73a5f908 chore: remove non-functional subagent input feature
Subagents (Task tool background agents) are autonomous and cannot
receive input mid-execution. They complete and return results to
the parent session. Removed the input UI and API endpoint.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 04:35:50 +01:00
arkonandClaude Opus 4.5 6187444118 fix: improve file-link-click tests with proper assertions and error handling
- Add unit tests for file path pattern matching (cmdPattern, extPattern, bashPattern)
- Add tests for invalid/unsafe path rejection
- Fix streaming test to create session when browser tests are skipped
- Fix SSE assertion: 'event:' → 'data:' (correct SSE format)
- Fix API response access: data.session.id → data.sessionId
- Improve error handling: re-throw errors after cleanup instead of swallowing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 04:35:14 +01:00
arkonandClaude Opus 4.5 7b2440a49d fix: improve install scripts robustness and edge cases
install.sh:
- Fix NodeSource GPG key overwrite issue (rm before dearmor)
- Fix systemd ExecStart missing node binary prefix
- Add SUSE/openSUSE support (zypper-based)
- Add local changes check before git reset --hard
- Add curl/wget detection with fallback support
- Use shallow clone (--depth 1) for faster install
- Update Node.js target to v22 (current LTS)
- Add CLAUDEMAN_NODE_VERSION env var for customization
- Add run_as_root/ensure_sudo helpers for consistent privilege handling
- Add cleanup trap with helpful failure message
- Add Windows detection with WSL guidance
- Fix PATH substring check (was using grep -qx incorrectly)
- Add stdin TTY check for non-interactive piped input
- Update Claude CLI install to official curl installer
- Add armv7 architecture support (Raspberry Pi)
- Quieter apt/dnf output with -qq flags

scripts/postinstall.js:
- Fix command detection for Windows (where vs command -v)
- Add Fedora/Arch/Alpine install instructions for screen
- Add Windows/WSL guidance
- Show Claude CLI path when found
- Refactor with clear sections and helper functions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 03:48:03 +01:00
arkonandClaude Opus 4.5 34e32ad999 feat: add universal install script for macOS & Linux
- Add install.sh with curl one-liner installation
- Supports macOS (Homebrew), Debian/Ubuntu (apt), Fedora (dnf), Arch (pacman), Alpine (apk)
- Auto-detects OS, architecture, and Linux distro
- Checks/installs Node.js 18+, GNU Screen, warns about Claude CLI
- Clones to ~/.claudeman/app, builds, adds to PATH
- Optional systemd service setup on Linux
- Add postinstall.js for npm install verification
- Update README with simplified installation section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 03:38:26 +01:00
arkonandClaude Opus 4.5 61436f3166 chore: bump version to 0.1376
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 03:34:56 +01:00
arkonandClaude Opus 4.5 1394926e3f style: add color styling for subagent window status badges
Add idle (yellow) and completed (blue) status colors to match the
minimized robot tab styling. Also use var(--green) for active status
for consistency with dropdown badges.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 03:28:08 +01:00
arkonandClaude Opus 4.5 e32ba17443 fix: prevent daily token stats from re-counting restored sessions
When sessions were restored after server restart, lastRecordedTokens
was not initialized, causing the periodic token recording to treat
the entire restored token count as new usage. This inflated daily
stats by re-counting tokens on every server restart.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 03:13:54 +01:00
arkonandClaude Opus 4.5 d7991e5738 chore: bump version to 0.1375
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 03:13:36 +01:00
arkonandClaude Opus 4.5 5ca4981ea8 fix: add 2-minute grace period for respawn after server restart
Prevents false idle detection when server is rebuilt/restarted.
Previously, restored respawn controllers would start immediately
and trigger after 30s of "no output" because the session wasn't
fully connected yet.

Now waits 2 minutes from server startup before activating restored
respawn controllers, giving sessions time to reconnect and stabilize.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 03:08:13 +01:00
arkonandClaude Opus 4.5 223ba078b9 fix: subagent dropdown clipped by contain:layout
The .session-tabs container has contain:layout which creates a new
containing block, breaking position:fixed on the dropdown. Fixed by
moving the dropdown to document.body when opened (portal pattern),
then moving it back when closed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 02:55:19 +01:00
arkonandClaude Opus 4.5 464c4c479d fix: subagent dropdown hidden by overflow:hidden parent
The dropdown was being clipped by .session-tabs overflow-y:auto.
Changed from position:absolute to position:fixed and calculate
position dynamically in JS using getBoundingClientRect().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 02:38:55 +01:00
arkonandClaude Opus 4.5 f9ffe17c3e fix: subagent dropdown hidden behind terminal
Add z-index to header so dropdown menus appear above the main
content/terminal area.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 02:27:12 +01:00
arkonandClaude Opus 4.5 565fc80f18 fix: compact respawn controller UI with filtered action log
- Restructure banner to 2-column layout (status left, log right)
- Row 1: state, confidence, cycles, timer, tokens
- Row 2: hook/AI check status, countdown timers (auto-hidden when empty)
- Remove ALL timer-cancel messages from action log
- Only log interesting events: commands, hooks, AI/plan verdicts
- Compact text: "✓ Idle (30s)" instead of verbose messages
- Smaller fonts and padding throughout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 02:21:34 +01:00
arkonandClaude Opus 4.5 2ea3011397 feat: add setting to show subagent windows for active tab only
Adds "Subagents for Active Tab Only" toggle in App Settings → Display:
- OFF (default): windows visible regardless of active tab (original behavior)
- ON: windows only visible when their parent tab is selected

Also improves parent session detection by checking active session first,
which fixes connection lines going to wrong tabs when multiple sessions
share the same working directory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 01:17:57 +01:00
arkonandClaude Opus 4.5 9aa5973970 fix: rock-solid idle detection in respawn controller
- Add 300-char rolling window to catch working patterns split across PTY chunks
- Check completion message BEFORE working patterns (priority fix)
- Clear rolling window on completion message (transition point)
- Increase working pattern absence threshold from 3s to 8s
- Add Session.isWorking safety check before confirming idle
- Add 20+ more working patterns (Compiling, Building, Processing, etc.)
- Make AI idle checker prompt more conservative (err toward WORKING)
- Update documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 00:55:29 +01:00
arkonandClaude Opus 4.5 5b87a41aac chore: bump version to 0.1373
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 00:20:14 +01:00
arkonandClaude Opus 4.5 fbecbfb7cf feat: rename Active Tools to Project Insights panel
- Rename Active Tools panel to Project Insights with updated styling
- Make panel bigger (450x350px) and resizable with drag handle
- Add settings toggle in Display tab to enable/disable panel
- Close subagent windows when parent session is killed/closed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 00:15:11 +01:00
arkonandClaude Opus 4.5 ac7238dff2 feat: Matrix-style subagent console with glowing green terminal
Enter the Matrix. Subagent windows now feature a full cyberpunk
terminal aesthetic:

- Deep black (#0a0a0a) background
- Phosphor green (#00ff41) text with glow effect
- Tool names pulse with neon intensity
- Timestamps in muted matrix green
- Progress lines shimmer like digital rain

Your AI agents now look like they're hacking the mainframe.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 00:01:34 +01:00
arkonandClaude Opus 4.5 c4b737bc15 feat: matrix-style subagent connection lines + smart window layout
Subagent windows now visually connect to their parent session tabs with
glowing matrix-green lines that pulse with life. Windows automatically
arrange in a non-overlapping grid, and each shows its origin with a
clickable "from [session]" header.

Watch your AI agents spawn and dance across the screen, tethered to
their creators by neon threads of digital consciousness.

Changes:
- Matrix green (#00ff41) connection lines with glow effect
- Smart grid positioning prevents window overlap
- Smaller default window size (420x350) for better density
- Auto-sizing activity columns for cleaner logs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 23:55:53 +01:00
arkonandClaude Opus 4.5 23022b533d feat: add subagent window parent tab connection
- Show "from [session name]" header in subagent windows
- Add spawn animation from parent tab position
- Draw curved SVG connection lines from tabs to windows
- Update connection lines on drag, resize, minimize, close
- Fix API response parsing (data.data not data.subagents)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 23:41:59 +01:00
arkonandClaude Opus 4.5 5e08fb5a75 fix: lazy lookup for run summary tracker in respawn listeners
The run summary tracker wasn't tracking respawn events for restored
sessions because the tracker didn't exist when setupRespawnListeners
was called during session restoration. Changed to lazy lookup so
the tracker is retrieved each time an event fires.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 22:28:30 +01:00
arkonandClaude Opus 4.5 baffd0cf4c chore: bump version to 0.1369
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 22:24:51 +01:00
arkonandClaude Opus 4.5 12d9fd4cb2 chore: add data-session-id to summary icon for future enhancements
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 22:17:19 +01:00
arkonandClaude Opus 4.5 0c443f865a feat: add export functionality to Run Summary modal
- Export to JSON: Full data dump with all events and stats
- Export to Markdown: Formatted report with stats table and event timeline
- Downloads file directly to browser

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 22:14:29 +01:00
arkonandClaude Opus 4.5 de5ee8643c feat: implement DEC mode 2026 synchronized output to reduce terminal flicker
- Server wraps SSE terminal batches with DEC 2026 sync markers
- Client extracts and strips markers, writes atomically via RAF batching
- Native terminals (WezTerm, Kitty, etc.) get full sync support
- xterm.js web gets application-layer sync via marker extraction

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 22:09:45 +01:00
arkonandClaude Opus 4.5 b811c8dc80 feat: add Run Summary feature for session activity tracking
Implements a "what happened while you were away" view for sessions:
- Track significant events: session start/stop, respawn cycles, state changes,
  idle/working transitions, token milestones, auto-compact/clear, Ralph
  completions, AI check results, hook events, errors/warnings
- Stats dashboard: respawn cycles, peak tokens, active/idle time, issue counts
- Timeline view with color-coded severity and emoji icons
- Filter events by type (all/errors/warnings/respawn/idle)
- State stuck detection (warns when state unchanged for 10+ minutes)

Click the chart icon on any session tab to open the Run Summary modal.

Files:
- src/run-summary.ts: RunSummaryTracker class with event tracking
- src/types.ts: RunSummary, RunSummaryEvent types
- src/web/server.ts: Integration with session/respawn events, API endpoint
- src/web/public/: Modal UI, timeline rendering, filter controls
- docs/run-summary-plan.md: Implementation plan

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 22:05:28 +01:00
arkonandClaude Opus 4.5 8b0577d8aa chore: bump version to 0.1366
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 21:32:08 +01:00
arkonandClaude Opus 4.5 1ff1e300f6 feat: add hook-based idle detection for respawn controller
Implement multi-phase improvement to respawn controller's idle detection:

Phase 1 - Stop Hook Detection:
- Add signalStopHook() method - definitive signal when Claude finishes
- 3s confirmation timer to handle race conditions
- Skip AI check when hook received (100% confidence)

Phase 2 - idle_prompt Detection:
- Add signalIdlePrompt() method - fires after 60s+ of idle
- Immediately confirms idle (no confirmation timer needed)

Phase 3 - Transcript File Monitoring:
- New TranscriptWatcher class watches session JSONL files
- Detects: completion, tool execution, plan mode, errors
- Signals respawn controller for supporting detection

Web UI Updates:
- Hook indicator with purple styling and pulse animation
- Shows "Stop hook received" or "idle_prompt hook received"
- 100% confidence displayed with hook-confirmed style

This significantly improves idle detection reliability by using
definitive signals from Claude Code rather than parsing terminal output.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 21:29:35 +01:00
arkonandClaude Opus 4.5 ddc55b7697 fix: improve respawn action log visibility and retention
- Loosen filter to show AI check verdicts, detection confirmations
- Increase history from 20 to 50 entries
- Increase display height from 100px to 150px
- Fix subagents panel toggle icon (down when open)
- Increase subagents panel height when expanded

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:43:30 +01:00
arkonandClaude Opus 4.5 28fd933252 feat: add token usage statistics with daily tracking and stats modal
- Add TokenUsageEntry and TokenStats types for daily tracking
- Add state-store methods for recording and retrieving daily usage
- Add /api/token-stats endpoint with daily breakdown and totals
- Add token stats modal with summary cards, 7-day bar chart, and table
- Record tokens periodically (5min) and on session delete
- Make header tokens clickable to open stats modal
- Fix subagents panel toggle icon direction (down when open)
- Increase subagents panel height when expanded

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:36:04 +01:00
arkonandClaude Opus 4.5 74e8dd27dd fix: use Claude Opus pricing for cost estimation
- Input: $15/M tokens (was $3/M for Sonnet)
- Output: $75/M tokens (was $15/M for Sonnet)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:16:46 +01:00
arkonandClaude Opus 4.5 9d32fd594b feat: add token cost estimation and improve token formatting
- Format tokens: 1000k → 1m, 1450k → 1.45m, etc.
- Estimate cost using Claude Sonnet pricing ($3/M input, $15/M output)
- Show estimated cost in respawn banner and header
- More accurate than stored cost which doesn't update in interactive mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:12:16 +01:00
arkonandClaude Opus 4.5 4eb361f204 ui: keep action log on right side, improve detection status readability
- Revert timers row to horizontal layout (timers left, action log right)
- Make detection status text more readable:
  - Larger font (0.75rem)
  - Better contrast (--text color)
  - Semi-bold weight
  - Subtle background pill

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:02:29 +01:00
arkonandClaude Opus 4.5 40df0748c5 ui: improve respawn controller layout and filter action log noise
- Stack timers row vertically (timers on top, action log below)
- Reduce action log height to 60px since it's now full width
- Filter action log to show only important entries:
  - Commands sent to console
  - Plan-check with action taken
  - Step completions
- Skip timer starts/cancels, detection updates, ai-check status

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:59:42 +01:00
arkonandClaude Opus 4.5 c6b16bf815 fix: subagent title extraction race condition
- Add 100ms debounce for new file detection to allow content to be written
- Add subagent:updated event for retroactive description updates
- Extract description in processEntry when first user message is processed
- Add extractDescriptionFromFile helper with retry in file change handler
- Update SubagentTranscriptEntry.content type to support string | array
- Add test coverage for subagent:updated event

Fixes 43% failure rate where subagents displayed raw IDs instead of descriptions
due to race condition when files were discovered before first line was written.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:49:58 +01:00
arkonandClaude Opus 4.5 87bdd9376c ui: make Subagents panel detachable and position on right side
- Move Subagents panel to right side (same as Monitor)
- Add detach/float functionality with drag support
- Add resize handle for detached mode
- Clean up duplicate CSS
- Bump version to 0.1358

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:33:43 +01:00
arkonandClaude Opus 4.5 dc1dc5844e ui: add JavaScript logic for standalone Subagents panel
- Add closeSubagentsPanel() and toggleSubagentsPanel() methods
- Add showSubagents setting to app settings
- Update applyMonitorVisibility() to handle subagents panel visibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:11:45 +01:00
arkonandClaude Opus 4.5 04e25b6b7d ui: separate Subagents panel from Monitor panel
- Move subagents view into its own independent panel
- Position subagents panel to the left of monitor panel
- Add collapsible/closeable behavior for subagents panel
- Add responsive stacking on small screens
- Simplify monitor panel (now just Screen Sessions + Background Tasks)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:11:14 +01:00
arkonandClaude Opus 4.5 0d22d19645 docs: improve CLAUDE.md structure and discoverability
- Move COM shorthand to prominent position after safety warning
- Add version sync note (must match package.json)
- Consolidate Key Files into 4 logical categories
- Clarify next available test port (3128)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:09:25 +01:00
arkonandClaude Opus 4.5 8094a756c6 feat: smart title extraction for subagent descriptions
- Condenses long prompts to ~45 chars while preserving meaning
- Removes filler words (the, a, please, I need you to, etc.)
- Cuts at natural boundaries (colons, dashes, commas)
- Falls back to word-boundary truncation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 17:56:31 +01:00
arkonandClaude Opus 4.5 953d9845ca fix: subagent description extraction for JSONL format
The JSONL files have message.content as a direct string, not an array
of content blocks. Now handles both formats correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 17:51:59 +01:00
arkonandClaude Opus 4.5 74bcede607 ui: add double-click to open subagent tracking window
Double-click on subagent items in the Subagents tab to open
the floating tracking window. Includes tooltip hint.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 17:47:44 +01:00
arkonandClaude Opus 4.5 cec9608b66 ui: improve subagent window titles and readability
- Extract better titles from task description (first line/sentence)
- Make subagent window text white for better readability
- Expand monitor panel to 700px when subagents tab is active
- Add smooth width transition when switching tabs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 17:40:28 +01:00
arkonandClaude Opus 4.5 ad24020cdc feat: add real-time subagent visibility - monitor Claude Code background agents
- Add SubagentWatcher service that discovers and tails Claude Code's subagent
  transcript files (~/.claude/projects/.../subagents/agent-*.jsonl)
- Track tool calls, progress events, and messages in real-time via file watching
- Add SSE events for subagent:discovered, subagent:tool_call, subagent:progress,
  subagent:message, subagent:completed
- Add REST API endpoints: GET /api/subagents, /api/subagents/:id,
  /api/subagents/:id/transcript
- Add subagent panel in Monitor section showing active agents and their activity
- Add floating draggable windows that auto-open for each active agent
- Add standalone CLI tool: scripts/watch-subagents.ts for terminal monitoring

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 14:33:12 +01:00
arkonandClaude Opus 4.5 4c34966827 ui: hide case folder display from bottom toolbar
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:11:48 +01:00
arkonandClaude Opus 4.5 437322fb80 docs: document test cleanup patterns and known issues in CLAUDE.md
Added documentation about test cleanup patterns, known issues with
session/case cleanup in specific test files, and manual cleanup commands
for orphaned test resources.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:08:57 +01:00
arkonandClaude Opus 4.5 9d42ff5bb6 fix: sticky scroll on tab switch - keep terminal at bottom after new output
Add isTerminalAtBottom() helper and modify batchTerminalWrite() to implement
sticky scroll behavior. When SSE terminal data arrives after tab switch,
terminal now stays scrolled to Claude input if user was already at bottom.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 08:30:42 +01:00
arkonandClaude Opus 4.5 fc97f6a41a refactor: extract AI checker base class + fix persistence + dedupe restoration
- Add AiCheckerBase abstract class to eliminate ~700 lines of duplication
  between AiIdleChecker and AiPlanChecker
- Fix missing persistence fields (completionConfirmMs, noOutputTimeoutMs)
  that caused custom timing values to be lost on server restart
- Extract restoreRespawnController() helper to dedupe session restoration
  logic between state.json and screens.json paths

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 08:25:51 +01:00
arkonandClaude Opus 4.5 3455b27f6f fix: respawn disabled state not persisted across server restarts
When /respawn/stop was called, the controller was stopped but remained
in the respawnControllers map. This caused persistSessionState() to
still read config.enabled=true and save respawnEnabled=true to state.json.

On server restart, the respawn controller would be re-enabled because
state.json had respawnEnabled=true.

Fix: Remove controller from map and clear any timed respawn when
/respawn/stop is called, so persistSessionState() correctly sets
respawnEnabled=false.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 08:01:57 +01:00
arkonandClaude Opus 4.5 044021953a docs: add ai-plan-checker, test utilities, and update respawn state machine
- Add ai-plan-checker.ts to CLAUDE.md Key Files table
- Document test utilities (MockSession, MockAiIdleChecker, MockAiPlanChecker)
- Update port allocation (3127 reserved for respawn-integration)
- Add ai_checking state to respawn state diagram
- Document AI Plan Checker in respawn-state-machine.md
- Add references to test documentation files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 07:57:12 +01:00
arkonandClaude Opus 4.5 eb98caa812 fix: use temp file for plan checker prompt to avoid E2BIG + fix cancel race condition
The ai-plan-checker.ts was passing the prompt directly as a shell argument,
which can cause E2BIG errors when the terminal buffer is large (8KB+).
This fix applies the same temp file approach already used in ai-idle-checker.ts:
- Write prompt to a temp file instead of passing as shell argument
- Pipe the file to claude via stdin: `cat prompt.txt | claude -p ...`
- Clean up prompt file after check completes

Also fixes a race condition in the cancel() method of both AI checkers where
the poll timer could fire between setting checkCancelled and clearing timers.
Now timers are cleared before resolving the promise to prevent this race.

Includes test utilities and analysis documents for the respawn controller
created by other agents:
- test/respawn-test-utils.ts - MockSession, MockAiIdleChecker utilities
- test/respawn-analysis.md - Code analysis and issue identification
- test/respawn-scenarios.md - Test scenario documentation
- test/respawn-test-plan.md - Testing architecture documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 07:52:40 +01:00
arkonandClaude Opus 4.5 4d1da8bb71 fix: persist respawn config across server restarts
- persistSessionState() now saves respawnEnabled based on config.enabled
  (user intent) instead of controller.state (running state)
- cleanupSession() saves respawn config BEFORE removing controller
- AiIdleChecker and AiPlanChecker constructors filter undefined values
  to prevent overwriting defaults (fixes "timed out after undefinedms")
- updateConfig() methods also filter undefined values

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 07:42:05 +01:00
arkonandClaude Opus 4.5 8c17c54a3a fix: prevent undefined config values from overwriting AI checker defaults
When respawn config objects had explicit undefined values for fields like
aiIdleCheckTimeoutMs, the spread operator would overwrite defaults with
undefined, causing "AI check timed out after undefinedms" errors.

- Add default fallbacks when saving pre-config in server.ts
- Filter out undefined values before spreading in RespawnController
- Add tests verifying undefined filtering works correctly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 07:28:30 +01:00
arkonandClaude Opus 4.5 e56c8626e4 feat: persistent token tracking with global stats aggregation
- Add restoreTokens() method to Session class for recovery after restart
- Add GlobalStats type for cumulative usage tracking across all sessions
- Accumulate tokens from deleted sessions into global stats
- Track lifetime session count with incrementSessionsCreated()
- Add /api/stats endpoint for global stats
- Include globalStats in /api/status response
- Frontend shows aggregate tokens + cost in header
- Fix respawn controller config to filter undefined values
- Add 7 new tests for global stats functionality (v0.1343)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 07:26:49 +01:00
arkonandClaude Opus 4.5 0aca55b099 fix: use temp file for AI check prompt to avoid E2BIG spawn error
The AI idle checker was passing the prompt (including up to 16KB of terminal
buffer) as a command-line argument to bash -c, which exceeded the Linux
argument size limit causing "spawn E2BIG" errors.

Now writes the prompt to a temp file and pipes it to claude via stdin,
avoiding the argument size limit entirely. Temp file is cleaned up both
in the normal case (by the shell command) and on cancellation/timeout.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 06:54:56 +01:00
arkonandClaude Opus 4.5 706392d264 fix: prevent respawn cycle after plan mode auto-accept + enhance action log UI
- Add state check in startPlanCheck() to prevent Enter if state changed
- sendAutoAcceptEnter() now cancels pending AI idle checks and resets state
- Log auto-accept as [command] type for visibility in action log
- Highlight command entries with blue background in action log
- Show action log row when there are actions (not just timers)
- Increase action log height and opacity for better visibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 06:46:20 +01:00
arkonandClaude Opus 4.5 eef6c0690e docs: COM always bumps version in both files (v0.1340)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 05:54:54 +01:00
arkonandClaude Opus 4.5 e1ef848817 docs: clarify COM updates both package.json and CLAUDE.md for version
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 05:54:18 +01:00
arkonandClaude Opus 4.5 6e8878b398 chore: bump package.json version to 0.1339
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 05:53:56 +01:00
arkonandClaude Opus 4.5 0f3a85dc0a docs: add COM shorthand for commit-push-build-restart workflow
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 05:53:21 +01:00
arkonandClaude Opus 4.5 6dba5e9671 fix: improve screen sendInput reliability with retry logic (v0.1339)
- Add 100ms delay between text and carriage return to prevent race conditions
- Add retry logic (up to 3 attempts) for carriage return with increasing delays
- Trim trailing whitespace from text to avoid spurious spaces
- Better error logging for debugging input delivery issues

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 05:52:34 +01:00
arkonandClaude Opus 4.5 0f9caa9d29 feat: improve respawn display readability and AI check info (v0.1338)
- State label now white on green pill for better visibility
- AI check shows detailed status with color-coded badges:
  - Blue: Analyzing terminal output
  - Green: Idle confirmed
  - Yellow: Working detected
  - Gray: Disabled
- Shows time since last check when recent (<2min)
- Bump version to 0.1338

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 05:00:43 +01:00
arkonandClaude Opus 4.5 c6588ce352 refactor: simplify respawn controller display and improve CLAUDE.md
Respawn banner changes:
- Human-friendly state labels (e.g., "Kickstarting..." vs "waiting_kickstart")
- Removed redundant "→ waiting for" text
- Simplified AI check display (only shows when actively checking)
- Shorter cycle counter (#1 vs "Cycle 1")
- Fixed NaN timer bug with validation
- Flatter HTML structure

CLAUDE.md improvements:
- Reorganized Commands section into clear subsections
- Test port allocation in table format
- Simplified TypeScript config section
- Removed duplicate keyboard shortcuts (already in README)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 04:57:09 +01:00
arkonandClaude Opus 4.5 071960aba9 docs: add version, keyboard shortcuts, and test config details to CLAUDE.md
- Add version 0.1337 to project overview
- Add keyboard shortcuts section for web UI (Ctrl+Enter, Ctrl+W, etc.)
- Add teardown timeout (60s) and coverage excludes to test comments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 04:07:43 +01:00
arkonandClaude Opus 4.5 ee6b6596d6 feat: add version display in toolbar (v0.1337)
- Display version number in center of bottom toolbar
- Load version from package.json via server's /api/status
- Version shown on initial load and SSE reconnect

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 04:04:24 +01:00
arkonandClaude Opus 4.5 d19d6ceddd feat: add respawn controller verbosity with countdown timers and bug fixes
- Fix "enable twice" bug: add enabled:true to getModalRespawnConfig()
- Add timer tracking with countdown display in respawn banner
- New events: timerStarted, timerCancelled, timerCompleted, actionLog
- Show active timers with progress bars and recent action log
- Skip remaining timeouts after AI check returns IDLE/WORKING verdict
- Enhanced DetectionStatus with activeTimers, recentActions, currentPhase

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 03:57:44 +01:00
arkonandClaude Opus 4.5 ae4c445601 feat: add AI-powered plan mode detection for auto-accept
Adds a two-stage gate before auto-accepting plan mode prompts:
1. Strict regex pre-filter - checks for numbered options + selector
2. AI confirmation - spawns Opus to classify as PLAN_MODE or NOT_PLAN_MODE

This prevents spurious Enter key presses when Claude is paused mid-thought
or experiencing network lag, rather than showing a plan approval prompt.

New files:
- src/ai-plan-checker.ts: AI checker following ai-idle-checker.ts pattern

Config fields added to RespawnConfig:
- aiPlanCheckEnabled (default: true)
- aiPlanCheckModel (default: claude-opus-4-5-20251101)
- aiPlanCheckMaxContext (default: 8000)
- aiPlanCheckTimeoutMs (default: 60000)
- aiPlanCheckCooldownMs (default: 30000)

New events: planCheckStarted, planCheckCompleted, planCheckFailed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 02:55:43 +01:00
arkonandClaude Opus 4.5 5ce95ee1ba fix: respawn controller stuck after AI check and AI check PATH discovery
Two bugs fixed:

1. Respawn controller got stuck after AI check returned WORKING/ERROR.
   The pre-filter and no-output timers fired once but were never restarted,
   leaving the controller in a dead 'watching' state with no retry mechanism.
   Now restarts both timers after any non-IDLE AI check result and on
   cooldown expiry. Also seeds the controller's terminal buffer from the
   session's existing output so the first AI check has context.

2. AI idle checker couldn't find the claude binary in restricted environments
   (systemd service). The spawned screen ran `claude -p` without PATH
   augmentation. Now exports getAugmentedPath() from session.ts and prepends
   it in the AI checker's bash command.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 20:19:55 +01:00