fix: fix mcp tool call in extension

- fix console.log directly being used in scope-adjutment.js breaking mcp
This commit is contained in:
Ralph Khreish
2025-08-02 22:48:10 +03:00
parent 82b17bdb57
commit 30359e3cea
2 changed files with 16 additions and 12 deletions

View File

@@ -251,7 +251,7 @@ export function useScopeUpTask() {
type: 'mcpRequest', type: 'mcpRequest',
tool: 'scope_up_task', tool: 'scope_up_task',
params: { params: {
id: taskId, id: String(taskId),
strength, strength,
prompt, prompt,
research: options.research || false research: options.research || false
@@ -309,7 +309,7 @@ export function useScopeDownTask() {
type: 'mcpRequest', type: 'mcpRequest',
tool: 'scope_down_task', tool: 'scope_down_task',
params: { params: {
id: taskId, id: String(taskId),
strength, strength,
prompt, prompt,
research: options.research || false research: options.research || false

View File

@@ -279,8 +279,9 @@ async function regenerateSubtasksForComplexity(
'debug', 'debug',
`Complexity-aware subtask calculation${complexityInfo}: ${currentPendingCount} pending -> target ${targetSubtaskCount} total` `Complexity-aware subtask calculation${complexityInfo}: ${currentPendingCount} pending -> target ${targetSubtaskCount} total`
); );
console.log( log(
`[DEBUG] Complexity-aware calculation${complexityInfo}: ${currentPendingCount} pending -> ${targetSubtaskCount} total subtasks (${strength} ${direction})` 'debug',
`Complexity-aware calculation${complexityInfo}: ${currentPendingCount} pending -> ${targetSubtaskCount} total subtasks (${strength} ${direction})`
); );
const newSubtasksNeeded = Math.max(1, targetSubtaskCount - preservedCount); const newSubtasksNeeded = Math.max(1, targetSubtaskCount - preservedCount);
@@ -386,8 +387,9 @@ Ensure the JSON is valid and properly formatted.`;
generated: generatedSubtasks.length generated: generatedSubtasks.length
}; };
} catch (error) { } catch (error) {
console.log( log(
`[WARN] Failed to regenerate subtasks for task ${task.id}: ${error.message}` 'warn',
`Failed to regenerate subtasks for task ${task.id}: ${error.message}`
); );
// Don't fail the whole operation if subtask regeneration fails // Don't fail the whole operation if subtask regeneration fails
return { return {
@@ -583,7 +585,7 @@ export async function scopeUpTask(
// Get original complexity score (if available) // Get original complexity score (if available)
const originalComplexity = getCurrentComplexityScore(taskId, context); const originalComplexity = getCurrentComplexityScore(taskId, context);
if (originalComplexity && outputFormat === 'text') { if (originalComplexity && outputFormat === 'text') {
console.log(`[INFO] Original complexity: ${originalComplexity}/10`); log('info', `Original complexity: ${originalComplexity}/10`);
} }
const adjustResult = await adjustTaskComplexity( const adjustResult = await adjustTaskComplexity(
@@ -635,8 +637,9 @@ export async function scopeUpTask(
const complexityChange = newComplexity - originalComplexity; const complexityChange = newComplexity - originalComplexity;
const arrow = const arrow =
complexityChange > 0 ? '↗️' : complexityChange < 0 ? '↘️' : '➡️'; complexityChange > 0 ? '↗️' : complexityChange < 0 ? '↘️' : '➡️';
console.log( log(
`[INFO] New complexity: ${originalComplexity}/10 ${arrow} ${newComplexity}/10 (${complexityChange > 0 ? '+' : ''}${complexityChange})` 'info',
`New complexity: ${originalComplexity}/10 ${arrow} ${newComplexity}/10 (${complexityChange > 0 ? '+' : ''}${complexityChange})`
); );
} }
} catch (error) { } catch (error) {
@@ -733,7 +736,7 @@ export async function scopeDownTask(
// Get original complexity score (if available) // Get original complexity score (if available)
const originalComplexity = getCurrentComplexityScore(taskId, context); const originalComplexity = getCurrentComplexityScore(taskId, context);
if (originalComplexity && outputFormat === 'text') { if (originalComplexity && outputFormat === 'text') {
console.log(`[INFO] Original complexity: ${originalComplexity}/10`); log('info', `Original complexity: ${originalComplexity}/10`);
} }
const adjustResult = await adjustTaskComplexity( const adjustResult = await adjustTaskComplexity(
@@ -785,8 +788,9 @@ export async function scopeDownTask(
const complexityChange = newComplexity - originalComplexity; const complexityChange = newComplexity - originalComplexity;
const arrow = const arrow =
complexityChange > 0 ? '↗️' : complexityChange < 0 ? '↘️' : '➡️'; complexityChange > 0 ? '↗️' : complexityChange < 0 ? '↘️' : '➡️';
console.log( log(
`[INFO] New complexity: ${originalComplexity}/10 ${arrow} ${newComplexity}/10 (${complexityChange > 0 ? '+' : ''}${complexityChange})` 'info',
`New complexity: ${originalComplexity}/10 ${arrow} ${newComplexity}/10 (${complexityChange > 0 ? '+' : ''}${complexityChange})`
); );
} }
} catch (error) { } catch (error) {