mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-05 15:09:42 +02:00
fix(ui): fix case creation not updating dropdown immediately
- Add cache-busting to /api/cases fetch to prevent stale data - Use created case path from API response (was using old empty caseData) - Add selectCaseName parameter to loadQuickStartCases for post-create selection - Add toast() alias for showToast() to fix "toast is not a function" error - Prevent duplicate event listeners on case dropdown - Show "(will be created)" hint when no cases exist - Add Ralph Wiggum config tab to session options modal - Add inner-config API endpoint for Ralph loop settings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -242,6 +242,50 @@ export class WebServer extends EventEmitter {
|
||||
};
|
||||
});
|
||||
|
||||
// Configure inner loop (Ralph Wiggum) settings
|
||||
this.app.post('/api/sessions/:id/inner-config', async (req) => {
|
||||
const { id } = req.params as { id: string };
|
||||
const { completionPhrase, maxIterations, maxTodos, todoExpirationMinutes } = req.body as {
|
||||
completionPhrase?: string;
|
||||
maxIterations?: number;
|
||||
maxTodos?: number;
|
||||
todoExpirationMinutes?: number;
|
||||
};
|
||||
const session = this.sessions.get(id);
|
||||
|
||||
if (!session) {
|
||||
return { success: false, error: 'Session not found' };
|
||||
}
|
||||
|
||||
// Configure the inner loop tracker
|
||||
if (completionPhrase !== undefined) {
|
||||
// Start loop with completion phrase to set it up for watching
|
||||
if (completionPhrase) {
|
||||
session.innerLoopTracker.startLoop(completionPhrase, maxIterations || undefined);
|
||||
}
|
||||
}
|
||||
|
||||
if (maxIterations !== undefined) {
|
||||
session.innerLoopTracker.setMaxIterations(maxIterations || null);
|
||||
}
|
||||
|
||||
// Store additional config on session for reference
|
||||
(session as any).innerConfig = {
|
||||
completionPhrase: completionPhrase || '',
|
||||
maxIterations: maxIterations || 0,
|
||||
maxTodos: maxTodos || 50,
|
||||
todoExpirationMinutes: todoExpirationMinutes || 60
|
||||
};
|
||||
|
||||
// Broadcast the update
|
||||
this.broadcast('session:innerLoopUpdate', {
|
||||
sessionId: id,
|
||||
state: session.innerLoopState
|
||||
});
|
||||
|
||||
return { success: true };
|
||||
});
|
||||
|
||||
// Run prompt in session
|
||||
this.app.post('/api/sessions/:id/run', async (req): Promise<{ success?: boolean; message?: string; error?: string }> => {
|
||||
const { id } = req.params as { id: string };
|
||||
|
||||
Reference in New Issue
Block a user