fix(#371): resolve TypeScript strictness errors in telemetry tracking
Some checks failed
ci/woodpecker/push/coordinator Pipeline failed
ci/woodpecker/push/orchestrator Pipeline was successful
ci/woodpecker/push/api Pipeline was successful
ci/woodpecker/push/web Pipeline failed

- llm-cost-table.ts: Add undefined guard for MODEL_COSTS lookup
- llm-telemetry-tracker.service.ts: Allow undefined in callingContext
  for exactOptionalPropertyTypes compatibility

Refs #371

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 02:07:45 -06:00
parent 746ab20c38
commit 306c2e5bd8
2 changed files with 5 additions and 2 deletions

View File

@@ -80,7 +80,10 @@ export function getModelCost(modelName: string): ModelCost {
for (const prefix of SORTED_PREFIXES) {
if (normalized.startsWith(prefix)) {
return MODEL_COSTS[prefix];
const cost = MODEL_COSTS[prefix];
if (cost !== undefined) {
return cost;
}
}
}

View File

@@ -25,7 +25,7 @@ export interface LlmCompletionParams {
* Optional calling context hint for task type inference.
* Examples: "brain", "chat", "embed", "planning", "code-review"
*/
callingContext?: string;
callingContext?: string | undefined;
/** Whether the call succeeded or failed */
success: boolean;
}