feat(01-03): wire taskMetadata from selectAndApplyModel to resolveModelForComplexity

- Pass unitType and classification.taskMetadata as 5th and 6th args to resolveModelForComplexity
- Completes end-to-end data pipeline: classifier extracts metadata, attaches to ClassificationResult, auto-model-selection passes through to router for capability scoring
This commit is contained in:
Jeremy 2026-03-26 17:20:22 -05:00
parent accee43563
commit 1866ccf781

View file

@ -9,7 +9,7 @@ import type { ExtensionAPI, ExtensionContext } from "@gsd/pi-coding-agent";
import type { GSDPreferences } from "./preferences.js";
import { resolveModelWithFallbacksForUnit, resolveDynamicRoutingConfig } from "./preferences.js";
import type { ComplexityTier } from "./complexity-classifier.js";
import { classifyUnitComplexity, tierLabel, extractTaskMetadata } from "./complexity-classifier.js";
import { classifyUnitComplexity, tierLabel } from "./complexity-classifier.js";
import { resolveModelForComplexity, escalateTier } from "./model-router.js";
import { getLedger, getProjectTotals } from "./metrics.js";
import { unitPhaseLabel } from "./auto-dashboard.js";
@ -107,14 +107,13 @@ export async function selectAndApplyModel(
}
}
// Extract task metadata for capability scoring
const taskMeta = unitType === "execute-task"
? extractTaskMetadata(unitId, basePath)
: undefined;
const routingResult = resolveModelForComplexity(
classification, modelConfig, routingConfig, availableModelIds,
unitType, taskMeta,
classification,
modelConfig,
routingConfig,
availableModelIds,
unitType,
classification.taskMetadata,
);
if (routingResult.wasDowngraded) {