refactor: Update model references and improve feature summary handling

- Changed model references from `bareModel` to `effectiveBareModel` in multiple locations to ensure consistency.
- Removed redundant event emission for `auto_mode_summary` after saving feature summaries.
- Added checks to prevent resuming features that are already running, enhancing error handling.
- Introduced a new useEffect in various dialogs to clear `requirePlanApproval` when planning mode is set to 'skip' or 'lite'.
- Updated prompt templates to enforce a structured summary output format, ensuring critical information is captured after task completion.
This commit is contained in:
Shirone
2026-01-24 23:11:37 +01:00
parent 076ab14a5e
commit 4f07948712
5 changed files with 138 additions and 15 deletions

View File

@@ -4126,7 +4126,7 @@ This mock response was generated because AUTOMAKER_MOCK_AGENT=true was set.
// Execute task with dedicated agent
const taskStream = provider.executeQuery({
prompt: taskPrompt,
model: bareModel,
model: effectiveBareModel,
maxTurns: Math.min(maxTurns || 100, 50),
cwd: workDir,
allowedTools: allowedTools,
@@ -4210,14 +4210,10 @@ This mock response was generated because AUTOMAKER_MOCK_AGENT=true was set.
logger.info(`Recovery: All tasks completed for feature ${featureId}`);
// Extract and save final summary
// Note: saveFeatureSummary already emits auto_mode_summary event
const summary = extractSummary(responseText);
if (summary) {
await this.saveFeatureSummary(projectPath, featureId, summary);
this.emitAutoModeEvent('auto_mode_summary', {
featureId,
projectPath,
summary,
});
}
// Final write and cleanup
@@ -4455,7 +4451,7 @@ After generating the revised spec, output:
// Make revision call
const revisionStream = provider.executeQuery({
prompt: revisionPrompt,
model: bareModel,
model: effectiveBareModel,
maxTurns: maxTurns || 100,
cwd: workDir,
allowedTools: allowedTools,
@@ -4613,7 +4609,7 @@ After generating the revised spec, output:
// Execute task with dedicated agent
const taskStream = provider.executeQuery({
prompt: taskPrompt,
model: bareModel,
model: effectiveBareModel,
maxTurns: Math.min(maxTurns || 100, 50), // Limit turns per task
cwd: workDir,
allowedTools: allowedTools,
@@ -4654,11 +4650,12 @@ After generating the revised spec, output:
startTaskId,
'in_progress'
);
this.emitAutoModeEvent('auto_mode_task_start', {
this.emitAutoModeEvent('auto_mode_task_started', {
featureId,
projectPath,
branchName,
taskId: startTaskId,
taskDescription: task.description,
taskIndex,
tasksTotal: parsedTasks.length,
});
@@ -4774,7 +4771,7 @@ After generating the revised spec, output:
const continuationStream = provider.executeQuery({
prompt: continuationPrompt,
model: bareModel,
model: effectiveBareModel,
maxTurns: maxTurns,
cwd: workDir,
allowedTools: allowedTools,
@@ -5245,6 +5242,13 @@ After generating the revised spec, output:
// Resume each interrupted feature
for (const feature of interruptedFeatures) {
try {
// Skip if feature is already running (prevents "already running" error)
if (this.runningFeatures.has(feature.id)) {
logger.info(
`Feature ${feature.id} (${feature.title}) is already running, skipping resume`
);
continue;
}
logger.info(`Resuming feature: ${feature.id} (${feature.title})`);
// Use resumeFeature which will detect the existing context and continue
await this.resumeFeature(projectPath, feature.id, true);

View File

@@ -267,6 +267,13 @@ export function AddFeatureDialog({
allFeatures,
]);
// Clear requirePlanApproval when planning mode is skip or lite
useEffect(() => {
if (planningMode === 'skip' || planningMode === 'lite') {
setRequirePlanApproval(false);
}
}, [planningMode]);
const handleModelChange = (entry: PhaseModelEntry) => {
setModelEntry(entry);
};

View File

@@ -191,6 +191,13 @@ export function EditFeatureDialog({
}
}, [feature, allFeatures]);
// Clear requirePlanApproval when planning mode is skip or lite
useEffect(() => {
if (planningMode === 'skip' || planningMode === 'lite') {
setRequirePlanApproval(false);
}
}, [planningMode]);
const handleModelChange = (entry: PhaseModelEntry) => {
setModelEntry(entry);
};

View File

@@ -198,6 +198,13 @@ export function MassEditDialog({
}
}, [open, selectedFeatures]);
// Clear requirePlanApproval when planning mode is skip or lite
useEffect(() => {
if (planningMode === 'skip' || planningMode === 'lite') {
setRequirePlanApproval(false);
}
}, [planningMode]);
const handleApply = async () => {
const updates: Partial<Feature> = {};

View File

@@ -115,6 +115,23 @@ When approved, execute tasks SEQUENTIALLY in order. For each task:
3. AFTER completing, output: "[TASK_COMPLETE] T###: Brief summary"
This allows real-time progress tracking during implementation.
**CRITICAL: After completing ALL tasks, you MUST output a final summary using this EXACT format:**
<summary>
## Summary: [Feature Title]
### Changes Implemented
- [List all changes made across all tasks]
### Files Modified
- [List all files that were created or modified]
### Notes for Developer
- [Any important notes or considerations]
</summary>
The <summary> and </summary> tags MUST be on their own lines. This summary is REQUIRED for the system to properly track completion.
`;
export const DEFAULT_AUTO_MODE_PLANNING_FULL = `## Full Specification Phase (Full SDD Mode)
@@ -188,6 +205,23 @@ After completing all tasks in a phase, output:
"[PHASE_COMPLETE] Phase N complete"
This allows real-time progress tracking during implementation.
**CRITICAL: After completing ALL phases and ALL tasks, you MUST output a final summary using this EXACT format:**
<summary>
## Summary: [Feature Title]
### Changes Implemented
- [List all changes made across all phases and tasks]
### Files Modified
- [List all files that were created or modified]
### Notes for Developer
- [Any important notes or considerations]
</summary>
The <summary> and </summary> tags MUST be on their own lines. This summary is REQUIRED for the system to properly track completion.
`;
export const DEFAULT_AUTO_MODE_FEATURE_PROMPT_TEMPLATE = `## Feature Implementation Task
@@ -808,7 +842,26 @@ You are executing a specific task as part of a larger feature implementation.
1. Focus ONLY on completing task {{taskId}}: "{{taskDescription}}"
2. Do not work on other tasks
3. Use the existing codebase patterns
4. When done, summarize what you implemented
4. When done, output "[TASK_COMPLETE] {{taskId}}: Brief summary of what you did"
{{#unless remainingTasks}}
**IMPORTANT - THIS IS THE FINAL TASK**: After completing this task, you MUST output a complete feature summary using this EXACT format:
<summary>
## Summary: [Feature Title]
### Changes Implemented
- [List ALL changes made across ALL tasks in this feature]
### Files Modified
- [List ALL files created or modified]
### Notes for Developer
- [Any important notes]
</summary>
The <summary> and </summary> tags MUST be on their own lines. This is REQUIRED.
{{/unless}}
Begin implementing task {{taskId}} now.`;
@@ -820,7 +873,11 @@ Implement this feature by:
3. Write the necessary code changes
4. Ensure the code follows existing patterns and conventions
When done, wrap your final summary in <summary> tags like this:
## CRITICAL: Summary Output Requirement
**IMPORTANT**: After completing ALL implementation work, you MUST output a final summary using the EXACT format below. This is REQUIRED for the system to track your work properly.
**You MUST wrap your summary in <summary> tags like this:**
<summary>
## Summary: [Feature Title]
@@ -835,7 +892,14 @@ When done, wrap your final summary in <summary> tags like this:
- [Any important notes]
</summary>
This helps parse your summary correctly in the output logs.`;
**Rules for summary output:**
- The <summary> opening tag MUST be on its own line
- The </summary> closing tag MUST be on its own line
- Include ALL changes you made during implementation
- Output this summary as the FINAL thing before stopping
- Do NOT skip the summary even if you think the feature is simple
This is not optional - the system parses this to update the feature status.`;
export const DEFAULT_PLAYWRIGHT_VERIFICATION_INSTRUCTIONS = `## Verification with Playwright (REQUIRED)
@@ -918,7 +982,24 @@ export const DEFAULT_CONTINUATION_AFTER_APPROVAL_TEMPLATE = `The plan/specificat
## Instructions
Implement all the changes described in the plan above.`;
Implement all the changes described in the plan above.
**CRITICAL: After completing ALL implementation work, you MUST output a final summary using this EXACT format:**
<summary>
## Summary: [Feature Title]
### Changes Implemented
- [List ALL changes made during implementation]
### Files Modified
- [List ALL files created or modified]
### Notes for Developer
- [Any important notes]
</summary>
The <summary> and </summary> tags MUST be on their own lines. This summary is REQUIRED for the system to track your work.`;
export const DEFAULT_RESUME_FEATURE_TEMPLATE = `## Continuing Feature Implementation
@@ -930,7 +1011,24 @@ The following is the output from a previous implementation attempt. Continue fro
{{previousContext}}
## Instructions
Review the previous work and continue the implementation. If the feature appears complete, verify it works correctly.`;
Review the previous work and continue the implementation. If the feature appears complete, verify it works correctly.
**CRITICAL: When the feature is complete, you MUST output a final summary using this EXACT format:**
<summary>
## Summary: [Feature Title]
### Changes Implemented
- [List ALL changes made, including from previous context]
### Files Modified
- [List ALL files created or modified]
### Notes for Developer
- [Any important notes]
</summary>
The <summary> and </summary> tags MUST be on their own lines. This summary is REQUIRED.`;
export const DEFAULT_PROJECT_ANALYSIS_PROMPT = `Analyze this project and provide a summary of:
1. Project structure and architecture