mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
Resolves merge conflicts: - apps/server/src/routes/terminal/common.ts: Keep randomBytes import, use @automaker/utils for createLogger - apps/ui/eslint.config.mjs: Use main's explicit globals list with XMLHttpRequest and MediaQueryListEvent additions - apps/ui/src/components/views/terminal-view.tsx: Keep our terminal improvements (killAllSessions, beforeunload, better error handling) - apps/ui/src/config/terminal-themes.ts: Keep our search highlight colors for all themes - apps/ui/src/store/app-store.ts: Keep our terminal settings persistence improvements (merge function) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
50 lines
1.7 KiB
TypeScript
50 lines
1.7 KiB
TypeScript
/**
|
|
* POST /follow-up-feature endpoint - Follow up on a feature
|
|
*/
|
|
|
|
import type { Request, Response } from 'express';
|
|
import type { AutoModeService } from '../../../services/auto-mode-service.js';
|
|
import { createLogger } from '@automaker/utils';
|
|
import { getErrorMessage, logError } from '../common.js';
|
|
|
|
const logger = createLogger('AutoMode');
|
|
|
|
export function createFollowUpFeatureHandler(autoModeService: AutoModeService) {
|
|
return async (req: Request, res: Response): Promise<void> => {
|
|
try {
|
|
const { projectPath, featureId, prompt, imagePaths, useWorktrees } = req.body as {
|
|
projectPath: string;
|
|
featureId: string;
|
|
prompt: string;
|
|
imagePaths?: string[];
|
|
useWorktrees?: boolean;
|
|
};
|
|
|
|
if (!projectPath || !featureId || !prompt) {
|
|
res.status(400).json({
|
|
success: false,
|
|
error: 'projectPath, featureId, and prompt are required',
|
|
});
|
|
return;
|
|
}
|
|
|
|
// Start follow-up in background
|
|
// followUpFeature derives workDir from feature.branchName
|
|
autoModeService
|
|
.followUpFeature(projectPath, featureId, prompt, imagePaths, useWorktrees ?? true)
|
|
.catch((error) => {
|
|
logger.error(`[AutoMode] Follow up feature ${featureId} error:`, error);
|
|
})
|
|
.finally(() => {
|
|
// Release the starting slot when follow-up completes (success or error)
|
|
// Note: The feature should be in runningFeatures by this point
|
|
});
|
|
|
|
res.json({ success: true });
|
|
} catch (error) {
|
|
logError(error, 'Follow up feature failed');
|
|
res.status(500).json({ success: false, error: getErrorMessage(error) });
|
|
}
|
|
};
|
|
}
|