mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
refactor: update permission handling and optimize performance measurement
- Changed permissionMode settings in enhance and generate title routes to improve edit acceptance and default behavior. - Refactored performance measurement cleanup in the App component to only execute in development mode, preventing unnecessary operations in production. - Simplified the startServerAndWait function signature for better readability.
This commit is contained in:
@@ -164,9 +164,7 @@ export function createEnhanceHandler(
|
||||
systemPrompt,
|
||||
maxTurns: 1,
|
||||
allowedTools: [],
|
||||
// AUTONOMOUS MODE: Always bypass permissions
|
||||
permissionMode: 'bypassPermissions',
|
||||
allowDangerouslySkipPermissions: true,
|
||||
permissionMode: 'acceptEdits',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -96,9 +96,7 @@ export function createGenerateTitleHandler(): (req: Request, res: Response) => P
|
||||
systemPrompt: SYSTEM_PROMPT,
|
||||
maxTurns: 1,
|
||||
allowedTools: [],
|
||||
// AUTONOMOUS MODE: Always bypass permissions
|
||||
permissionMode: 'bypassPermissions',
|
||||
allowDangerouslySkipPermissions: true,
|
||||
permissionMode: 'default',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -18,12 +18,14 @@ export default function App() {
|
||||
// Clear accumulated PerformanceMeasure entries to prevent memory leak in dev mode
|
||||
// React's internal scheduler creates performance marks/measures that accumulate without cleanup
|
||||
useEffect(() => {
|
||||
const clearPerfEntries = () => {
|
||||
performance.clearMarks();
|
||||
performance.clearMeasures();
|
||||
};
|
||||
const interval = setInterval(clearPerfEntries, 5000);
|
||||
return () => clearInterval(interval);
|
||||
if (import.meta.env.DEV) {
|
||||
const clearPerfEntries = () => {
|
||||
performance.clearMarks();
|
||||
performance.clearMeasures();
|
||||
};
|
||||
const interval = setInterval(clearPerfEntries, 5000);
|
||||
return () => clearInterval(interval);
|
||||
}
|
||||
}, []);
|
||||
|
||||
// Run settings migration on startup (localStorage -> file storage)
|
||||
|
||||
@@ -558,14 +558,7 @@ export function setupSignalHandlers(cleanup) {
|
||||
* @param {object} options - Configuration options
|
||||
* @returns {Promise<ChildProcess>} - Server process
|
||||
*/
|
||||
export async function startServerAndWait({
|
||||
serverPort,
|
||||
corsOriginEnv,
|
||||
npmArgs,
|
||||
cwd,
|
||||
fs,
|
||||
baseDir,
|
||||
}) {
|
||||
export async function startServerAndWait({ serverPort, corsOriginEnv, npmArgs, cwd, fs, baseDir }) {
|
||||
log(`Starting backend server on port ${serverPort}...`, 'blue');
|
||||
|
||||
// Create logs directory
|
||||
|
||||
Reference in New Issue
Block a user