Skip to content

feat: Auto Claude's MCP Contribution, RDR let Claude and Auto-Claude finish your tasks in your absence, use MCP to create batches of tasks#1855

Open
topemalheiro wants to merge 312 commits intoAndyMik90:developfrom
topemalheiro:develop
Open

feat: Auto Claude's MCP Contribution, RDR let Claude and Auto-Claude finish your tasks in your absence, use MCP to create batches of tasks#1855
topemalheiro wants to merge 312 commits intoAndyMik90:developfrom
topemalheiro:develop

Conversation

@topemalheiro
Copy link

@topemalheiro topemalheiro commented Feb 16, 2026

Base Branch

  • This PR targets the develop branch (required for all feature/fix PRs)
  • This PR targets main (hotfix only - maintainers)

Description

Adds an MCP server (15 tools) that lets Claude Code orchestrate Auto-Claude tasks programmatically and/or unattended. Includes RDR (Recover, Debug, Resend) — a 6-priority automatic recovery system that detects stuck/failed tasks and sends recovery prompts to a master LLM via MCP. Enables unattended overnight batch runs with auto-shutdown when all tasks are complete.

Key additions:

  • MCP server with 15 tools for task creation, monitoring, recovery, and batch orchestration
  • RDR system (Recover, Debug, Resend)
    • Automatic 6-priority recovery: auto-continue → auto-recover → request changes → JSON fix → manual debug → recreate
    • Per-task RDR toggle — when enabled, failed tasks hold their queue slot until the master LLM resolves them via MCP
    • When disabled, queue advances normally past failed tasks
  • Auto-shutdown — monitors all tasks, shuts down computer when all reach completion
  • Auto-resume on session limit reset
  • Crash recovery watchdog — external process monitors app health, auto-restarts on crash
  • Output monitor — detects Claude Code session state via JSONL transcripts
  • Window manager — PowerShell-based RDR message delivery to Claude Code terminal, with configurable shell script support via settings
  • HuggingFace OAuth integration
  • 200+ bug fixes and stability improvements across multiple multi-day debugging sessions

Related Issue

N/A — Feature contribution from fork

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 📚 Documentation
  • ♻️ Refactor
  • 🧪 Test

Area

  • Frontend
  • Backend
  • Fullstack

Commit Message Format

feat: MCP server, RDR auto-recovery & batch task orchestration.

AI Disclosure

  • This PR includes AI-generated code (Claude, Copilot, etc.)

Tool(s) used: Claude Code (Opus)
Testing level:

  • Untested -- AI output not yet verified

  • Lightly tested -- ran the app / spot-checked key paths

  • Fully tested -- all tests pass, manually verified behavior

  • I understand what this PR does and how the underlying code works

Checklist

  • I've synced with develop branch
  • I've tested my changes locally
  • I've followed the code principles (SOLID, DRY, KISS)
  • My PR is small and focused (< 400 lines ideally)

Platform Testing Checklist

  • Windows tested (either on Windows or via CI)
  • macOS tested (either on macOS or via CI)
  • Linux tested (CI covers this)
  • Used centralized platform/ module instead of direct process.platform checks
  • No hardcoded paths (used findExecutable() or platform abstractions)

CI/Testing Requirements

  • All CI checks pass on all platforms (Windows, macOS, Linux)
  • All existing tests pass
  • New features include test coverage
  • Bug fixes include regression tests

Screenshots

N/A — Backend/infrastructure changes

Feature Toggle

  • Behind localStorage flag
  • Behind settings toggle
  • Behind environment variable/config
  • N/A - Feature is complete and ready for all users

Breaking Changes

Breaking: No

Summary by CodeRabbit

  • New Features

    • Built-in MCP server, full RDR workflows (batch recovery, QA fixes) and VS Code window messaging.
    • Hugging Face integration (auth, repo management, model listing) and rate‑limit “Wait & Resume”.
    • Global auto‑shutdown UI and watchdog-based crash auto‑restart; graceful restart with state restore.
  • Improvements

    • Enhanced crash detection, notifications and restart UX; Kanban: per‑task RDR controls, queue blocking and auto‑resume.
    • Better Windows/worktree handling, file‑watcher auto‑refresh and diagnostics.
  • Bug Fixes

    • Deleting running tasks now force‑kills agents and cleans up worktrees before removal.
  • Documentation

    • Extensive MCP/RDR and crash‑recovery docs and checklists added.

topemalheiro and others added 30 commits January 31, 2026 16:07
Phase 4: Crash Detection
- Modified agent-process.ts exit handler to detect crashes
- Crash = non-zero exit code + signal !== 'SIGTERM'
- Writes .restart-requested marker on crash
- Triggers buildAndRestart after 5s delay if autoRestartOnFailure enabled

Phase 5: MCP Tool Integration
- Added trigger_auto_restart MCP tool to mcp-server/index.ts
- Tool accepts reason (prompt_loop|crash|manual|error) and optional buildCommand
- Checks if feature is enabled before triggering
- Saves running task state before restart
- Returns success/error status to caller

