mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 20:43:36 +00:00
feat(auto-mode): enhance error handling and feature status updates
- Improved error handling in AutoModeService to log errors and update feature status to "waiting_approval" when an error occurs during feature execution. - Added error message writing to the context file for better debugging. - Updated FeatureLoader to include an optional error message parameter when updating feature status. - Enhanced prompt generation to include detailed context about attached images for better user guidance during feature implementation. - Modified KanbanCard component to visually indicate features with errors, improving user awareness of issues. These changes significantly enhance the robustness of the auto mode feature and improve the user experience by providing clearer feedback on feature execution status.
This commit is contained in:
@@ -342,7 +342,8 @@ class FeatureExecutor {
|
||||
const path = require("path");
|
||||
for (const imagePathObj of imagePaths) {
|
||||
try {
|
||||
const imagePath = imagePathObj.path;
|
||||
// Handle both string paths and FeatureImagePath objects
|
||||
const imagePath = typeof imagePathObj === 'string' ? imagePathObj : imagePathObj.path;
|
||||
const imageBuffer = fs.readFileSync(imagePath);
|
||||
const base64Data = imageBuffer.toString("base64");
|
||||
const ext = path.extname(imagePath).toLowerCase();
|
||||
@@ -353,7 +354,9 @@ class FeatureExecutor {
|
||||
".gif": "image/gif",
|
||||
".webp": "image/webp",
|
||||
};
|
||||
const mediaType = mimeTypeMap[ext] || imagePathObj.mimeType || "image/png";
|
||||
const mediaType = typeof imagePathObj === 'string'
|
||||
? (mimeTypeMap[ext] || "image/png")
|
||||
: (mimeTypeMap[ext] || imagePathObj.mimeType || "image/png");
|
||||
|
||||
contentBlocks.push({
|
||||
type: "image",
|
||||
@@ -366,8 +369,9 @@ class FeatureExecutor {
|
||||
|
||||
console.log(`[FeatureExecutor] Added image to resume prompt: ${imagePath}`);
|
||||
} catch (error) {
|
||||
const errorPath = typeof imagePathObj === 'string' ? imagePathObj : imagePathObj.path;
|
||||
console.error(
|
||||
`[FeatureExecutor] Failed to load image ${imagePathObj.path}:`,
|
||||
`[FeatureExecutor] Failed to load image ${errorPath}:`,
|
||||
error
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user