From 1866ccf78128d889eb35be7a85919e4ea735c96b Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 26 Mar 2026 17:20:22 -0500 Subject: [PATCH] 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 --- .../extensions/gsd/auto-model-selection.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/resources/extensions/gsd/auto-model-selection.ts b/src/resources/extensions/gsd/auto-model-selection.ts index cf2326e35..8519553d9 100644 --- a/src/resources/extensions/gsd/auto-model-selection.ts +++ b/src/resources/extensions/gsd/auto-model-selection.ts @@ -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) {