mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 08:53:36 +00:00
Merge main into feat/codex-new-model - resolved conflict in auto-mode-service.ts
This commit is contained in:
3
apps/server/.gitignore
vendored
3
apps/server/.gitignore
vendored
@@ -1 +1,2 @@
|
||||
.env
|
||||
.env
|
||||
data
|
||||
@@ -1,38 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": "msg_1765523527444_d8xyk8rh9",
|
||||
"role": "user",
|
||||
"content": "this is a test",
|
||||
"timestamp": "2025-12-12T07:12:07.444Z"
|
||||
},
|
||||
{
|
||||
"id": "msg_1765523534075_351i0rcft",
|
||||
"role": "assistant",
|
||||
"content": "Hello! This is a test response. I'm working correctly and ready to help you with your software development projects.\n\nIs there something specific you'd like to work on today? I can help you with:\n\n- **Planning a new project** - Define requirements, architecture, and technical approach\n- **Writing code** - Create new files, implement features, or build components\n- **Editing existing code** - Modify, refactor, or fix bugs in your codebase\n- **Running commands** - Execute tests, builds, or other terminal commands\n- **Exploring your codebase** - Search for patterns, understand existing code structure\n\nJust let me know what you need!",
|
||||
"timestamp": "2025-12-12T07:12:14.075Z"
|
||||
},
|
||||
{
|
||||
"id": "msg_1765524006202_3d2cuya6b",
|
||||
"role": "user",
|
||||
"content": "test",
|
||||
"timestamp": "2025-12-12T07:20:06.202Z"
|
||||
},
|
||||
{
|
||||
"id": "msg_1765524011389_sdfbuai3k",
|
||||
"role": "assistant",
|
||||
"content": "Hello! I'm here to help you build software. How can I assist you today?\n\nI can help you with:\n\n- **Planning** - Define requirements, discuss architecture, and design your project\n- **Coding** - Write, edit, and modify code files\n- **Debugging** - Analyze issues and fix bugs\n- **Testing** - Run tests and verify functionality\n- **Exploring** - Search and understand existing codebases\n\nWhat would you like to work on?",
|
||||
"timestamp": "2025-12-12T07:20:11.389Z"
|
||||
},
|
||||
{
|
||||
"id": "msg_1765524491273_7ocghnbb5",
|
||||
"role": "user",
|
||||
"content": "test",
|
||||
"timestamp": "2025-12-12T07:28:11.273Z"
|
||||
},
|
||||
{
|
||||
"id": "msg_1765524498237_x8b4148gc",
|
||||
"role": "assistant",
|
||||
"content": "Hello! I'm here to help you build software. How can I assist you today?\n\nI can help you with:\n- **Planning** - Define requirements, architecture, and technical approaches\n- **Coding** - Write, edit, and modify code files\n- **Debugging** - Find and fix issues in your codebase\n- **Testing** - Run tests and help improve test coverage\n- **Exploring** - Search and analyze your existing codebase\n\nWhat would you like to work on?",
|
||||
"timestamp": "2025-12-12T07:28:18.237Z"
|
||||
}
|
||||
]
|
||||
File diff suppressed because one or more lines are too long
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"msg_1765523524581_xhk6u45v2": {
|
||||
"id": "msg_1765523524581_xhk6u45v2",
|
||||
"name": "Bright Agent 2",
|
||||
"projectPath": "/Users/webdevcody/Workspace/automaker",
|
||||
"workingDirectory": "/Users/webdevcody/Workspace/automaker",
|
||||
"createdAt": "2025-12-12T07:12:04.582Z",
|
||||
"updatedAt": "2025-12-12T07:28:18.571Z"
|
||||
},
|
||||
"msg_1765525491205_xeuqv7i9v": {
|
||||
"id": "msg_1765525491205_xeuqv7i9v",
|
||||
"name": "Optimal Helper 52",
|
||||
"projectPath": "/Users/webdevcody/Workspace/automaker",
|
||||
"workingDirectory": "/Users/webdevcody/Workspace/automaker",
|
||||
"createdAt": "2025-12-12T07:44:51.205Z",
|
||||
"updatedAt": "2025-12-12T07:46:03.339Z"
|
||||
}
|
||||
}
|
||||
@@ -326,6 +326,46 @@ export class AutoModeService {
|
||||
// No worktree, use project path
|
||||
}
|
||||
|
||||
// Load feature info for context
|
||||
const feature = await this.loadFeature(projectPath, featureId);
|
||||
|
||||
// Load previous agent output if it exists
|
||||
const contextPath = path.join(
|
||||
projectPath,
|
||||
".automaker",
|
||||
"features",
|
||||
featureId,
|
||||
"agent-output.md"
|
||||
);
|
||||
let previousContext = "";
|
||||
try {
|
||||
previousContext = await fs.readFile(contextPath, "utf-8");
|
||||
} catch {
|
||||
// No previous context
|
||||
}
|
||||
|
||||
// Build complete prompt with feature info, previous context, and follow-up instructions
|
||||
let fullPrompt = `## Follow-up on Feature Implementation
|
||||
|
||||
${feature ? this.buildFeaturePrompt(feature) : `**Feature ID:** ${featureId}`}
|
||||
`;
|
||||
|
||||
if (previousContext) {
|
||||
fullPrompt += `
|
||||
## Previous Agent Work
|
||||
The following is the output from the previous implementation attempt:
|
||||
|
||||
${previousContext}
|
||||
`;
|
||||
}
|
||||
|
||||
fullPrompt += `
|
||||
## Follow-up Instructions
|
||||
${prompt}
|
||||
|
||||
## Task
|
||||
Address the follow-up instructions above. Review the previous work and make the requested changes or fixes.`;
|
||||
|
||||
this.runningFeatures.set(featureId, {
|
||||
featureId,
|
||||
projectPath,
|
||||
@@ -339,12 +379,11 @@ export class AutoModeService {
|
||||
this.emitAutoModeEvent("auto_mode_feature_start", {
|
||||
featureId,
|
||||
projectPath,
|
||||
feature: { id: featureId, title: "Follow-up", description: prompt.substring(0, 100) },
|
||||
feature: feature || { id: featureId, title: "Follow-up", description: prompt.substring(0, 100) },
|
||||
});
|
||||
|
||||
try {
|
||||
// Load feature to get its model
|
||||
const feature = await this.loadFeature(projectPath, featureId);
|
||||
// Get model from feature (already loaded above)
|
||||
const model = resolveModelString(feature?.model, DEFAULT_MODELS.claude);
|
||||
console.log(`[AutoMode] Follow-up for feature ${featureId} using model: ${model}`);
|
||||
|
||||
@@ -401,41 +440,6 @@ export class AutoModeService {
|
||||
feature.imagePaths = [...currentImagePaths, ...newImagePaths];
|
||||
}
|
||||
|
||||
// Load previous agent output for context
|
||||
const outputPath = path.join(
|
||||
workDir,
|
||||
".automaker",
|
||||
"features",
|
||||
featureId,
|
||||
"agent-output.md"
|
||||
);
|
||||
let previousContext = "";
|
||||
try {
|
||||
previousContext = await fs.readFile(outputPath, "utf-8");
|
||||
} catch {
|
||||
// No previous context
|
||||
}
|
||||
|
||||
// Build follow-up prompt with context (feature now includes new images)
|
||||
let followUpPrompt = prompt;
|
||||
if (previousContext) {
|
||||
followUpPrompt = `## Follow-up Request
|
||||
|
||||
${this.buildFeaturePrompt(feature!)}
|
||||
|
||||
## Previous Work
|
||||
The following is the output from the previous implementation:
|
||||
|
||||
${previousContext}
|
||||
|
||||
---
|
||||
|
||||
## New Instructions
|
||||
${prompt}
|
||||
|
||||
Please continue from where you left off and address the new instructions above.`;
|
||||
}
|
||||
|
||||
// Combine original feature images with new follow-up images
|
||||
const allImagePaths: string[] = [];
|
||||
|
||||
@@ -464,7 +468,8 @@ Please continue from where you left off and address the new instructions above.`
|
||||
}
|
||||
}
|
||||
|
||||
await this.runAgent(workDir, featureId, followUpPrompt, abortController, allImagePaths.length > 0 ? allImagePaths : undefined, model);
|
||||
// Use fullPrompt (already built above) with model and all images
|
||||
await this.runAgent(workDir, featureId, fullPrompt, abortController, allImagePaths.length > 0 ? allImagePaths : imagePaths, model);
|
||||
|
||||
// Mark as waiting_approval for user review
|
||||
await this.updateFeatureStatus(projectPath, featureId, "waiting_approval");
|
||||
|
||||
Reference in New Issue
Block a user