- Add 45 unit tests for execution lifecycle coordination
- Test constructor, executeFeature, stopFeature, buildFeaturePrompt
- Test approved plan handling, error handling, worktree resolution
- Test auto-mode integration, planning mode, summary extraction
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Extract executeFeature, stopFeature, buildFeaturePrompt from AutoModeService
- Export callback types for test mocking and integration
- Implement persist-before-emit pattern for status updates
- Support approved plan continuation and context resumption
- Track failures and signal pause when threshold reached
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add AutoModeService integration tests for delegation verification
- Test executePipeline delegation with context fields
- Test detectPipelineStatus delegation for pipeline/non-pipeline status
- Test resumePipeline delegation with autoLoadClaudeMd and useWorktrees
- Add edge case tests for abort signals, missing context, deleted steps
- Add PipelineOrchestrator constructor parameter and property
- Initialize PipelineOrchestrator with all required dependencies and callbacks
- Delegate executePipelineSteps to pipelineOrchestrator.executePipeline()
- Delegate detectPipelineStatus to pipelineOrchestrator.detectPipelineStatus()
- Delegate resumePipelineFeature to pipelineOrchestrator.resumePipeline()
- Tests for executePipeline: step sequence, events, status updates
- Tests for buildPipelineStepPrompt: context inclusion, previous work
- Tests for detectPipelineStatus: pipeline status detection and parsing
- Tests for resumePipeline/resumeFromStep: excluded steps, slot management
- Tests for executeTestStep: 5-attempt fix loop, failure events
- Tests for attemptMerge: merge endpoint, conflict detection
- Tests for buildTestFailureSummary: output parsing
37 tests covering all core functionality
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 11 new test cases for execute() behavior
- Test callback invocation (progress events, tool events)
- Test error handling (API errors, auth failures)
- Test result structure and response accumulation
- Test abort signal propagation
- Test branchName propagation in event payloads
Test file: 388 -> 935 lines (+547 lines)
- Add AgentExecutor import to auto-mode-service.ts
- Add agentExecutor as constructor parameter (optional, with default)
- Initialize AgentExecutor with TypedEventBus, FeatureStateManager,
PlanApprovalService, and SettingsService dependencies
This enables constructor injection for testing and prepares for
incremental delegation of runAgent() logic to AgentExecutor.
The AgentExecutor contains the full execution pipeline;
runAgent() delegation will be done incrementally to ensure
stability.
- Test constructor injection with all dependencies
- Test interface exports (AgentExecutionOptions, AgentExecutionResult)
- Test callback type signatures (WaitForApprovalFn, SaveFeatureSummaryFn, etc.)
- Test dependency injection patterns with custom implementations
- Verify execute method signature
Note: Full integration tests for streaming/marker detection require
complex mocking of @automaker/utils module which has hoisting issues.
Integration testing covered in E2E and auto-mode-service tests.
- Extract parseTasksFromSpec for parsing tasks from spec content
- Extract marker detection functions (task start/complete, phase complete)
- Extract detectSpecFallback for non-Claude model support
- Extract extractSummary with multi-format support and last-match behavior
- Add 65 unit tests covering all functions and edge cases
- Extract plan approval workflow from AutoModeService
- Timeout-wrapped Promise creation via waitForApproval()
- Resolution handling (approve/reject) with needsRecovery flag
- Cancellation support for stopped features
- Per-project configurable timeout (default 30 minutes)
- Event emission through TypedEventBus for plan_rejected
- Add WorktreeResolver and FeatureStateManager as constructor parameters
- Remove top-level getCurrentBranch function (now in WorktreeResolver)
- Delegate loadFeature, updateFeatureStatus to FeatureStateManager
- Delegate markFeatureInterrupted, resetStuckFeatures to FeatureStateManager
- Delegate updateFeaturePlanSpec, saveFeatureSummary, updateTaskStatus
- Replace findExistingWorktreeForBranch calls with worktreeResolver
- Update tests to mock featureStateManager instead of internal methods
- All 89 tests passing across 3 service files
- Create FeatureStateManager class for feature status updates
- Extract updateFeatureStatus, markFeatureInterrupted, resetStuckFeatures
- Extract updateFeaturePlanSpec, saveFeatureSummary, updateTaskStatus
- Persist BEFORE emit pattern for data integrity (Pitfall 2)
- Handle corrupted JSON with readJsonWithRecovery backup support
- Preserve pipeline_* statuses in markFeatureInterrupted
- Fix bug: version increment now checks old content before applying updates
- Add 33 unit tests covering all state management operations
- Add TypedEventBus as wrapper around EventEmitter
- Implement emitAutoModeEvent method for auto-mode event format
- Add emit, subscribe, getUnderlyingEmitter methods
- Create comprehensive test suite (20 tests)
- Verify exact event format for frontend compatibility
- AutoModeService now delegates to ConcurrencyManager for all running feature tracking
- Constructor accepts optional ConcurrencyManager for dependency injection
- Remove local RunningFeature interface (imported from ConcurrencyManager)
- Migrate all this.runningFeatures usages to concurrencyManager methods
- Update tests to use concurrencyManager.acquire() instead of direct Map access
- ConcurrencyManager accepts getCurrentBranch function for testability
BREAKING: AutoModeService no longer exposes runningFeatures Map directly.
Tests must use concurrencyManager.acquire() to add running features.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Lease-based reference counting for nested execution support
- acquire() creates entry with leaseCount: 1 or increments existing
- release() decrements leaseCount, deletes at 0 or with force:true
- Project and worktree-level running counts
- RunningFeature interface exported for type sharing
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Test lease counting basics (acquire/release semantics)
- Test running count queries (project and worktree level)
- Test feature state queries (isRunning, getRunningFeature, getAllRunning)
- Test edge cases (multiple features, multiple worktrees)
- 36 test cases documenting expected behavior
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The fetchOpencodeModels function was calling '/api/opencode/models' which
returns 404. Changed to '/api/setup/opencode/models' which correctly
returns the dynamic models.
This fixes an issue where enabled OpenCode dynamic models (e.g., local
Ollama models) were not appearing in the Model Defaults dropdown selectors
despite being visible and enabled in the OpenCode Settings page.
Update the EventHistoryView component to use toast notifications instead of alert dialogs for displaying event replay results, enhancing user experience and providing clearer feedback on success and failure states.
Add project name display at the top of the navigation for the classic
(discord) sidebar style, which previously didn't show the project name
anywhere. Shows the project icon (custom or Lucide) and name with a
separator below.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix setProjectCustomIcon using wrong property name (customIcon -> customIconPath)
- Add currentProject state update to setProjectIcon and setProjectCustomIcon
- Fix data URL regex to handle all formats (e.g., charset=utf-8 in GIFs)
- Increase project icon size limit from 2MB to 5MB for animated GIFs
- Add toast notifications for upload validation errors
- Add image error fallback to folder icon in project switcher
- Make HttpApiClient get/put methods public for store access
- Fix TypeScript errors in app-store.ts (trashedAt type, font properties)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Updated the revision prompt generation to utilize a customizable template, allowing for dynamic insertion of plan version, previous plan content, user feedback, and task format examples.
- Added validation to ensure the presence of a tasks block in the revised specification, with clear instructions on the required format to prevent execution issues.
- Introduced logging for scenarios where no tasks are found in the revised plan, warning about potential fallback to single-agent execution.
Move pure utility functions from app-store.ts and type files into
dedicated utils modules for better separation of concerns:
- theme-utils.ts: Theme and font storage utilities
- shortcut-utils.ts: Keyboard shortcut parsing/formatting
- usage-utils.ts: Usage limit checking
All utilities are re-exported from store/utils/index.ts and
app-store.ts maintains backward compatibility for existing imports.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Address Gemini review feedback - reduce code duplication by having
FeatureImage extend ImageAttachment instead of duplicating properties.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create store/types/ directory with 8 modular type files:
- usage-types.ts: ClaudeUsage, CodexUsage, isClaudeUsageAtLimit
- ui-types.ts: ViewMode, ThemeMode, KeyboardShortcuts, etc.
- settings-types.ts: ApiKeys
- chat-types.ts: ChatMessage, ChatSession, FeatureImage
- terminal-types.ts: TerminalState, TerminalTab, etc.
- project-types.ts: Feature, FileTreeNode, ProjectAnalysis
- state-types.ts: AppState, AppActions interfaces
- index.ts: Re-exports all types
- Update electron.ts to import from store/types/usage-types
(breaks circular dependency between electron.ts and app-store.ts)
- Update app-store.ts to import and re-export types for backward
compatibility - existing imports from @/store/app-store continue
to work
This is PR 1 of the app-store refactoring plan.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
titleBarStyle: 'hiddenInset' is a macOS-only option. Use conditional
spread to only apply it when process.platform === 'darwin', ensuring
Windows and Linux get consistent default styling.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Guard against NaN ports from non-numeric env variables in constants.ts
- Validate IPC sender before returning API key to prevent leaking to
untrusted senders (webviews, additional windows)
- Filter dialog properties to maintain file-only intent and prevent
renderer from requesting directories via OPEN_FILE
- Fix Windows VS Code URL paths by ensuring leading slash after 'file'
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Address review feedback:
- Simplify tsx CLI path lookup by extracting path variables and
reducing nested try-catch blocks
- Remove redundant try-catch around electronAppExists check in
production server path validation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Vite bundles all electron modules into a single main.js file,
so __dirname remains apps/ui/dist-electron regardless of source
file location. Updated path comments to clarify this behavior.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extract the monolithic main.ts (~1000 lines) into focused modules:
- electron/constants.ts - Window sizing, port defaults, filenames
- electron/state.ts - Shared state container
- electron/utils/ - Port availability and icon utilities
- electron/security/ - API key management
- electron/windows/ - Window bounds and main window creation
- electron/server/ - Backend and static server management
- electron/ipc/ - IPC handlers with shared channel constants
Benefits:
- Improved testability with isolated modules
- Better discoverability and maintainability
- Single source of truth for IPC channels (used by both main and preload)
- Clear separation of concerns
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Address CodeRabbit review comment - API keys stored in CLI credentials
file should also be detected as valid authentication.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updated the error handling in the Claude Code CLI authentication check to log the specific error encountered. This enhancement provides better visibility into issues during the authentication process, ensuring users are informed of any problems that arise.
The startup warning "No Claude authentication configured" was shown
even when users have Claude Code CLI installed and authenticated
with a subscription. The Claude Agent SDK can reuse CLI authentication,
so this was a false positive.
Now checks for Claude Code CLI authentication indicators before
showing the warning:
- Recent CLI activity (stats cache)
- CLI setup indicators (settings + project sessions)
- OAuth credentials file
Also updated the warning message to list all authentication options.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix window.Electron to window.isElectron in http-api-client.ts
- Use void operator instead of async/await for onClick handlers in git-diff-panel.tsx
- Fix critical bug: correct parameter order in useStartAutoMode (maxConcurrency was passed as branchName)
- Add error handling for getApiKeys() result in use-cli-status.ts
- Add authClaude guard in claude-cli-status.tsx for consistency with deauthClaude
- Add optional chaining on api object in cursor-cli-status.tsx
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>