mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-15 07:41:03 -07:00
fix(core): prevent secondary crash in ModelRouterService finally block (#25333)
This commit is contained in:
committed by
GitHub
parent
24f9ec51d2
commit
706d4d4707
@@ -74,7 +74,7 @@ export class ModelRouterService {
|
||||
*/
|
||||
async route(context: RoutingContext): Promise<RoutingDecision> {
|
||||
const startTime = Date.now();
|
||||
let decision: RoutingDecision;
|
||||
let decision: RoutingDecision | undefined;
|
||||
|
||||
const [enableNumericalRouting, thresholdValue] = await Promise.all([
|
||||
this.config.getNumericalRoutingEnabled(),
|
||||
@@ -117,10 +117,10 @@ export class ModelRouterService {
|
||||
);
|
||||
} finally {
|
||||
const event = new ModelRoutingEvent(
|
||||
decision!.model,
|
||||
decision!.metadata.source,
|
||||
decision!.metadata.latencyMs,
|
||||
decision!.metadata.reasoning,
|
||||
decision?.model || 'unknown',
|
||||
decision?.metadata?.source || 'unknown',
|
||||
decision?.metadata?.latencyMs || 0,
|
||||
decision?.metadata?.reasoning,
|
||||
failed,
|
||||
error_message,
|
||||
this.config.getApprovalMode(),
|
||||
|
||||
Reference in New Issue
Block a user