With Phases 1-6 complete, Auto-Claude can now:
- Detect prompt loops via Claude Code hook
- Detect crashes via process exit monitoring
- Rebuild and restart automatically
- Resume running tasks after restart
- Rate limit restarts (3/hour, 5min cooldown)
- Be controlled via MCP for manual restart
- Run unattended overnight with auto-shutdown integration

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Build error fix:
- Changed restart-handlers.ts to receive agentManager as parameter
- Updated registerRestartHandlers() and checkAndHandleRestart() signatures
- Modified calls in index.ts and ipc-handlers/index.ts to pass agentManager
- Removed saveRestartState calls from agent-process.ts and mcp-server/index.ts
  (they don't have access to agentManager, task state will be saved on startup)

Why this was needed:
- restart-handlers.ts tried to import { agentManager } but it's not exported
- AgentManager is instantiated as local var in main/index.ts
- Other IPC handlers receive agentManager as parameter (standard pattern)

Build now succeeds ✅

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changes:
- Added CV Project path (C:\Users\topem\Desktop\CV Project) to CLAUDE.md
- Documented RDR→MCP integration for automatic task recovery
- Added workflow for Claude Code to auto-invoke /auto-claude-mcp skill
- Specified Priority 1 (auto-resume) and Priority 3 (JSON fix) workflows
- Added project path resolution guide (CV Project, Auto-Claude Mod)

RDR Integration:
- When Claude Code receives RDR notifications, it should automatically:
  1. Invoke /auto-claude-mcp skill
  2. Determine project path from context or ask user
  3. Apply Priority 1 recovery (resume incomplete tasks)
  4. Apply Priority 3 recovery (fix JSON errors)
  5. Confirm recovery to user

Fixed 9 tasks in CV Project:
- Priority 1 (resumed): 071-marko, 073-qwik, 077-shadow-component-libs,
  079-alpine-htmx-knockout, 080-svelte-aurelia, 081-ats-major
- Priority 3 (JSON fixed): 082-ats-other, 083-rte-major, 084-rte-other

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace numeric window handles with title pattern matching to prevent
"Invalid window handle" errors. Windows are now re-enumerated just
before sending messages, ensuring fresh handles are always used.

Changes:
- window-manager.ts: Accept titlePattern instead of handle
- rdr-handlers.ts: Pass titlePattern to window manager
- task-api.ts: Update API type definitions
- KanbanBoard.tsx: Extract title from selected window

Fixes race condition where window handles become stale between
enumeration (30s+ due to batching/idle checks) and usage.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…R detection

PROBLEM:
- Frontend RDR checks for task.exitReason === 'error' or 'prompt_loop'
- Backend NEVER wrote this field to implementation_plan.json
- Result: RDR could never detect errors or prompt loops

ROOT CAUSE:
- run_agent_session() returned status="error" in memory only
- No code anywhere wrote {"exitReason": "error"} to JSON file
- Frontend reads JSON file → finds NO exitReason → RDR skips task

FIX:
1. Added _save_exit_reason() helper to write exitReason to JSON
2. Call it when status == "error" (session crashes)
3. Call it when attempt_count >= 3 (prompt loop detection)
4. Updated both coder.py and planner.py

FILES CHANGED:
- apps/backend/agents/coder.py: Write exitReason on errors and prompt loops
- apps/backend/agents/planner.py: Write exitReason on planning failures

BENEFITS:
- RDR can now detect tasks with exitReason: "error"
- RDR can now detect tasks with exitReason: "prompt_loop" (3+ failed attempts)
- Frontend detection logic (lines 1045-1048 in rdr-handlers.ts) now functional
- Auto-recovery system works as designed

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
PROBLEM:
RDR was detecting all 19 tasks as having "Empty plan (0 phases)" despite
them having phases. This caused false positives where every task was
flagged as needing intervention.

ROOT CAUSE:
Data structure mismatch between ProjectStore and RDR detection logic:
- RDR checks task.phases (array) in needsIntervention()
- ProjectStore returned phaseCount (number) for logging only
- ProjectStore didn't include phases array in task object
- Result: !task.phases was true for ALL tasks → false positives

CONSOLE EVIDENCE:
[ProjectStore] Loaded plan for 073-qwik: { phaseCount: 5, subtaskCount: 21 }
[RDR] ✅ Task 073-qwik needs intervention: Empty plan (0 phases)

FIX APPLIED:
1. Added phases, planStatus to TaskInfo interface (rdr-handlers.ts)
2. Added phases, planStatus to Task interface (task.ts)
3. Updated ProjectStore to include phases: plan?.phases in task object
4. Updated ProjectStore to include planStatus: plan?.planStatus

RDR now receives full task data including:
- phases: Array<Phase> - for empty plan detection
- planStatus: string - for plan approval detection
- exitReason: string - for error/prompt_loop detection (already working)

VERIFICATION:
- Frontend build passes with no TypeScript errors
- Task object now matches RDR expectations
- False positives should be eliminated

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Previously, RDR would interrupt Claude Code during active work sessions
(plan mode, coding, etc.) because the output monitor sometimes showed
'IDLE' state even when Claude was actively working.

Changes:
- Add minimum idle time check (30 seconds) in checkClaudeCodeBusy()
- Require Claude to be idle for 30s before considering truly idle
- This prevents interrupting during active work while still allowing
  RDR to trigger after genuine idle periods

The timer-based batching (30s collection window) and busy checks are
already working correctly. This fix just makes the idle detection more
conservative to prevent false positives.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Previously, RDR required 30 seconds of idle time even when the IDLE
state was from aged-out JSONL files (no recent transcripts found).
This blocked RDR from sending notifications after interrupted tool use
or when sessions genuinely ended.

Changes:
- Skip minimum idle wait when recentOutputFiles === 0 (aged-out session)
- Preserve 30-second wait for recently completed active work sessions
- This allows RDR to send immediately for abandoned sessions while
  still preventing interruptions during active work

Fixes the issue where interrupted tool use blocked RDR indefinitely.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Previously, RDR blocked notifications when Claude was AT_PROMPT (waiting
for user input), treating it the same as PROCESSING (active work).

This was incorrect - AT_PROMPT means Claude is idle and waiting for input,
so an RDR notification is just another form of input and should be allowed.

Changes:
- Remove AT_PROMPT from busy check (only block on PROCESSING)
- Add log message when AT_PROMPT state is OK for RDR
- RDR now sends notifications when Claude is IDLE or AT_PROMPT

This allows RDR to work immediately when Claude asks questions or waits
for user input, instead of being blocked indefinitely.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Previously, RDR blocked notifications when Claude was AT_PROMPT (waiting
for user input), treating it the same as PROCESSING (active work).

This was incorrect - AT_PROMPT means Claude is idle and waiting for input,
so an RDR notification is just another form of input and should be allowed.

Changes:
- Remove AT_PROMPT from busy check (only block on PROCESSING)
- Add log message when AT_PROMPT state is OK for RDR
- RDR now sends notifications when Claude is IDLE or AT_PROMPT

This allows RDR to work immediately when Claude asks questions or waits
for user input, instead of being blocked indefinitely.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@CLAassistant
Copy link

CLAassistant commented Feb 16, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

Adds a large feature set: a filesystem-backed local MCP server, full Recover‑Debug‑Resend (RDR) system, crash/watchdog tooling and auto-restart, rate‑limit wait/resume, Hugging Face integration, extensive frontend IPC/UI changes (Kanban RDR, auto‑shutdown), platform/worktree/process utilities, and documentation.

Changes

Cohort / File(s) Summary
Documentation & Config
/.claude/skills/auto-claude-mcp/skill.md, /.claude/skills/auto-claude-rdr/skill.md, CLAUDE.md, MERGE-TESTING-CHECKLIST.md, .github/dependabot.yml, .gitignore, Auto-Claude-MCP.example.bat, apps/frontend/.env.example
New and expanded docs, dependabot ignore rules, .gitignore updates, and an example watchdog launcher.
MCP Server & Tools
apps/frontend/src/main/mcp-server/index.ts, apps/frontend/src/main/mcp-server/types.ts, apps/frontend/src/main/mcp-server/utils.ts, apps/frontend/src/main/mcp-server/*
New standalone filesystem-backed MCP server and toolset (create/list/start tasks, batches, recover_stuck_task, process_rdr_batch, defer_task, trigger_auto_restart, crash polling, Electron mocks and entry scripts).
RDR Core & IPC
apps/frontend/src/main/ipc-handlers/rdr-handlers.ts, apps/frontend/src/main/platform/rdr-message-sender.ts
Complete RDR implementation: task enrichment, categorization, batching (timer & event-driven), signaling, auto-fix/submit flows, and IPC surface.
Watchdog & Crash Notification
apps/frontend/src/main/watchdog/*, apps/frontend/src/main/crash-recovery-handler.ts, apps/frontend/src/main/watchdog/crash-notifier.ts
New AutoClaudeWatchdog, crash-loop protection, crash-flag/notification writing, and crash-to-CLAUDE notification plumbing.
Frontend IPC & Handlers
apps/frontend/src/main/ipc-handlers/... (rdr, rate-limit, restart, auto-shutdown, huggingface, agent-events, task/*, debug, env, graceful-restart)
Many new/updated IPC handlers: rate-limit wait/cancel, restart/graceful restart, auto-shutdown orchestration, Hugging Face OAuth/repo handlers, agent event enhancements (rate-limit/crash handling), TASK_TOGGLE_RDR, and debug crash trigger.
Preload / MCP client APIs
apps/frontend/src/preload/api/..., apps/frontend/src/main/mcp-server/docs/skill.md
New preload API surfaces for Hugging Face, RDR ops, rate-limit wait events, auto-shutdown controls, VS Code window messaging, and debug trigger.
Frontend UI / Kanban / Renderer
apps/frontend/src/renderer/... (KanbanBoard, SortableTaskCard, TaskCard props, AutoShutdownToggle, SDKRateLimitModal, App.tsx, Sidebar, GitHubSetupModal)
Kanban extended for RDR (per-task toggles, queue blocking, held slots), auto-refresh on spec changes, auto-shutdown UI, rate-limit wait UI, and Hugging Face setup flow.
File watching & task orchestration
apps/frontend/src/main/file-watcher.ts, apps/frontend/src/main/ipc-handlers/project-handlers.ts
Per-project specs directory watchers, resume heuristics, force‑recovery dedupe, start_requested handling, and events for task start/status changes.
Task lifecycle & project store
apps/frontend/src/main/task-state-manager.ts, apps/frontend/src/main/project-store.ts, apps/backend/implementation_plan/plan.py
Persistence behavior changes (persistStatus now boolean), new FORCE_* transitions, ImplementationPlan fields chain/chainedFrom, and project-store methods (getTaskBySpecId, updateTaskStatus, toggleTaskRdr) plus exposure of exitReason/rateLimitInfo.
Agent/process & platform tooling
apps/frontend/src/main/agent/agent-process.ts, apps/frontend/src/main/cli-tool-manager.ts, apps/frontend/src/main/platform/..., apps/frontend/src/main/env-utils.ts, apps/frontend/src/main/platform/windows/...
PID file lifecycle, force‑recovery reversion, crash-detection auto-restart, Windows bundled claude.exe lookup, normalizePathForGit, improved killProcessGracefully, Windows window-manager and PowerShell-based message sending, and platform RDR message sender.
Rate-limit wait & detector
apps/frontend/src/main/rate-limit-waiter.ts, apps/frontend/src/main/rate-limit-detector.ts, apps/frontend/src/main/ipc-handlers/rate-limit-handlers.ts
Per-task rate-limit tracking, wait-and-resume lifecycle, countdown/progress IPC events, and auto-resume callbacks.
Worktree & cleanup
apps/frontend/src/main/ipc-handlers/task/worktree-handlers.ts, apps/frontend/src/main/utils/worktree-cleanup.ts, apps/frontend/src/main/ipc-handlers/task/crud-handlers.ts
Resilient worktree removal with retries and platform fallbacks, centralized cleanupWorktree, and force-kill flow when deleting running tasks.
Output monitoring & Claude integration
apps/frontend/src/main/claude-code/output-monitor.ts
New ClaudeOutputMonitor watches JSONL transcripts and emits lifecycle events (AT_PROMPT, PROCESSING, IDLE) to drive event-driven RDR batching.
Sentry & subprocess env
apps/frontend/src/main/sentry-config.ts, apps/backend/core/client.py
Sentry env helpers for subprocesses; backend client: Windows SDK bypass and externalization of long system prompts to file on Windows.
Misc / Tests / Scripts
apps/frontend/src/main/ipc-handlers/huggingface/__tests__/utils.test.ts, package.json scripts, electron-loader, MCP start scripts
Hugging Face utils tests, MCP loader & start scripts, package.json scripts updated to use npx/tsx, and dependency @modelcontextprotocol/sdk added.

Sequence Diagram(s)

sequenceDiagram
    participant UI as Renderer (Kanban / UI)
    participant Main as Electron Main
    participant MCP as Local MCP Server
    participant FS as Filesystem (specs / signal files)
    participant Claude as Claude Code / Agent

    UI->>Main: trigger RDR (manual ping / auto-trigger)
    Main->>MCP: request batch processing / process_rdr_batch
    MCP->>FS: read implementation_plan.json, task_metadata, logs
    MCP->>MCP: categorize tasks & build batch prompt
    MCP->>FS: write rdr-pending signal file
    MCP->>Claude: notify via filesystem signal or platform sender
    Claude->>FS: process batch, write responses / update plans
    Claude->>Main: output-monitor signals state changes (PROCESSING → IDLE)
    Main->>UI: emit TASK_STATUS_CHANGED and RDR results
    UI->>Main: request recover_stuck_task or submit_task_fix_request
    Main->>MCP: invoke recovery tool (recover_stuck_task / submit_task_fix_request)
    MCP->>FS: update plans / write QA_FIX_REQUEST.md
    MCP->>Main: return operation result
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related issues

Possibly related PRs

Suggested labels

feature, area/fullstack, size/XL

Suggested reviewers

  • AndyMik90
  • AlexMadera

"🐰
Watchdog hums as tasks take flight,
RDR batches stitch the midnight right.
MCP and Claude in careful dance,
Stuck tasks healed with one brave glance.
Hops of joy — the rabbit cheers tonight!"

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: MCP integration, RDR system for automatic recovery, and ability to create task batches unattended.
Docstring Coverage ✅ Passed Docstring coverage is 92.54% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Thanks for your first PR!

A maintainer will review it soon. Please make sure:

  • Your branch is synced with develop
  • CI checks pass
  • You've followed our contribution guide

Welcome to the Auto Claude community!

@sentry
Copy link

sentry bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 32.75862% with 39 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/backend/agents/coder.py 31.57% 13 Missing ⚠️
apps/backend/agents/planner.py 23.52% 13 Missing ⚠️
apps/backend/core/client.py 31.25% 11 Missing ⚠️
apps/backend/implementation_plan/plan.py 66.66% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @topemalheiro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances Auto-Claude's autonomy and resilience by introducing a robust MCP server for programmatic control, an advanced RDR system for automated task recovery, and various automation features like auto-shutdown and crash recovery. It also expands integration capabilities with HuggingFace and refines core task management and Git operations for improved stability and user experience. The changes aim to enable unattended, overnight batch runs and more intelligent handling of task failures.

Highlights

  • MCP Server with 15 Tools: Introduced a comprehensive Model Context Protocol (MCP) server that enables Claude Code and other MCP clients to programmatically interact with Auto-Claude for task creation, management, monitoring, and recovery. This includes tools for creating single or batch tasks, listing tasks, getting task status, starting tasks, waiting for human review with shutdown hooks, and various RDR-specific tools.
  • RDR (Recover, Debug, Resend) System: Implemented a 6-priority automatic recovery system to detect and address stuck or failed tasks. This system includes auto-continue, auto-recover, request changes, JSON fix, manual debug, and delete/recreate or build/restart options. It leverages file watchers and MCP tools to automatically intervene and guide tasks back to completion or escalate for human review.
  • Enhanced Task Automation & Resilience: Added features like auto-shutdown upon task completion, auto-resume after rate limit resets, a crash recovery watchdog for external process monitoring and auto-restarts, and an output monitor to detect Claude Code's session state via JSONL transcripts. Task chaining for sequential execution and a Windows-specific window manager for RDR message delivery to Claude Code terminals are also included.
  • HuggingFace Integration: Integrated HuggingFace OAuth for authentication and repository management, allowing users to list, detect, create, and manage ML models and model cards directly within Auto-Claude.
  • Robust Worktree and Git Management: Improved worktree cleanup with fallback mechanisms for stubborn file locks and orphaned worktrees. Git operations now use normalized paths for better cross-platform compatibility, and Dependabot configurations were updated to ignore major version bumps for safer dependency management.
  • Bug Fixes and Stability Improvements: Addressed over 200 bug fixes and stability improvements, including handling Windows command line length limits by externalizing large system prompts, ensuring critical Windows environment variables are preserved during subprocess spawning, and refining task status persistence and queue processing logic.
Changelog
  • .claude/skills/auto-claude-mcp/skill.md
    • Added documentation for Auto-Claude MCP skill, including agent profiles, MCP tools, RDR system, custom phase configuration, task status flow, overnight workflow, task chaining, and LLM Manager control.
  • .claude/skills/auto-claude-rdr/skill.md
    • Added comprehensive documentation for the Auto-Claude RDR (Recover Debug Resend) system, detailing recovery types, instant workflow, MCP tools, 6-level auto-escalation priority system, decision tree, and crash recovery system.
  • .github/dependabot.yml
    • Added ignore rules to block major version updates for pip and npm dependencies.
  • .gitignore
    • Added new entries for various temporary, personal, and project-specific files, including .claude/settings.local.json, .claude/projects/, and .claude/memory/.
  • Auto-Claude-MCP.example.bat
    • Added a new example batch script for launching Auto-Claude with an external watchdog on Windows.
  • CLAUDE.md
    • Updated with detailed documentation on the RDR system, crash recovery, and Dependabot PR review guidelines.
    • Added sections on Auto-Claude MCP integration and task creation methods.
  • MERGE-TESTING-CHECKLIST.md
    • Added a new merge testing checklist for verifying features after resolving merge conflicts, specifically for RDR, auto-shutdown, MCP server, task crash recovery, file watcher, exit reason persistence, queue management, and state machine transitions.
  • apps/backend/agents/coder.py
    • Imported timezone from datetime.
    • Added _save_exit_reason function to persist task exit reasons to implementation_plan.json.
    • Integrated calls to _save_exit_reason for stuckRetry_loop, error, rate_limit, and auth_failure scenarios.
  • apps/backend/agents/planner.py
    • Imported json and timezone.
    • Added _save_exit_reason function.
    • Integrated calls to _save_exit_reason for error scenarios.
  • apps/backend/core/client.py
    • Added CLAUDE_AGENT_SDK_SKIP_VERSION_CHECK environment variable for Windows to prevent anyio.open_process() failures.
    • Implemented a mechanism to externalize large system prompts to a file (system_prompt_cache.md) on Windows to avoid WinError 206 (command line too long).
    • Added diagnostic logging for critical Windows environment variables.
  • apps/backend/implementation_plan/plan.py
    • Added chain and chainedFrom fields to the ImplementationPlan model for task chaining functionality.
  • apps/frontend/.env.example
    • Added comments and example configuration for the MCP server.
  • apps/frontend/.gitignore
    • Added nul and new .claude related entries to ignore local settings, projects, and memory files.
  • apps/frontend/electron.vite.config.ts
    • Removed @electron-toolkit/utils from external dependencies to avoid electron.app access issues.
  • apps/frontend/package.json
    • Updated scripts to use npx explicitly for electron-vite commands.
    • Added dev:watchdog and start:direct scripts.
    • Added @modelcontextprotocol/sdk dependency.
  • apps/frontend/src/main/agent/agent-process.ts
    • Added PID file helpers (writePidFile, deletePidFile) for cross-process killing from the MCP server.
    • Ensured critical Windows system environment variables are preserved for subprocess spawning.
    • Implemented logic to handle forceRecovery flags during process exit for XState reversion.
    • Added crash detection and auto-restart triggering based on settings.
  • apps/frontend/src/main/claude-code/output-monitor.ts
    • Added a new module for monitoring Claude Code's session state via JSONL transcripts, detecting AT_PROMPT, PROCESSING, and IDLE states, and emitting events for real-time RDR triggering.
  • apps/frontend/src/main/cli-tool-manager.ts
    • Modified getClaudeCliPathForSdk to find the SDK's bundled claude.exe on Windows when the detected CLI is a .cmd file.
    • Added findBundledClaudeExe helper.
  • apps/frontend/src/main/crash-recovery-handler.ts
    • Added a new module to check for crash flag files on Electron startup, build crash notification messages, and send them to Claude Code via the RDR system.
  • apps/frontend/src/main/electron-compat.ts
    • Added a new module providing an Electron compatibility layer with fallback implementations for non-Electron contexts (e.g., MCP server running as standalone Node.js process).
  • apps/frontend/src/main/file-watcher.ts
    • Added watchSpecsDirectory to monitor for new task folders and implementation_plan.json files.
    • Implemented logic to determine resume status based on subtask progress.
    • Added handling for start_requested status and forceRecovery flags.
    • Added clearForceRecoveryDedup for RDR.
  • apps/frontend/src/main/index.ts
    • Updated electronApp and is imports to use custom safe implementations.
    • Added checkAndHandleRestart and resumeTasksAfterRestart calls on app startup.
    • Integrated checkAndNotifyCrash.
    • Added cleanup for stale crash flags and wrapped app.whenReady() in a try-catch for startup crash visibility.
  • apps/frontend/src/main/ipc-handlers/agent-events-handlers.ts
    • Integrated fileWatcher events (specs-changed, task-start-requested, task-force-recovery, task-status-changed, task-regression-detected) to trigger UI refreshes, auto-starts, agent killing, and RDR processing.
    • Added startWatchingAllProjectSpecs and startWatchingProjectSpecs functions.
  • apps/frontend/src/main/ipc-handlers/auto-shutdown-handlers.ts
    • Added a new module for auto-shutdown IPC handlers, including functions to get active task IDs, count tasks by status, and manage the global auto-shutdown monitor process.
  • apps/frontend/src/main/ipc-handlers/debug-handlers.ts
    • Added DEBUG_TRIGGER_CRASH IPC handler to trigger a native crash for watchdog testing.
  • apps/frontend/src/main/ipc-handlers/env-handlers.ts
    • Added Hugging Face integration environment variables (HUGGINGFACE_ENABLED, HUGGINGFACE_REPO_ID) to the .env file generation and parsing.
  • apps/frontend/src/main/ipc-handlers/graceful-restart-handler.ts
    • Added a new module for graceful application restarts, including functions to save/restore app state and perform restarts.
  • apps/frontend/src/main/ipc-handlers/huggingface-handlers.ts
    • Added a new entry point for Hugging Face IPC handlers.
  • apps/frontend/src/main/ipc-handlers/huggingface/tests/utils.test.ts
    • Added new test file for Hugging Face utility functions.
  • apps/frontend/src/main/ipc-handlers/huggingface/index.ts
    • Added a new module to register all Hugging Face OAuth and repository handlers.
  • apps/frontend/src/main/ipc-handlers/huggingface/oauth-handlers.ts
    • Added a new module for Hugging Face OAuth IPC handlers, including functions to check CLI installation, install CLI, check authentication, login, login with token, get token, and get user info.
  • apps/frontend/src/main/ipc-handlers/huggingface/repository-handlers.ts
    • Added a new module for Hugging Face repository IPC handlers, including functions to list models, detect repositories, create repositories, get branches, and check connection.
  • apps/frontend/src/main/ipc-handlers/huggingface/types.ts
    • Added new type definitions for Hugging Face IPC handlers.
  • apps/frontend/src/main/ipc-handlers/huggingface/utils.ts
    • Added new utility functions for Hugging Face CLI interaction, token retrieval, output parsing, and repository ID validation.
  • apps/frontend/src/main/ipc-handlers/index.ts
    • Registered new IPC handler modules for Hugging Face, auto-shutdown, rate limit, RDR, and restart.
  • apps/frontend/src/main/ipc-handlers/project-handlers.ts
    • Integrated startWatchingProjectSpecs call when a project's auto-build path is initialized or when projects are listed.
  • apps/frontend/src/main/ipc-handlers/rate-limit-handlers.ts
    • Added a new module for rate limit wait-and-resume IPC handlers, including functions to start/cancel waits and emit progress/completion events.
  • apps/frontend/src/main/ipc-handlers/rdr-handlers.ts
    • Added a new module for RDR (Recover Debug Resend) IPC handlers, including functions to reset RDR attempts, categorize tasks, fix JSON errors, submit fix requests, queue tasks, and send RDR messages to VS Code windows.
    • Integrated event-driven processing based on outputMonitor.
  • apps/frontend/src/main/ipc-handlers/restart-handlers.ts
    • Added a new module for auto-restart IPC handlers, including functions to check/record cooldowns, build and restart the app, save/resume task states, and handle restart requests.
  • apps/frontend/src/main/ipc-handlers/settings-handlers.ts
    • Updated is import to use custom safe implementation.
  • apps/frontend/src/main/ipc-handlers/task/archive-handlers.ts
    • Added TASK_TOGGLE_RDR IPC handler to enable/disable RDR auto-recovery for a task.
  • apps/frontend/src/main/ipc-handlers/task/crud-handlers.ts
    • Modified createTask to clear archivedAt metadata when creating a new task.
    • Added force-killing of agent processes before task deletion to release file locks.
  • apps/frontend/src/main/ipc-handlers/task/execution-handlers.ts
    • Updated task start logic to handle various XState states more robustly.
    • Added auto-disabling of per-task RDR when a task is stopped and moves to human_review.
    • Replaced manual worktree cleanup with cleanupWorktree utility.
    • Modified recovery logic to preserve the task's current board position and clear forceRecovery flags.
  • apps/frontend/src/main/ipc-handlers/task/plan-file-utils.ts
    • Added a guard to persistPlanStatusAndReasonSync to skip status persistence when forceRecovery is active.
  • apps/frontend/src/main/ipc-handlers/task/worktree-handlers.ts
    • Added removeWorktreeWithFallback and pruneWorktrees helper functions for more robust worktree management.
  • apps/frontend/src/main/ipc-handlers/terminal/worktree-handlers.ts
    • Added normalizePathForGit import.
  • apps/frontend/src/main/mcp-server/docs/README.md
    • Added new documentation for the Auto-Claude MCP development fork, detailing MCP tools, RDR system, auto-shutdown, auto-refresh, task chaining, output monitor, watchdog process, and window manager.
  • apps/frontend/src/main/mcp-server/docs/skill.md
    • Added new documentation for the Auto-Claude MCP skill, including when to use Auto-Claude vs. direct coding, agent profiles, MCP tools reference, custom phase configuration, task status flow, RDR troubleshooting, and overnight workflow example.
  • apps/frontend/src/main/mcp-server/electron-loader.mjs
    • Added a new ESM loader hook to intercept import from 'electron' and provide a comprehensive mock for standalone MCP server execution.
  • apps/frontend/src/main/mcp-server/index.ts
    • Added a new MCP server implementation with 15 tools for task management, RDR processing, and auto-restart.
    • Includes MCPConnectionMonitor for busy detection and crash notification polling.
  • apps/frontend/src/main/mcp-server/mcp-server.cjs
    • Added a new CommonJS entry point for the MCP server, mocking the Electron environment before loading the TypeScript server.
  • apps/frontend/src/main/mcp-server/mock-electron.js
    • Added a new JavaScript file to mock the Electron environment for standalone MCP server execution.
  • apps/frontend/src/main/mcp-server/mock-electron.mjs
    • Added a new ESM file to mock the Electron module for standalone MCP server execution.
  • apps/frontend/src/main/mcp-server/register-loader.mjs
    • Added a new ESM file to register the Electron mock loader.
  • apps/frontend/src/main/mcp-server/start.js
    • Added a new JavaScript entry point for the MCP server, setting MCP_STANDALONE mode and loading the TypeScript server via tsx.
  • apps/frontend/src/main/mcp-server/start.sh
    • Added a new shell script to launch the MCP server with Electron mocking.
  • apps/frontend/src/main/mcp-server/types.ts
    • Added new type definitions for Auto-Claude MCP server parameters and responses.
  • apps/frontend/src/main/mcp-server/utils.ts
    • Added new utility functions for the MCP server, including resolveProjectPath, toTaskMetadata, createTask, listTasks, getTaskStatus, executeCommand, startTask, getTaskExitReason, and pollTaskStatuses.
  • apps/frontend/src/main/platform/index.ts
    • Added normalizePathForGit function to convert paths for Git operations.
  • apps/frontend/src/main/platform/rdr-message-sender.ts
    • Added a new module for platform-agnostic RDR message sending, supporting custom command templates and platform-specific defaults.
  • apps/frontend/src/main/platform/windows/scripts/get-vscode-windows.ps1
    • Added a new PowerShell script to get all VS Code windows.
  • apps/frontend/src/main/platform/windows/scripts/send-message-to-window.ps1
    • Added a new PowerShell script to send messages to a VS Code window.
  • apps/frontend/src/main/platform/windows/window-manager.ts
    • Added a new module for Windows window management, including functions to get VS Code windows, send messages, check Claude Code busy state, and find windows by title or PID.
  • apps/frontend/src/main/project-store.ts
    • Updated app import to use electron-compat.
    • Added getProjectByPath function.
    • Modified task deduplication logic to prioritize main project data.
    • Added updateTaskStatus and toggleTaskRdr functions.
  • apps/frontend/src/main/python-detector.ts
    • Updated app import to use electron-compat.
  • apps/frontend/src/main/python-env-manager.ts
    • Updated app import to use electron-compat.
  • apps/frontend/src/main/rate-limit-detector.ts
    • Added functions to store, retrieve, and clear rate limit information per task.
    • Updated createSDKRateLimitInfo to include resetAtDate, waitDurationMs, and secondsRemaining.
  • apps/frontend/src/main/rate-limit-waiter.ts
    • Added a new module for managing rate limit wait-and-resume functionality, including functions to start/cancel waits, track progress, and format remaining time.
  • apps/frontend/src/main/sentry-config.ts
    • Added a new module for Sentry configuration utilities, providing functions to retrieve DSN and sample rates without direct @sentry/electron dependency.
  • apps/frontend/src/main/settings-utils.ts
    • Added getDefaultShutdownCommand function to retrieve OS-specific shutdown commands.
  • apps/frontend/src/main/task-state-manager.ts
    • Modified handleManualStatusChange to use FORCE_BACKLOG, FORCE_HUMAN_REVIEW, and FORCE_AI_REVIEW events.
    • Updated persistStatus to return a boolean indicating if persistence was blocked by forceRecovery.
  • apps/frontend/src/main/utils/env.ts
    • Added a new module with isDev and watchWindowShortcuts functions for Electron environment and shortcut management.
  • apps/frontend/src/main/utils/worktree-cleanup.ts
    • Increased maxRetries for directory deletion on Windows.
    • Added cmd /c rd /s /q as a fallback for stubborn file locks.
  • apps/frontend/src/main/watchdog/auto-claude-watchdog.ts
    • Added a new module for the Auto-Claude watchdog, monitoring the main Electron process for crashes, handling restarts, and writing crash flags/notifications.
  • apps/frontend/src/main/watchdog/crash-notifier.ts
    • Added a new module for sending crash notifications to Claude Code via MCP.
  • apps/frontend/src/main/watchdog/index.ts
    • Added a new entry point for the watchdog module.
  • apps/frontend/src/main/watchdog/launcher.ts
    • Added a new standalone Node.js script to launch Auto-Claude with crash recovery, using the AutoClaudeWatchdog.
  • apps/frontend/src/preload/api/agent-api.ts
    • Integrated HuggingFaceAPI into AgentAPI.
  • apps/frontend/src/preload/api/index.ts
    • Integrated HuggingFaceAPI into ElectronAPI.
  • apps/frontend/src/preload/api/modules/debug-api.ts
    • Added triggerCrash function to DebugAPI.
  • apps/frontend/src/preload/api/modules/huggingface-api.ts
    • Added a new module for Hugging Face Integration API operations.
  • apps/frontend/src/preload/api/modules/index.ts
    • Exported huggingface-api.
  • apps/frontend/src/preload/api/task-api.ts
    • Added new types for RDR batch details.
    • Integrated new IPC channels for RDR processing, VS Code window management, auto-shutdown, and debug events.
  • apps/frontend/src/preload/api/terminal-api.ts
    • Integrated new IPC channels for rate limit wait-and-resume functionality.
  • apps/frontend/src/renderer/App.tsx
    • Modified handleRefreshTasks to be a useCallback.
    • Added useEffect to listen for onTaskAutoRefresh events and trigger light refreshes.
    • Updated onRerunWizard to use resetOnboarding from useSettingsStore.
  • apps/frontend/src/renderer/components/AutoShutdownToggle.tsx
    • Added a new React component for a global auto-shutdown toggle, displaying status and allowing users to enable/disable the feature.
  • apps/frontend/src/renderer/components/GitHubSetupModal.tsx
    • Modified GitHubSetupModal to include a provider selection step (GitHub or Hugging Face).
    • Added huggingface-auth step.
    • Updated authentication flow to handle Hugging Face.
  • apps/frontend/src/renderer/components/KanbanBoard.tsx
    • Modified DroppableColumn to include onRefresh, rdrEnabled, queueBlocked, queueBlockReason, and onRdrToggle props.
    • Updated handleDragEnd to unarchive tasks when dragged from the archived state.
    • Implemented queue processing logic to account for heldSlotIdsRef for RDR.
    • Added unblockQueue function.
    • Integrated auto-resume and RDR toggles, VS Code window selection, and manual RDR ping functionality.
    • Added handleTaskRdrToggle and startTaskWithRetry functions.
  • apps/frontend/src/renderer/components/SDKRateLimitModal.tsx
    • Added formatCountdown utility.
    • Integrated wait-and-resume functionality with handleStartWait and handleCancelWait functions, displaying a countdown timer when active.
  • apps/frontend/src/renderer/components/Sidebar.tsx
    • Updated imports to include AutoShutdownToggle and relevant types.
    • Modified selectedProject and disabled props to use currentProjectId for consistency.
    • Integrated AutoShutdownToggle into the sidebar.
  • apps/frontend/src/renderer/components/SortableTaskCard.tsx
    • Modified SortableTaskCard to include onRefresh, rdrEnabled, and onRdrToggle props, passing them down to TaskCard.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Comment on lines 239 to 241
augmentedEnv['PATH'] = augmentedEnv['Path'];
}
}

This comment was marked as outdated.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is an impressive and substantial pull request that introduces a powerful set of features for task automation, recovery, and management through the MCP server and RDR system. The changes are extensive and demonstrate a deep understanding of the architecture, with thoughtful additions for stability, platform-specific workarounds, and user experience. My review focuses on a few areas to enhance maintainability and consistency. Overall, this is a fantastic contribution.

"feature": "My Task",
"description": "Task description",
"status": "start_requested",
"start_requested_at": "2026-01-29T05:00:00Z",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The example timestamp uses a hardcoded future date (2026-01-29T05:00:00Z). While this is for documentation, it could be confusing or accidentally copied. Consider using a placeholder like <YYYY-MM-DDTHH:MM:SSZ> or a more realistic example date to improve clarity and prevent potential issues.

Suggested change
"start_requested_at": "2026-01-29T05:00:00Z",
"start_requested_at": "<YYYY-MM-DDTHH:MM:SSZ>",

[Auto-Claude Crash Recovery] ⚠️ APP RESTARTED AFTER CRASH

**Crash Details:**
- **Time:** 2026-02-03 14:32:45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The example timestamp uses a hardcoded future date (2026-02-03 14:32:45). To avoid confusion and prevent this from being copied verbatim into any configurations or tests, it would be better to use a placeholder like <YYYY-MM-DD HH:MM:SS>.

Suggested change
- **Time:** 2026-02-03 14:32:45
- **Time:** <YYYY-MM-DD HH:MM:SS>

.gitignore Outdated
/shared_docs
logs/security/
Agents.md
nul
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The nul entry is duplicated. It already exists earlier in the file. To keep the .gitignore clean and avoid redundancy, this second entry should be removed.

Comment on lines +227 to +228
"created_at": "2026-01-31T00:00:00Z",
"updated_at": "2026-01-31T00:00:00Z",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The example timestamps use hardcoded future dates (2026-01-31T00:00:00Z). For clarity and to prevent accidental copy-pasting of invalid dates, it's better to use placeholders like <YYYY-MM-DDTHH:MM:SSZ>.

Suggested change
"created_at": "2026-01-31T00:00:00Z",
"updated_at": "2026-01-31T00:00:00Z",
"created_at": "<YYYY-MM-DDTHH:MM:SSZ>",
"updated_at": "<YYYY-MM-DDTHH:MM:SSZ>",

Comment on lines +112 to +122
const result = await mainWindow.webContents.executeJavaScript(`
(async () => {
try {
// Use the existing sendRdrToWindow API
const result = await window.electronAPI.sendRdrToWindow('Claude Code', ${JSON.stringify(message)});
return result;
} catch (error) {
return { success: false, error: error.message };
}
})()
`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The mechanism for sending the crash notification involves the main process executing JavaScript in the renderer process, which then makes an IPC call back to the main process. This round-trip is convoluted and can be simplified.

Since checkAndNotifyCrash is in the main process and has access to mainWindow, it can more directly trigger the notification logic. Consider refactoring this to have checkAndNotifyCrash call the underlying message-sending utility (e.g., sendRdrMessage) directly, removing the need for executeJavaScript and the IPC round-trip. This would improve code clarity and reduce complexity.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 147

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
apps/backend/implementation_plan/plan.py (1)

52-78: ⚠️ Potential issue | 🟠 Major

exitReason set by _save_exit_reason will be silently dropped when ImplementationPlan.save() is called.

_save_exit_reason (in coder.py and planner.py) writes exitReason directly into the JSON file via raw dict manipulation. However, ImplementationPlan has no exitReason field, so any subsequent ImplementationPlan.load().save() round-trip (e.g., line 188 in planner.py: await plan.async_save(plan_file)) will serialize via to_dict() and silently discard exitReason. This breaks the RDR detection contract, as exitReason is critical for the RDR auto-recovery system to determine which tasks need intervention.

Add exitReason as a field on ImplementationPlan (with serialization in to_dict / from_dict), or ensure no code path round-trips the plan through the dataclass after _save_exit_reason has written it.

apps/frontend/src/main/utils/worktree-cleanup.ts (1)

132-154: ⚠️ Potential issue | 🟡 Minor

Replace direct process.platform check with isWindows() utility function.

Line 133 uses process.platform === 'win32' directly, which violates the coding guideline requiring platform abstraction imports. Add import at the top:

+import { isWindows } from '../platform';

Then replace:

-  if (process.platform === 'win32') {
+  if (isWindows()) {
apps/frontend/src/main/rate-limit-detector.ts (1)

720-767: 🛠️ Refactor suggestion | 🟠 Major

Consolidate SDKRateLimitInfo interface to single source in apps/frontend/src/shared/types/terminal.ts.

Two identical definitions of SDKRateLimitInfo exist:

  • apps/frontend/src/main/rate-limit-detector.ts:720 (local duplicate)
  • apps/frontend/src/shared/types/terminal.ts:101 (canonical location)

Imports are inconsistent: the renderer (SDKRateLimitModal.tsx), preload API, and IPC handlers all import from shared/types, while some main-folder files import from rate-limit-detector.ts. This creates risk of divergence during maintenance. Remove the duplicate from rate-limit-detector.ts and ensure all imports reference the canonical definition in shared/types.

apps/frontend/src/preload/api/agent-api.ts (1)

1-12: 🧹 Nitpick | 🔵 Trivial

Update the module doc comment to include HuggingFace.

The file header lists the combined API modules but omits HuggingFace Integration, which is now part of the aggregated API.

📝 Suggested doc update
  * This file serves as the main entry point for agent APIs, combining:
  * - Roadmap operations
  * - Ideation operations
  * - Insights operations
  * - Changelog operations
  * - Linear integration
  * - GitHub integration
+ * - HuggingFace integration
  * - Shell operations
apps/frontend/src/renderer/components/GitHubSetupModal.tsx (1)

248-311: ⚠️ Potential issue | 🟠 Major

Localize newly added hardcoded strings in provider selection and Hugging Face flows.

The new provider-select (lines 407–452) and huggingface-auth (lines 477–487) steps, along with validation error messages (lines 248–311), contain hardcoded user-facing text that must be added to i18n translation keys. Add these to the githubSetup namespace in both en/dialogs.json and fr/dialogs.json:

  • Provider selection title, description, and provider labels
  • Hugging Face connection title and description
  • Validation error messages
Example keys to add
"githubSetup": {
  "providerSelectTitle": "Choose Provider",
  "providerSelectDescription": "Select where you want to store your project. You can use GitHub for code repositories or Hugging Face for ML models.",
  "providers": {
    "github": "GitHub",
    "huggingFace": "Hugging Face"
  },
  "huggingFaceTitle": "Connect to Hugging Face",
  "huggingFaceDescription": "Authenticate with Hugging Face to manage your ML models."
}

Then use t('dialogs:githubSetup.providerSelectTitle') in the component.

Comment on lines +10 to 22
*.lnk

# ===========================
# Personal / accidental files
# ===========================
*.bat
!Auto-Claude-MCP.example.bat
*.vbs
.mcp.json
CHANGES-RDR-ARCHIVE-FIXES.md
npm_install_output.txt
scripts/image/
nul
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Duplicate nul entry.

nul appears both at Line 22 and Line 192. One can be removed.

🤖 Prompt for AI Agents
In @.gitignore around lines 10 - 22, Remove the duplicate "nul" entry from the
.gitignore so only a single "nul" line remains; locate the two occurrences of
the "nul" pattern in the file and delete one of them (leaving the other
unchanged) to avoid redundant entries.

Comment on lines 988 to 990
elif status == "error":
# Write exitReason to implementation_plan.json so RDR can detect it
_save_exit_reason(spec_dir, "error")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Generic "error" exit reason on all non-classified errors.

This is fine as a catch-all, but note that the "error" reason is also written on concurrency errors that later recover via retry (lines 999+). Since _save_exit_reason is called at Line 990 before the concurrency-error branch at Line 999 is entered, every transient concurrency error will write exitReason="error" to the plan — even though the agent is about to retry. If RDR polls the plan during the retry window, it may trigger unnecessary recovery actions.

Consider moving the _save_exit_reason call into the else branch at Line 1215 (non-concurrency, non-rate-limit, non-auth errors) so transient retryable errors don't trigger RDR prematurely.

Proposed fix
         elif status == "error":
-            # Write exitReason to implementation_plan.json so RDR can detect it
-            _save_exit_reason(spec_dir, "error")
-
             emit_phase(ExecutionPhase.FAILED, "Session encountered an error")

             # Check if this is a tool concurrency error (400)
@@ -1215,6 +1212,9 @@
             else:
                 # Other errors - use standard retry logic
+                _save_exit_reason(spec_dir, "error")
+
                 print_status("Session encountered an error", "error")
🤖 Prompt for AI Agents
In `@apps/backend/agents/coder.py` around lines 988 - 990, The current logic calls
_save_exit_reason(spec_dir, "error") as soon as status == "error", which causes
transient retryable errors (e.g., concurrency, rate-limit, auth) to be recorded
as a final "error" before the retry branches run; move the _save_exit_reason
call out of the early status == "error" branch and instead call it only in the
final non-retryable error handling branch (the else branch that handles
non-concurrency, non-rate-limit, non-auth failures) so that transient errors
that trigger the concurrency/rate-limit/auth retry logic do not write
exitReason="error" prematurely. Ensure you keep references to status, spec_dir
and _save_exit_reason and do not change retry flow or error detection logic—only
relocate the write so it executes exclusively for true terminal errors.

Comment on lines +43 to +63
def _save_exit_reason(spec_dir: Path, exit_reason: str) -> None:
"""
Write exitReason to implementation_plan.json so RDR can detect it.

Args:
spec_dir: Spec directory containing implementation_plan.json
exit_reason: The reason for exit ("error", "stuckRetry_loop", etc.)
"""
try:
plan = load_implementation_plan(spec_dir)
if plan:
plan["exitReason"] = exit_reason
plan["updated_at"] = datetime.now(timezone.utc).isoformat()

plan_file = spec_dir / "implementation_plan.json"
with open(plan_file, "w", encoding="utf-8") as f:
json.dump(plan, f, indent=2)

logger.info(f"Set exitReason={exit_reason} in implementation_plan.json")
except Exception as e:
logger.warning(f"Failed to write exitReason to plan: {e}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Duplicated function — extract _save_exit_reason to a shared module.

This function is identical to the one in coder.py (lines 101-124). Extract it into agents/utils.py (which is already imported here) to avoid maintaining two copies.

Additionally, this uses a plain open() + json.dump() write, while the rest of the codebase uses write_json_atomic for implementation_plan.json (see plan.py Line 132). A crash or interrupt during the write could corrupt the plan file. Use write_json_atomic here for consistency and safety.

Proposed shared helper in agents/utils.py
+# In agents/utils.py
+from core.file_utils import write_json_atomic
+
+def save_exit_reason(spec_dir: Path, exit_reason: str) -> None:
+    """Write exitReason to implementation_plan.json so RDR can detect it."""
+    try:
+        plan = load_implementation_plan(spec_dir)
+        if plan:
+            plan["exitReason"] = exit_reason
+            plan["updated_at"] = datetime.now(timezone.utc).isoformat()
+            plan_file = spec_dir / "implementation_plan.json"
+            write_json_atomic(plan_file, plan, indent=2, ensure_ascii=False)
+            logger.info(f"Set exitReason={exit_reason} in implementation_plan.json")
+    except Exception as e:
+        logger.warning(f"Failed to write exitReason to plan: {e}")
🤖 Prompt for AI Agents
In `@apps/backend/agents/planner.py` around lines 43 - 63, Extract the duplicated
_save_exit_reason implementation (currently in planner.py and coder.py) into
agents/utils.py as a shared helper named _save_exit_reason (or save_exit_reason)
and have both planner.py and coder.py import it from agents.utils; in the new
helper call load_implementation_plan to read the plan, set "exitReason" and
"updated_at", and write the file using the project’s write_json_atomic utility
(instead of open/json.dump) to atomically persist implementation_plan.json;
update planner.py and coder.py to remove their local copies and import the
shared function, and ensure any references to load_implementation_plan and
write_json_atomic are imported in agents.utils.py.

Comment on lines 508 to 513
# On Windows, skip the SDK's version check to avoid a potential anyio.open_process() failure.
# The version check spawns a subprocess with different params than the main connect() call,
# and silently catches errors — but it can interfere with the main process on Windows.
if is_windows():
# Validated against claude-agent-sdk v1.x — becomes a no-op if SDK removes this env var
sdk_env["CLAUDE_AGENT_SDK_SKIP_VERSION_CHECK"] = "1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Check project dependencies for SDK version
fd -t f "(requirements|setup|pyproject|poetry|pipfile)" -e txt -e toml -e cfg | head -20

Repository: AndyMik90/Auto-Claude

Length of output: 150


🏁 Script executed:

# Search for the env var in the codebase
rg "CLAUDE_AGENT_SDK_SKIP_VERSION_CHECK" --type py

Repository: AndyMik90/Auto-Claude

Length of output: 153


🏁 Script executed:

# Check if there are any SDK version references in the codebase
rg "claude.agent.sdk|claude-agent-sdk" -t py --type-add 'config:(toml|txt|cfg|lock)' -g "requirements*" -g "pyproject.toml" -g "setup.py"

Repository: AndyMik90/Auto-Claude

Length of output: 179


🏁 Script executed:

# Look for version specifications
cat pyproject.toml 2>/dev/null || cat requirements.txt 2>/dev/null || cat setup.py 2>/dev/null | head -50

Repository: AndyMik90/Auto-Claude

Length of output: 47


🏁 Script executed:

sed -n '508,513p' apps/backend/core/client.py

Repository: AndyMik90/Auto-Claude

Length of output: 527


🏁 Script executed:

# Search for any SDK documentation or version-related comments in the file
rg "v0\.|v1\.|claude-agent-sdk" apps/backend/core/client.py -A 2 -B 2

Repository: AndyMik90/Auto-Claude

Length of output: 334


🏁 Script executed:

# Check imports to see how the SDK is being used
head -50 apps/backend/core/client.py | rg -i "import|from"

Repository: AndyMik90/Auto-Claude

Length of output: 416


🏁 Script executed:

# Check if there are any comments or documentation about SDK versions elsewhere
rg "0\.1\.|claude-agent-sdk" apps/backend/ -i --type py | head -20

Repository: AndyMik90/Auto-Claude

Length of output: 904


🌐 Web query:

claude-agent-sdk 0.1.33 CLAUDE_AGENT_SDK_SKIP_VERSION_CHECK environment variable documentation

💡 Result:

In claude-agent-sdk 0.1.33 (Python) you can disable the Claude Code CLI minimum-version compatibility check by setting this environment variable before starting your program:

  • CLAUDE_AGENT_SDK_SKIP_VERSION_CHECK=true (any “truthy” value is typically used, e.g. true / 1)

This env var was added specifically to “skip the minimum version validation when the SDK connects to Claude Code.” [1] (It’s documented as “add CLAUDE_AGENT_SDK_SKIP_VERSION_CHECK env var” in the project’s release notes.) [2] A simple usage example is: export CLAUDE_AGENT_SDK_SKIP_VERSION_CHECK=true. [3]

Sources: [1] [2] [3]


Update the version reference in the comment to match the actual SDK version in use.

Line 512 states "Validated against claude-agent-sdk v1.x" but the project requires claude-agent-sdk>=0.1.33. The environment variable CLAUDE_AGENT_SDK_SKIP_VERSION_CHECK is recognized in v0.1.33, so the code works correctly—just update the comment to reference the actual tested version (v0.1.33) rather than an incorrect v1.x reference.

🤖 Prompt for AI Agents
In `@apps/backend/core/client.py` around lines 508 - 513, Update the misleading
comment that says "Validated against claude-agent-sdk v1.x" to reference the
actual tested SDK version (v0.1.33) so it accurately reflects validation; edit
the comment near the is_windows() block that sets
sdk_env["CLAUDE_AGENT_SDK_SKIP_VERSION_CHECK"] = "1" to state it was validated
against claude-agent-sdk v0.1.33 (or the project's required version) instead of
v1.x.

Comment on lines +839 to +862
# Windows: Avoid WinError 206 (command line too long).
# Windows CreateProcessW has a 32,767 character limit for the entire command line.
# Large system prompts (e.g. with CLAUDE.md) and inline MCP config can exceed this.
# Fix: write oversized system prompt to a file, pass a short reference instead.
# Also write MCP config to a file so --mcp-config uses a file path, not inline JSON.
_WIN_CMD_SAFE_LIMIT = 28000 # Leave headroom below 32,767

if is_windows() and len(base_prompt) > _WIN_CMD_SAFE_LIMIT:
prompt_cache_file = spec_dir / "system_prompt_cache.md"
prompt_cache_file.write_text(base_prompt, encoding="utf-8")
logger.info(
f"[WinCmdLen] System prompt too long ({len(base_prompt)} chars), "
f"wrote to {prompt_cache_file}"
)
print(
f" - System prompt: externalized to file ({len(base_prompt)} chars > {_WIN_CMD_SAFE_LIMIT} limit)"
)
base_prompt = (
f"CRITICAL: Your complete system instructions are in this file:\n"
f" {prompt_cache_file.resolve()}\n\n"
f"You MUST read this file with the Read tool IMMEDIATELY before doing anything else.\n"
f"Your working directory is: {project_dir.resolve()}\n"
f"Follow ALL instructions in that file. Do not skip this step."
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Missing error handling and potential concurrency issue in prompt externalization.

Two concerns:

  1. No error handling on write: prompt_cache_file.write_text() (Line 848) can raise OSError (permissions, disk full). This would crash create_client() without a clear diagnostic. Wrap in try/except and fall back to the (possibly too-long) inline prompt with a warning.

  2. Fixed filename risks overwrite: system_prompt_cache.md is a static name. If two concurrent agent sessions share the same spec_dir, one will overwrite the other's prompt file mid-session. Consider using a unique suffix (e.g., PID or UUID).

Proposed fix
-    if is_windows() and len(base_prompt) > _WIN_CMD_SAFE_LIMIT:
-        prompt_cache_file = spec_dir / "system_prompt_cache.md"
-        prompt_cache_file.write_text(base_prompt, encoding="utf-8")
+    if is_windows() and len(base_prompt) > _WIN_CMD_SAFE_LIMIT:
+        import uuid
+        prompt_cache_file = spec_dir / f"system_prompt_cache_{uuid.uuid4().hex[:8]}.md"
+        try:
+            prompt_cache_file.write_text(base_prompt, encoding="utf-8")
+        except OSError as e:
+            logger.warning(
+                f"[WinCmdLen] Failed to externalize system prompt: {e}. "
+                f"Proceeding with inline prompt (may exceed command-line limit)."
+            )
+            prompt_cache_file = None

Then guard the prompt replacement on prompt_cache_file is not None.

🤖 Prompt for AI Agents
In `@apps/backend/core/client.py` around lines 839 - 862, The
Windows-prompt-externalization lacks error handling and uses a fixed filename
which can cause overwrites; wrap the prompt write in a try/except around
prompt_cache_file.write_text(...) (catch OSError/Exception), log processLogger/
logger warning with the exception, and if writing fails fall back to leaving
base_prompt inline (do not replace it) so create_client continues; also generate
a unique filename for prompt_cache_file (e.g., include os.getpid() or
uuid.uuid4() in the name or use tempfile.NamedTemporaryFile in spec_dir) so
concurrent sessions won't clobber each other, and only perform the base_prompt
replacement (the CRITICAL message that points to prompt_cache_file.resolve())
when the write succeeded (guard on a successful write flag).

Comment on lines +110 to +125
onTaskListRefresh: (callback: (projectId: string) => void) => () => void;
onTaskAutoStart: (callback: (projectId: string, taskId: string) => void) => () => void;
onTaskStatusChanged: (callback: (data: {
projectId: string;
taskId: string;
specId: string;
oldStatus: TaskStatus;
newStatus: TaskStatus;
}) => void) => () => void;
onTaskRegressionDetected: (callback: (data: {
projectId: string;
specId: string;
oldStatus: string;
newStatus: string;
timestamp: string;
}) => void) => () => void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

onTaskAutoRefresh is missing from the TaskAPI interface.

The implementation at lines 422–436 defines onTaskAutoRefresh, but this method is not declared in the TaskAPI interface. Consumers typing against TaskAPI (i.e., the renderer via window.electronAPI) won't see it, and under strict excess-property checks this would be a compile error.

Proposed fix — add the declaration to the interface (after line 125)
   onTaskRegressionDetected: (callback: (data: {
     projectId: string;
     specId: string;
     oldStatus: string;
     newStatus: string;
     timestamp: string;
   }) => void) => () => void;
+  onTaskAutoRefresh: (callback: (data: {
+    reason: string;
+    projectId: string;
+    specId: string;
+  }) => void) => () => void;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
onTaskListRefresh: (callback: (projectId: string) => void) => () => void;
onTaskAutoStart: (callback: (projectId: string, taskId: string) => void) => () => void;
onTaskStatusChanged: (callback: (data: {
projectId: string;
taskId: string;
specId: string;
oldStatus: TaskStatus;
newStatus: TaskStatus;
}) => void) => () => void;
onTaskRegressionDetected: (callback: (data: {
projectId: string;
specId: string;
oldStatus: string;
newStatus: string;
timestamp: string;
}) => void) => () => void;
onTaskListRefresh: (callback: (projectId: string) => void) => () => void;
onTaskAutoStart: (callback: (projectId: string, taskId: string) => void) => () => void;
onTaskStatusChanged: (callback: (data: {
projectId: string;
taskId: string;
specId: string;
oldStatus: TaskStatus;
newStatus: TaskStatus;
}) => void) => () => void;
onTaskRegressionDetected: (callback: (data: {
projectId: string;
specId: string;
oldStatus: string;
newStatus: string;
timestamp: string;
}) => void) => () => void;
onTaskAutoRefresh: (callback: (data: {
reason: string;
projectId: string;
specId: string;
}) => void) => () => void;
🤖 Prompt for AI Agents
In `@apps/frontend/src/preload/api/task-api.ts` around lines 110 - 125, The
TaskAPI interface is missing the onTaskAutoRefresh declaration that the
implementation provides; add an onTaskAutoRefresh entry to the TaskAPI interface
with the exact callback signature used by the implementation (match the
implementation in onTaskAutoRefresh at lines ~422–436), e.g., add a method named
onTaskAutoRefresh with the same parameter types and return type as the other
listeners (so consumers of TaskAPI / window.electronAPI see it and TypeScript
types align with the implementation).

Comment on lines +501 to +503
// Immediate RDR ping - writes signal file now (no 30s timer)
pingRdrImmediate: (projectId: string, tasks: Task[]): Promise<IPCResult<{ taskCount: number; signalPath: string }>> =>
ipcRenderer.invoke(IPC_CHANNELS.PING_RDR_IMMEDIATE, projectId, tasks),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

pingRdrImmediate sends full Task[] objects over IPC — prefer task IDs.

Every other method in this file passes task IDs (string[]) and lets the main process look up the data. Serializing full Task objects across the IPC bridge is heavier and creates a risk of stale data if the main-process state has diverged. Consider aligning with the rest of the API by accepting taskIds: string[] instead.

🤖 Prompt for AI Agents
In `@apps/frontend/src/preload/api/task-api.ts` around lines 501 - 503, Change
pingRdrImmediate to accept taskIds: string[] instead of full Task[] to match
other API methods and avoid serializing large/stale objects; update the function
signature in apps/frontend/src/preload/api/task-api.ts (pingRdrImmediate) to
(projectId: string, taskIds: string[]) and call
ipcRenderer.invoke(IPC_CHANNELS.PING_RDR_IMMEDIATE, projectId, taskIds) so the
main process can look up tasks by ID (ensure IPC_CHANNELS.PING_RDR_IMMEDIATE
handling in the main process expects string[] and update any callers to pass
task IDs).

Comment on lines +524 to +532
// Auto Shutdown (Global - monitors ALL projects)
getAutoShutdownStatus: () =>
ipcRenderer.invoke(IPC_CHANNELS.GET_AUTO_SHUTDOWN_STATUS),

setAutoShutdown: (enabled: boolean) =>
ipcRenderer.invoke(IPC_CHANNELS.SET_AUTO_SHUTDOWN, enabled),

cancelAutoShutdown: () =>
ipcRenderer.invoke(IPC_CHANNELS.CANCEL_AUTO_SHUTDOWN),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Missing explicit return-type annotations on auto-shutdown methods.

Every other ipcRenderer.invoke call in this file includes an explicit return-type annotation (e.g., : Promise<IPCResult<boolean>>). These three methods omit them, relying on inference from ipcRenderer.invoke (which returns Promise<any>). This silently bypasses type checking on the response shape.

Proposed fix
-  getAutoShutdownStatus: () =>
+  getAutoShutdownStatus: (): Promise<IPCResult<AutoShutdownStatus>> =>
     ipcRenderer.invoke(IPC_CHANNELS.GET_AUTO_SHUTDOWN_STATUS),

-  setAutoShutdown: (enabled: boolean) =>
+  setAutoShutdown: (enabled: boolean): Promise<IPCResult<AutoShutdownStatus>> =>
     ipcRenderer.invoke(IPC_CHANNELS.SET_AUTO_SHUTDOWN, enabled),

-  cancelAutoShutdown: () =>
+  cancelAutoShutdown: (): Promise<IPCResult<void>> =>
     ipcRenderer.invoke(IPC_CHANNELS.CANCEL_AUTO_SHUTDOWN),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Auto Shutdown (Global - monitors ALL projects)
getAutoShutdownStatus: () =>
ipcRenderer.invoke(IPC_CHANNELS.GET_AUTO_SHUTDOWN_STATUS),
setAutoShutdown: (enabled: boolean) =>
ipcRenderer.invoke(IPC_CHANNELS.SET_AUTO_SHUTDOWN, enabled),
cancelAutoShutdown: () =>
ipcRenderer.invoke(IPC_CHANNELS.CANCEL_AUTO_SHUTDOWN),
// Auto Shutdown (Global - monitors ALL projects)
getAutoShutdownStatus: (): Promise<IPCResult<AutoShutdownStatus>> =>
ipcRenderer.invoke(IPC_CHANNELS.GET_AUTO_SHUTDOWN_STATUS),
setAutoShutdown: (enabled: boolean): Promise<IPCResult<AutoShutdownStatus>> =>
ipcRenderer.invoke(IPC_CHANNELS.SET_AUTO_SHUTDOWN, enabled),
cancelAutoShutdown: (): Promise<IPCResult<void>> =>
ipcRenderer.invoke(IPC_CHANNELS.CANCEL_AUTO_SHUTDOWN),
🤖 Prompt for AI Agents
In `@apps/frontend/src/preload/api/task-api.ts` around lines 524 - 532, Add
explicit return-type annotations to the three auto-shutdown methods so their
responses are type-checked instead of inferred as any: update
getAutoShutdownStatus, setAutoShutdown, and cancelAutoShutdown to declare their
return types (e.g., Promise<IPCResult<boolean>> to match other
ipcRenderer.invoke usages in this file) so the IPC result shape is enforced.

Comment on lines +534 to 548
// Debug Events
onDebugEvent: (
callback: (data: { type: string; taskId?: string; agentKilled?: boolean; timestamp: string; [key: string]: unknown }) => void
): (() => void) => {
const handler = (
_event: Electron.IpcRendererEvent,
data: { type: string; taskId?: string; agentKilled?: boolean; timestamp: string }
): void => {
callback(data);
};
ipcRenderer.on(IPC_CHANNELS.DEBUG_EVENT, handler);
return () => {
ipcRenderer.removeListener(IPC_CHANNELS.DEBUG_EVENT, handler);
};
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Type mismatch: onDebugEvent handler drops the index signature.

The TaskAPI interface (line 156) declares the callback data with [key: string]: unknown to allow arbitrary extra fields, but the handler type on line 540 omits it. While JavaScript will pass extra properties through at runtime, the types should match for consistency and so that the handler's internal type doesn't silently narrow the data.

Proposed fix
     const handler = (
       _event: Electron.IpcRendererEvent,
-      data: { type: string; taskId?: string; agentKilled?: boolean; timestamp: string }
+      data: { type: string; taskId?: string; agentKilled?: boolean; timestamp: string; [key: string]: unknown }
     ): void => {
🤖 Prompt for AI Agents
In `@apps/frontend/src/preload/api/task-api.ts` around lines 534 - 548, The
onDebugEvent IPC handler narrows the incoming data type by omitting the index
signature present on the TaskAPI callback type; update the handler parameter
type in onDebugEvent so it matches the declared callback shape (include [key:
string]: unknown) — i.e., change the handler's data parameter type to { type:
string; taskId?: string; agentKilled?: boolean; timestamp: string; [key:
string]: unknown } so the handler and the callback have identical types.

Comment on lines 1 to 98
# Merge Testing Checklist: Main -> Develop

Use this checklist to verify all features work after resolving the 33 merge conflicts.


## Main checklist

- [x?] RDR priority escalation works (P1 -> P3 after 3 attempts)
- [x] Auto-Recover — recover a single or batches of tasks
- [x] Auto-Continue working in batch or single task tool [x] Working for In Progress
- [x] Queue not moving when task regresses from Progress to Planning and [x?] sending RDR when RDR is ON - needs to be tested. [ ] Might need to have tasks that get user stopped into HR get RDR single task toggle offed
- [x?] Regression of tasks RDR detection working
- [x] All incomplete tasks in HR and Regressed to backlog pinged in RDR - test with the method from previous entry
- [...?] Auto-Resume on Rate Limit Reset

## Build & Launch

- [x] `npm install` in `apps/frontend` -- no errors
- [x] `npm run build` -- TypeScript compiles with no errors
- [x] `npm run dev` -- app launches without crashes
- [x] No console errors on startup

---

## Critical -- Our Mod Features (conflict-affected)

### RDR System
- [x] Start 2+ tasks on CV Project
- [x] Wait for a task to get stuck -> RDR detects it and sends recovery message
- [x] RDR does NOT flag actively running tasks (backlog false positive fix)
- [x?] RDR priority escalation works (P1 -> P3 after 3 attempts)
- **Files:** `rdr-handlers.ts`, `KanbanBoard.tsx`, `ipc-handlers/index.ts`

### Auto-Shutdown
- [x] Enable auto-shutdown in settings
- [x] Start tasks -> auto-shutdown detects when all reach human_review/done
- [x] Shutdown monitor spawns correctly (no terminal popup on Windows)
- **Files:** `auto-shutdown-handlers.ts`, `index.ts`, `shutdown-monitor.ts`

### MCP Server and tools
- [x] Claude Code connects to Auto-Claude MCP server
- [x] `list_tasks` returns correct task list
- [x] `create_task` creates a task (appears on Kanban within 2-3s)
- [x] `process_rdr_batch` restarts stuck tasks
- [x] `recover_stuck_task` removes yellow outline and restarts
- [x] Auto-Continue working in batch or single task tool [x] Working for In Progress
- [x...?] Queue not moving when task regresses from Progress to Planning and sending RDR when RDR is ON
- [x?] Regression of tasks RDR detection working
- [x] All incomplete tasks in HR and Regressed to backlog pinged in RDR - test with the method from previous entry
- **Files:** `mcp-server/index.ts`, `project-store.ts`

### Task Crash Recovery
- [x] Kill a task agent process manually
- [x] Crash is detected (exit code != 0)
- [???] Auto-restart triggers if enabled
- [x] Crash info persisted to `implementation_plan.json`
- **Files:** `agent-process.ts`, `agent-events-handlers.ts`

### File Watcher
- [x] Create a new spec directory -> UI auto-refreshes within 2-3s
- [x] Modify `implementation_plan.json` -> board updates automatically
- [x] `start_requested` status triggers agent start
- **Files:** `file-watcher.ts`, `project-store.ts`

### Exit Reason Persistence
- [x] Run a task to completion -> `exitReason: "success"` in plan
- [x] Task crashes -> `exitReason: "error"` saved
- **Files:** `coder.py`, `planner.py`

---

## High -- Upstream Features (must not break)

### Queue Management
- [x] Open queue settings modal from Kanban
- [x] Set queue capacity limits
- [x] Queue enforces capacity (no more than N concurrent tasks)
- **Files:** `KanbanBoard.tsx`

### State Machine Transitions
- [x] Task lifecycle: backlog -> planning -> in_progress -> ai_review -> human_review
- [x] No stuck transitions or missing state updates
- **Files:** `agent-events-handlers.ts`, `execution-handlers.ts`

---

## Notes

_Issues found and fixed during testing:_

- **WinError 206** (fixed `e41b64e7`): System prompt too long for Windows CreateProcessW limit. Externalized to `system_prompt_cache.md`.
- **MCP config crash** (fixed `efa37e6f`): `json.dump()` on SDK Server instance. Removed caching.
- **writeFileSync missing** (fixed `efa37e6f`): Import dropped in merge.
- **shouldSkipStuckCheck missing** (fixed `b292cee4`): Function dropped in merge.
- **XState MARK_DONE** (fixed `914698af`): Only accepted from 3 states, added to all non-terminal states.
- **MCP phase name mapping** (fixed `5a3e01e0`): `specCreation` not mapped to `spec` in `utils.ts`.
- **OutputMonitor false idle** (fixed `5a3e01e0`): Added `hasUnresolvedToolUse()` dynamic check.
- **processQueue merge regression** (fixed `d458073e`): Andy's fix lost in merge, restored + added settings change trigger.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Several checklist items remain unverified.

Lines 8, 11-12, 14, 31, 47-48, and 55 have uncertain markers ([x?], [...?], [???]). If this file ships as part of the PR, consider either resolving these items or clearly marking them as known gaps so they aren't forgotten post-merge.

🧰 Tools
🪛 LanguageTool

[grammar] ~11-~11: Use a hyphen to join words.
Context: ... get user stopped into HR get RDR single task toggle offed - [x?] Regression of t...

(QB_NEW_EN_HYPHEN)


[style] ~89-~89: Consider using a different verb for a more formal wording.
Context: ...s.ts` --- ## Notes Issues found and fixed during testing: - WinError 206 (f...

(FIX_RESOLVE)

🪛 markdownlint-cli2 (0.20.0)

[warning] 27-27: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 34-34: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 40-40: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 52-52: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 59-59: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 65-65: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 74-74: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 80-80: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🤖 Prompt for AI Agents
In `@MERGE-TESTING-CHECKLIST.md` around lines 1 - 98, The checklist contains
ambiguous completion markers ([x?], [...?], [???]) under sections like "Main
checklist", "RDR System", "MCP Server and tools", and "Task Crash Recovery";
update the checklist to remove ambiguity by either (a) verifying each uncertain
item and replacing the marker with a definitive state "[x]" or "[-]" plus a
short note (e.g., "needs follow-up: <who/when>") or (b) explicitly label
remaining items under a "Known Gaps" subsection with a brief rationale and
owner, ensuring all instances of "[x?]", "[...?]", and "[???]" are resolved or
documented so they won't be forgotten post-merge.

@topemalheiro
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

- env-utils.ts: Read both env.PATH and env.Path to preserve original
  system path on Windows (spread makes process.env case-sensitive)
- agent-process.ts: Remove redundant late Path fix (now handled at source)
- coder.py: Move _save_exit_reason("error") after concurrency/rate-limit/auth
  checks so retryable errors don't trigger RDR during retry windows
… comment)

- client.py: split long logger.info lines to pass ruff format check
- client.py: correct SDK version comment from v1.x to v0.1.33
- .gitignore: remove duplicate nul entry (line 192)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants