mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 22:14:52 -07:00
fix(core): ensure user rejections update tool outcome for telemetry (#18982)
This commit is contained in:
@@ -973,6 +973,10 @@ describe('Scheduler (Orchestrator)', () => {
|
|||||||
CoreToolCallStatus.Cancelled,
|
CoreToolCallStatus.Cancelled,
|
||||||
'User denied execution.',
|
'User denied execution.',
|
||||||
);
|
);
|
||||||
|
expect(mockStateManager.setOutcome).toHaveBeenCalledWith(
|
||||||
|
'call-1',
|
||||||
|
ToolConfirmationOutcome.Cancel,
|
||||||
|
);
|
||||||
expect(mockStateManager.cancelAllQueued).toHaveBeenCalledWith(
|
expect(mockStateManager.cancelAllQueued).toHaveBeenCalledWith(
|
||||||
'User cancelled operation',
|
'User cancelled operation',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -487,15 +487,17 @@ export class Scheduler {
|
|||||||
});
|
});
|
||||||
outcome = result.outcome;
|
outcome = result.outcome;
|
||||||
lastDetails = result.lastDetails;
|
lastDetails = result.lastDetails;
|
||||||
} else {
|
|
||||||
this.state.setOutcome(callId, ToolConfirmationOutcome.ProceedOnce);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.state.setOutcome(callId, outcome);
|
||||||
|
|
||||||
// Handle Policy Updates
|
// Handle Policy Updates
|
||||||
await updatePolicy(toolCall.tool, outcome, lastDetails, {
|
if (decision === PolicyDecision.ASK_USER && outcome) {
|
||||||
config: this.config,
|
await updatePolicy(toolCall.tool, outcome, lastDetails, {
|
||||||
messageBus: this.messageBus,
|
config: this.config,
|
||||||
});
|
messageBus: this.messageBus,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Handle cancellation (cascades to entire batch)
|
// Handle cancellation (cascades to entire batch)
|
||||||
if (outcome === ToolConfirmationOutcome.Cancel) {
|
if (outcome === ToolConfirmationOutcome.Cancel) {
|
||||||
|
|||||||
Reference in New Issue
Block a user