fix(FN-2107): normalize task ID handling for task creation tools

- Return the created task ID directly from runTaskPlan and propagate it through fn_task_plan
- Remove hardcoded FN-### log parsing so CLI extension supports structured IDs like PROJ-042
- Add heartbeat fallback parsing from task_create text output when details.taskId is absent
- Expand engine and CLI tests to cover structured task IDs and updated task-plan return behavior
This commit is contained in:
Fusion
2026-04-19 03:21:26 -07:00
committed by gsxdsm
parent a901975ed8
commit 2f611ce489
7 changed files with 106 additions and 33 deletions

View File

@@ -1038,8 +1038,9 @@ export default function kbExtension(pi: ExtensionAPI) {
originalError.apply(console, args);
};
let taskId: string | undefined;
try {
await runTaskPlan(params.description, true); // Use --yes flag for non-interactive
taskId = await runTaskPlan(params.description, true); // Use --yes flag for non-interactive
} catch (err: any) {
console.error = originalError;
console.log = originalLog;
@@ -1049,10 +1050,6 @@ export default function kbExtension(pi: ExtensionAPI) {
console.log = originalLog;
}
// Parse created task ID from logs
const createdMatch = logs.find((l) => l.match(/Created (FN-\d+):/));
const taskId = createdMatch ? createdMatch.match(/Created (FN-\d+):/)?.[1] : undefined;
// Get summary line
const summaryLine = logs.find((l) => l.includes("✓ Created")) || "Task created";