mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -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,
|
||||
'User denied execution.',
|
||||
);
|
||||
expect(mockStateManager.setOutcome).toHaveBeenCalledWith(
|
||||
'call-1',
|
||||
ToolConfirmationOutcome.Cancel,
|
||||
);
|
||||
expect(mockStateManager.cancelAllQueued).toHaveBeenCalledWith(
|
||||
'User cancelled operation',
|
||||
);
|
||||
|
||||
@@ -487,15 +487,17 @@ export class Scheduler {
|
||||
});
|
||||
outcome = result.outcome;
|
||||
lastDetails = result.lastDetails;
|
||||
} else {
|
||||
this.state.setOutcome(callId, ToolConfirmationOutcome.ProceedOnce);
|
||||
}
|
||||
|
||||
this.state.setOutcome(callId, outcome);
|
||||
|
||||
// Handle Policy Updates
|
||||
await updatePolicy(toolCall.tool, outcome, lastDetails, {
|
||||
config: this.config,
|
||||
messageBus: this.messageBus,
|
||||
});
|
||||
if (decision === PolicyDecision.ASK_USER && outcome) {
|
||||
await updatePolicy(toolCall.tool, outcome, lastDetails, {
|
||||
config: this.config,
|
||||
messageBus: this.messageBus,
|
||||
});
|
||||
}
|
||||
|
||||
// Handle cancellation (cascades to entire batch)
|
||||
if (outcome === ToolConfirmationOutcome.Cancel) {
|
||||
|
||||
Reference in New Issue
Block a user