mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-04 06:29:42 +02:00
chore: bump version to 0.1399
This commit is contained in:
+38
-9
@@ -2662,6 +2662,9 @@ class ClaudemanApp {
|
||||
const plan = this.ralphWizardConfig.existingPlan;
|
||||
if (!plan) return;
|
||||
|
||||
// Stop any ongoing plan generation
|
||||
this.stopPlanGeneration();
|
||||
|
||||
// Convert existing todos to generatedPlan format (only pending items)
|
||||
const pendingTodos = plan.todos.filter(t => t.status === 'pending' || t.status === 'in_progress');
|
||||
this.ralphWizardConfig.generatedPlan = pendingTodos.map((todo, idx) => ({
|
||||
@@ -2678,6 +2681,28 @@ class ClaudemanApp {
|
||||
this.updateDetailLevelButtons();
|
||||
}
|
||||
|
||||
// Stop any ongoing plan generation (abort fetch, clear timers, hide spinner)
|
||||
stopPlanGeneration() {
|
||||
// Abort ongoing fetch
|
||||
if (this.planGenerationAbortController) {
|
||||
this.planGenerationAbortController.abort();
|
||||
this.planGenerationAbortController = null;
|
||||
}
|
||||
|
||||
// Clear timers
|
||||
if (this.planLoadingTimer) {
|
||||
clearInterval(this.planLoadingTimer);
|
||||
this.planLoadingTimer = null;
|
||||
}
|
||||
if (this.planPhaseTimer) {
|
||||
clearInterval(this.planPhaseTimer);
|
||||
this.planPhaseTimer = null;
|
||||
}
|
||||
|
||||
// Hide loading spinner
|
||||
document.getElementById('planGenerationLoading')?.classList.add('hidden');
|
||||
}
|
||||
|
||||
// Generate a new plan (ignore existing)
|
||||
generateNewPlan() {
|
||||
this.ralphWizardConfig.useExistingPlan = false;
|
||||
@@ -2832,15 +2857,11 @@ class ClaudemanApp {
|
||||
async generatePlan() {
|
||||
const config = this.ralphWizardConfig;
|
||||
|
||||
// Stop any existing timers
|
||||
if (this.planLoadingTimer) {
|
||||
clearInterval(this.planLoadingTimer);
|
||||
this.planLoadingTimer = null;
|
||||
}
|
||||
if (this.planPhaseTimer) {
|
||||
clearInterval(this.planPhaseTimer);
|
||||
this.planPhaseTimer = null;
|
||||
}
|
||||
// Stop any existing generation first
|
||||
this.stopPlanGeneration();
|
||||
|
||||
// Create abort controller for this generation
|
||||
this.planGenerationAbortController = new AbortController();
|
||||
|
||||
// Show loading state, hide other sections
|
||||
document.getElementById('existingPlanSection')?.classList.add('hidden');
|
||||
@@ -2895,6 +2916,7 @@ class ClaudemanApp {
|
||||
taskDescription: config.taskDescription,
|
||||
detailLevel: config.planDetailLevel,
|
||||
}),
|
||||
signal: this.planGenerationAbortController?.signal,
|
||||
});
|
||||
|
||||
const data = await res.json();
|
||||
@@ -2946,6 +2968,13 @@ class ClaudemanApp {
|
||||
clearInterval(this.planLoadingTimer);
|
||||
this.planLoadingTimer = null;
|
||||
}
|
||||
|
||||
// Ignore abort errors (user cancelled, e.g., clicked "Use Existing Plan")
|
||||
if (err.name === 'AbortError') {
|
||||
console.log('Plan generation aborted by user');
|
||||
return;
|
||||
}
|
||||
|
||||
console.error('Plan generation failed:', err);
|
||||
this.showPlanError('Network error: ' + err.message);
|
||||
}
|
||||
|
||||
@@ -2917,6 +2917,11 @@ NOW: Generate the implementation plan for the task above. Think step by step.`;
|
||||
private async _doCleanupSession(sessionId: string, killScreen: boolean): Promise<void> {
|
||||
const session = this.sessions.get(sessionId);
|
||||
|
||||
// Stop watching @fix_plan.md for this session
|
||||
if (session) {
|
||||
session.ralphTracker.stopWatchingFixPlan();
|
||||
}
|
||||
|
||||
// Kill all subagents spawned by this session
|
||||
if (session && killScreen) {
|
||||
try {
|
||||
@@ -3032,6 +3037,9 @@ NOW: Generate the implementation plan for the task above. Think step by step.`;
|
||||
this.runSummaryTrackers.set(session.id, summaryTracker);
|
||||
summaryTracker.recordSessionStarted(session.mode, session.workingDir);
|
||||
|
||||
// Set working directory for Ralph tracker to auto-load @fix_plan.md
|
||||
session.ralphTracker.setWorkingDir(session.workingDir);
|
||||
|
||||
session.on('output', (data) => {
|
||||
// Use batching for better performance at high throughput
|
||||
this.batchOutputData(session.id, data);
|
||||
|
||||
Reference in New Issue
Block a user