-
Notifications
You must be signed in to change notification settings - Fork 490
fix: handle pipeline resume edge cases and improve robustness #344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle pipeline resume edge cases and improve robustness #344
Conversation
This commit fixes several edge cases when resuming features stuck in pipeline steps: - Detect if feature is stuck in a pipeline step during resume - Handle case where context file is missing (restart from beginning) - Handle case where pipeline step no longer exists in config - Add dedicated resumePipelineFeature() method for pipeline-specific resume logic - Add detectPipelineStatus() to extract and validate pipeline step information - Add resumeFromPipelineStep() to resume from a specific pipeline step index - Update board view to check context availability for features with pipeline status Edge cases handled: 1. No context file → restart entire pipeline from beginning 2. Step no longer exists in config → complete feature without pipeline 3. Valid step exists → resume from the crashed step 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR introduces pipeline-awareness to auto-mode feature resumption. The server detects when features are part of pipelines, determines the current step, and handles resuming from specific pipeline steps with edge-case handling. The UI expands status checks to include pipeline_* statuses and adds a new Verify button pathway. Changes
Sequence DiagramsequenceDiagram
participant AutoModeService
participant ProjectContext
participant Pipeline
participant StepExecutor
AutoModeService->>AutoModeService: resumeFeature(projectPath, feature)
AutoModeService->>AutoModeService: detectPipelineStatus(projectPath, featureId, currentStatus)
AutoModeService->>ProjectContext: Load feature pipeline status
ProjectContext-->>AutoModeService: PipelineStatusInfo {stepId, stepIndex, config}
alt Feature in Pipeline
AutoModeService->>AutoModeService: resumePipelineFeature(projectPath, feature)
AutoModeService->>AutoModeService: resumeFromPipelineStep(projectPath, feature, startFromStepIndex, pipelineConfig)
AutoModeService->>StepExecutor: Execute pending steps from current step
StepExecutor-->>AutoModeService: Step completion/progress events
AutoModeService->>ProjectContext: Update feature status
else Feature Not in Pipeline
AutoModeService->>AutoModeService: resumeFeature(original path)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
Summary of ChangesHello @casiusss, 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 the robustness and reliability of the pipeline resume functionality by addressing several critical edge cases. It introduces new methods to intelligently detect and handle features that get stuck during pipeline execution, ensuring that the system can recover gracefully from various failure scenarios, such as missing context files or deleted pipeline steps. The changes also extend to the UI, allowing the board view to correctly reflect the status of pipeline features. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request significantly improves the robustness of resuming features that are stuck in pipeline steps by handling several important edge cases. The introduction of dedicated methods like resumePipelineFeature, detectPipelineStatus, and resumeFromPipelineStep makes the logic clearer and more maintainable. The changes are well-structured and address a critical part of the workflow. My review includes a few suggestions to further enhance efficiency and maintainability by reducing redundant operations and clarifying some of the new logic.
Reduce redundant file reads by loading the feature object once and passing it down the call chain instead of reloading it multiple times. Changes: - Pass feature object to resumePipelineFeature() instead of featureId - Pass feature object to resumeFromPipelineStep() instead of featureId - Remove redundant loadFeature() calls from these methods - Add FeatureStatusWithPipeline import for type safety This improves performance by eliminating unnecessary file I/O operations and makes the data flow clearer. Co-authored-by: gemini-code-assist bot 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove confusing and unnecessary delete calls from resumeFeature() and resumePipelineFeature() methods. These were leftovers from a previous implementation where temporary entries were added to runningFeatures. The resumeFeature() method already ensures the feature is not running at the start (via has() check that throws if already running), so these delete calls serve no purpose and only add confusion about state management. Removed delete calls from: - resumeFeature() non-pipeline flow (line 748) - resumePipelineFeature() no-context case (line 798) - resumePipelineFeature() step-not-found case (line 822) Co-authored-by: gemini-code-assist bot 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…cation Define a dedicated PipelineStatusInfo interface and use it consistently in both resumePipelineFeature() parameter and detectPipelineStatus() return type. This eliminates duplicate inline type definitions and improves maintainability by ensuring both locations always stay in sync. Any future changes to the pipeline status structure only need to be made in one place. Changes: - Add PipelineStatusInfo interface definition - Replace inline type in resumePipelineFeature() with PipelineStatusInfo - Replace inline return type in detectPipelineStatus() with PipelineStatusInfo Co-authored-by: gemini-code-assist bot 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove unnecessary call to pipelineService.getStep() which was causing a redundant file read of pipeline.json. The config is already loaded at line 2807, so we can find the step directly from the in-memory config. Changes: - Sort config.steps first - Find stepIndex using findIndex() - Get step directly from sortedSteps[stepIndex] instead of calling getStep() - Simplify null check to only check !step instead of stepIndex === -1 || !step This optimization reduces file I/O operations and improves performance when resuming pipeline features. Co-authored-by: gemini-code-assist bot 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Enable the Resume button to appear for features with pipeline status (e.g., 'pipeline_step_xyz') in addition to 'in_progress' status. Previously, features that crashed during pipeline execution would show a 'testing' status badge but no Resume button, making it impossible to resume them from the UI. Changes: - Update card-actions.tsx condition to include pipeline_ status check - Resume button now shows for both in_progress and pipeline_step_* statuses - Maintains all existing behavior for other feature states This fixes the UX issue where users could see a feature was stuck in a pipeline step but had no way to resume it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Resolved conflict in card-actions.tsx by:
- Keeping pipeline_status check from our branch (supports pipeline_step_* statuses)
- Adopting simplified Resume button logic from main (removed hasContext check and onVerify fallback)
The Resume button now appears for features with:
- status === 'in_progress'
- status.startsWith('pipeline_')
This combines our pipeline support fix with main's simplified button rendering logic.
Re-add the onVerify fallback for in_progress/pipeline features without context, but fix the misleading UX issue where the button said 'Resume' but executed verification (tests/build). Changes: - Restore onVerify fallback as 3rd option after skipTests Verify and Resume - Change button label from 'Resume' to 'Verify' (honest!) - Change icon from PlayCircle to CheckCircle2 (matches action) - Keep same green styling for consistency This makes sense because if a feature is in_progress but has no context, it likely completed execution but the context was deleted. User should be able to verify it (run tests/build) rather than having no action available. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Auto-format all files to fix format-check CI failure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx (1)
112-114: LGTM with minor note.The expanded status check correctly enables action buttons for both
in_progressandpipeline_*statuses. Thetypeof feature.status === 'string'guard is defensive but likely redundant if theFeaturetype guaranteesstatusis always a string.🔎 Optional: Simplify the condition if status is guaranteed to be a string
{!isCurrentAutoTask && - (feature.status === 'in_progress' || - (typeof feature.status === 'string' && feature.status.startsWith('pipeline_'))) && ( + (feature.status === 'in_progress' || feature.status.startsWith('pipeline_')) && (apps/server/src/services/auto-mode-service.ts (1)
1051-1062: Consider callingrecordSuccess()on successful pipeline resume.The
executeFeaturemethod callsrecordSuccess()at line 608 to reset consecutive failure tracking after successful completion. This method doesn't call it, which means successful pipeline resumes won't reset the failure counter.🔎 Add recordSuccess() call for consistency
// Determine final status const finalStatus = feature.skipTests ? 'waiting_approval' : 'verified'; await this.updateFeatureStatus(projectPath, featureId, finalStatus); + // Record success to reset consecutive failure tracking + this.recordSuccess(); + console.log('[AutoMode] Pipeline resume completed successfully');
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
apps/server/src/services/auto-mode-service.tsapps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsxapps/ui/src/components/views/board-view/hooks/use-board-effects.tsscripts/lint-lockfile.mjs
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Always import from shared packages (@automaker/*), never from old relative paths
Files:
apps/ui/src/components/views/board-view/hooks/use-board-effects.tsapps/server/src/services/auto-mode-service.tsapps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
resolveModelString()from @automaker/model-resolver to convert model aliases (haiku, sonnet, opus) to full model names
Files:
apps/ui/src/components/views/board-view/hooks/use-board-effects.tsapps/server/src/services/auto-mode-service.tsapps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx
apps/server/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
createEventEmitter()fromlib/events.tsfor all server operations to emit events that stream to frontend via WebSocket
Files:
apps/server/src/services/auto-mode-service.ts
🧠 Learnings (2)
📚 Learning: 2025-12-28T05:07:48.147Z
Learnt from: CR
Repo: AutoMaker-Org/automaker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-28T05:07:48.147Z
Learning: Each feature executes in an isolated git worktree created via automaker/git-utils to protect the main branch during AI agent execution
Applied to files:
apps/server/src/services/auto-mode-service.ts
📚 Learning: 2025-12-30T01:02:07.114Z
Learnt from: illia1f
Repo: AutoMaker-Org/automaker PR: 324
File: apps/ui/src/components/views/board-view/components/kanban-card/kanban-card.tsx:122-131
Timestamp: 2025-12-30T01:02:07.114Z
Learning: Tailwind CSS v4 uses postfix syntax for the important modifier: append ! at the end of the utility class (e.g., backdrop-blur-[0px]! or hover:bg-red-500!). The older v3 style used a prefix (!) at the start (e.g., !backdrop-blur-[0px]); prefer the postfix form for consistency across TSX files.
Applied to files:
apps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx
🧬 Code graph analysis (1)
apps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx (1)
apps/ui/src/components/ui/button.tsx (1)
Button(108-108)
🔇 Additional comments (8)
scripts/lint-lockfile.mjs (1)
15-23: LGTM!Formatting-only changes (blank line additions) with no functional impact.
apps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx (1)
133-193: Button priority chain looks correct.The ternary chain properly prioritizes:
- Manual Verify (when
skipTests+onManualVerify)- Resume (when context exists via
onResume)- Verify fallback (when no context, via
onVerify)This aligns with the PR objective of handling missing context files gracefully.
apps/server/src/services/auto-mode-service.ts (5)
77-87: Well-structured interface.The
PipelineStatusInfointerface properly centralizes the pipeline status type, addressing the previous review feedback about inline type duplication.
828-844: Good refactor - single feature load.The feature is loaded once at line 829 and passed to
resumePipelineFeature, addressing the previous review feedback about redundant file reads.
875-944: Edge cases handled well.The three scenarios are correctly addressed:
- No context (lines 898-908): Restarts pipeline from beginning via
executeFeature- Missing step (lines 910-929): Completes feature gracefully when pipeline config changed
- Valid step (lines 931-943): Resumes from crashed step
The defensive check at lines 933-935 correctly guards against an impossible state.
2890-2980: Clean implementation addressing past feedback.The method efficiently:
- Delegates status parsing to
pipelineService(lines 2900, 2914)- Loads
pipeline.jsononce and reuses for step lookup (lines 2931, 2949-2951)- Handles all edge cases with appropriate warnings
This addresses the previous review comment about redundant
pipeline.jsonreads.
13-19: LGTM!Imports correctly use the shared
@automaker/typespackage as per coding guidelines.apps/ui/src/components/views/board-view/hooks/use-board-effects.ts (1)
131-137: Consistent with pipeline status handling.The expanded filter correctly includes
pipeline_*statuses for context checking, ensuring the board view can determine whether to show Resume or Verify buttons for features stuck in pipeline steps.This aligns with the changes in
card-actions.tsxand the server-side pipeline detection logic.
|
@coderabbitai generate docstrings |
✅ Actions performedInitiated docstring generation; will generate only if new commits exist. |
|
Note Docstrings generation - SUCCESS |
Docstrings generation was requested by @casiusss. * #344 (comment) The following files were modified: * `apps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx` * `apps/ui/src/components/views/board-view/hooks/use-board-effects.ts`
Add detailed JSDoc documentation to meet 80% docstring coverage requirement: - PipelineStatusInfo interface: Document all properties with types and descriptions - resumePipelineFeature(): Document edge case handling and parameters - resumeFromPipelineStep(): Document complete pipeline resume workflow - detectPipelineStatus(): Document pipeline status detection scenarios Each docstring includes: - Clear method purpose and behavior - All parameters with types and descriptions - Return value documentation - Error conditions and exceptions - @Private tags for internal methods This improves code maintainability and helps developers understand the complex pipeline resume logic. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @apps/server/src/services/auto-mode-service.ts:
- Around line 1202-1221: The catch block for non-abort errors should invoke the
same auto-loop failure tracking used in executeFeature: add an awaited call to
this.trackFailureAndCheckPause with the same arguments executeFeature uses
(include projectPath and featureId and the error/errorInfo as used there), so
repeated pipeline resume failures can trigger the auto-loop pause mechanism;
place the await this.trackFailureAndCheckPause(...) call in the non-abort branch
(before or after updateFeatureStatus) and preserve the existing
updateFeatureStatus and emitAutoModeEvent behavior.
🧹 Nitpick comments (2)
apps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx (1)
1-1: Consider removing@ts-nocheckdirective.The
@ts-nocheckdirective disables TypeScript checking for this entire file, which can mask potential type errors. Consider addressing the underlying type issues and removing this directive to benefit from TypeScript's type safety.apps/server/src/services/auto-mode-service.ts (1)
1006-1008: Useloggerinstead ofconsole.logfor consistent logging.This file uses
logger(created viacreateLogger) throughout, but these new methods useconsole.logandconsole.warn. This creates inconsistent log output formatting and may miss log filtering/routing configured for the logger.♻️ Suggested fix
- console.log( + logger.info( `[AutoMode] Resuming feature ${featureId} from pipeline step ${pipelineInfo.stepId}` );Apply similar changes at lines 1024-1026, 1036-1038, 1110-1112, 1137-1141, 1194, 1213, 3211-3214, 3229-3231, 3249-3251, 3262-3264.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/server/src/services/auto-mode-service.tsapps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsxapps/ui/src/components/views/board-view/hooks/use-board-effects.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Always import from shared packages (@automaker/*), never from old relative paths
Files:
apps/server/src/services/auto-mode-service.tsapps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsxapps/ui/src/components/views/board-view/hooks/use-board-effects.ts
apps/server/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
createEventEmitter()fromlib/events.tsfor all server operations to emit events that stream to frontend via WebSocket
Files:
apps/server/src/services/auto-mode-service.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
resolveModelString()from @automaker/model-resolver to convert model aliases (haiku, sonnet, opus) to full model names
Files:
apps/server/src/services/auto-mode-service.tsapps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsxapps/ui/src/components/views/board-view/hooks/use-board-effects.ts
🧠 Learnings (2)
📚 Learning: 2025-12-28T05:07:48.147Z
Learnt from: CR
Repo: AutoMaker-Org/automaker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-28T05:07:48.147Z
Learning: Each feature executes in an isolated git worktree created via automaker/git-utils to protect the main branch during AI agent execution
Applied to files:
apps/server/src/services/auto-mode-service.ts
📚 Learning: 2025-12-30T01:02:07.114Z
Learnt from: illia1f
Repo: AutoMaker-Org/automaker PR: 324
File: apps/ui/src/components/views/board-view/components/kanban-card/kanban-card.tsx:122-131
Timestamp: 2025-12-30T01:02:07.114Z
Learning: Tailwind CSS v4 uses postfix syntax for the important modifier: append ! at the end of the utility class (e.g., backdrop-blur-[0px]! or hover:bg-red-500!). The older v3 style used a prefix (!) at the start (e.g., !backdrop-blur-[0px]); prefer the postfix form for consistency across TSX files.
Applied to files:
apps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx
🧬 Code graph analysis (2)
apps/server/src/services/auto-mode-service.ts (8)
libs/types/src/index.ts (4)
PipelineStep(208-208)PipelineConfig(209-209)FeatureStatusWithPipeline(211-211)Feature(49-49)libs/types/src/pipeline.ts (3)
PipelineStep(5-13)PipelineConfig(15-18)FeatureStatusWithPipeline(22-28)apps/server/src/services/feature-loader.ts (2)
Feature(20-20)getFeatureDir(143-145)libs/platform/src/paths.ts (1)
getFeatureDir(49-51)apps/server/src/lib/sdk-options.ts (1)
validateWorkingDirectory(107-119)libs/utils/src/index.ts (1)
classifyError(14-14)apps/server/src/lib/error-handler.ts (1)
classifyError(180-216)apps/server/src/services/pipeline-service.ts (1)
pipelineService(320-320)
apps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx (1)
apps/ui/src/components/ui/button.tsx (1)
Button(108-108)
🔇 Additional comments (6)
apps/ui/src/components/views/board-view/hooks/use-board-effects.ts (1)
103-109: LGTM! Context check correctly extended to pipeline statuses.The defensive
typeof f.status === 'string'check beforestartsWith('pipeline_')is appropriate for runtime safety since thefeaturesarray is typed asany[]. This aligns well with the server-side pipeline status handling introduced in this PR.apps/ui/src/components/views/board-view/components/kanban-card/card-actions.tsx (1)
120-203: LGTM! Pipeline status handling and action button logic are correct.The expanded status gating to include
pipeline_*statuses is consistent with the server-side changes. The conditional rendering chain (Manual Verify → Resume → Verify) correctly prioritizes the actions based on feature state and available handlers.apps/server/src/services/auto-mode-service.ts (4)
89-108: LGTM! Well-documented interface for pipeline status information.The
PipelineStatusInfointerface is well-designed with clear JSDoc documentation explaining each property's purpose and edge case values (e.g.,stepIndex = -1when step not found).
943-960: LGTM! Clean pipeline detection integration into resume flow.The pipeline status detection is correctly integrated. The defensive
|| ''fallback handles potential undefined status, and thedetectPipelineStatusmethod handles non-pipeline statuses gracefully by returningisPipeline: false.
3171-3274: LGTM! Comprehensive pipeline status detection with proper edge case handling.The method correctly handles multiple scenarios:
- Non-pipeline statuses return early with
isPipeline: false- Invalid pipeline status format is logged and handled
- Missing/empty pipeline config is detected
- Deleted steps return
stepIndex: -1for caller to handle- Valid steps return complete information
The delegation to
pipelineService.isPipelineStatus()andpipelineService.getStepIdFromStatus()promotes code reuse.
19-21: LGTM! Imports correctly added for new types.The new imports for
FeatureStatusWithPipelineandPipelineConfigfrom@automaker/typesare correctly added to support the pipeline status detection logic.
| } catch (error) { | ||
| const errorInfo = classifyError(error); | ||
|
|
||
| if (errorInfo.isAbort) { | ||
| this.emitAutoModeEvent('auto_mode_feature_complete', { | ||
| featureId, | ||
| passes: false, | ||
| message: 'Pipeline resume stopped by user', | ||
| projectPath, | ||
| }); | ||
| } else { | ||
| console.error(`[AutoMode] Pipeline resume failed for feature ${featureId}:`, error); | ||
| await this.updateFeatureStatus(projectPath, featureId, 'backlog'); | ||
| this.emitAutoModeEvent('auto_mode_error', { | ||
| featureId, | ||
| error: errorInfo.message, | ||
| errorType: errorInfo.type, | ||
| projectPath, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider tracking failures for auto-loop pause behavior.
The error handling doesn't call trackFailureAndCheckPause() like executeFeature() does (see lines 746-756). This means repeated pipeline resume failures won't trigger the auto-loop pause mechanism that protects against quota exhaustion or API issues.
🐛 Suggested fix
} else {
console.error(`[AutoMode] Pipeline resume failed for feature ${featureId}:`, error);
await this.updateFeatureStatus(projectPath, featureId, 'backlog');
this.emitAutoModeEvent('auto_mode_error', {
featureId,
error: errorInfo.message,
errorType: errorInfo.type,
projectPath,
});
+
+ // Track this failure for auto-loop pause mechanism
+ const shouldPause = this.trackFailureAndCheckPause({
+ type: errorInfo.type,
+ message: errorInfo.message,
+ });
+
+ if (shouldPause) {
+ this.signalShouldPause({
+ type: errorInfo.type,
+ message: errorInfo.message,
+ });
+ }
}📝 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.
| } catch (error) { | |
| const errorInfo = classifyError(error); | |
| if (errorInfo.isAbort) { | |
| this.emitAutoModeEvent('auto_mode_feature_complete', { | |
| featureId, | |
| passes: false, | |
| message: 'Pipeline resume stopped by user', | |
| projectPath, | |
| }); | |
| } else { | |
| console.error(`[AutoMode] Pipeline resume failed for feature ${featureId}:`, error); | |
| await this.updateFeatureStatus(projectPath, featureId, 'backlog'); | |
| this.emitAutoModeEvent('auto_mode_error', { | |
| featureId, | |
| error: errorInfo.message, | |
| errorType: errorInfo.type, | |
| projectPath, | |
| }); | |
| } | |
| } catch (error) { | |
| const errorInfo = classifyError(error); | |
| if (errorInfo.isAbort) { | |
| this.emitAutoModeEvent('auto_mode_feature_complete', { | |
| featureId, | |
| passes: false, | |
| message: 'Pipeline resume stopped by user', | |
| projectPath, | |
| }); | |
| } else { | |
| console.error(`[AutoMode] Pipeline resume failed for feature ${featureId}:`, error); | |
| await this.updateFeatureStatus(projectPath, featureId, 'backlog'); | |
| this.emitAutoModeEvent('auto_mode_error', { | |
| featureId, | |
| error: errorInfo.message, | |
| errorType: errorInfo.type, | |
| projectPath, | |
| }); | |
| // Track this failure for auto-loop pause mechanism | |
| const shouldPause = this.trackFailureAndCheckPause({ | |
| type: errorInfo.type, | |
| message: errorInfo.message, | |
| }); | |
| if (shouldPause) { | |
| this.signalShouldPause({ | |
| type: errorInfo.type, | |
| message: errorInfo.message, | |
| }); | |
| } | |
| } |
🤖 Prompt for AI Agents
In @apps/server/src/services/auto-mode-service.ts around lines 1202 - 1221, The
catch block for non-abort errors should invoke the same auto-loop failure
tracking used in executeFeature: add an awaited call to
this.trackFailureAndCheckPause with the same arguments executeFeature uses
(include projectPath and featureId and the error/errorInfo as used there), so
repeated pipeline resume failures can trigger the auto-loop pause mechanism;
place the await this.trackFailureAndCheckPause(...) call in the non-abort branch
(before or after updateFeatureStatus) and preserve the existing
updateFeatureStatus and emitAutoModeEvent behavior.
Summary
This PR fixes several edge cases when resuming features that are stuck in pipeline steps, improving the robustness of the pipeline resume functionality.
Changes
resumePipelineFeature()method for pipeline-specific resume logicdetectPipelineStatus()to extract and validate pipeline step informationresumeFromPipelineStep()to resume from a specific pipeline step indexEdge Cases Handled
Test Plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.