Skip to content

Commit e63d273

Browse files
fix(ui): suppress redundant failure note when tool error note is shown (#21078)
1 parent 4c85d14 commit e63d273

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/cli/src/ui/hooks/useGeminiStream.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,9 +1050,9 @@ describe('useGeminiStream', () => {
10501050
);
10511051
expect(noteIndex).toBeGreaterThanOrEqual(0);
10521052
expect(stopIndex).toBeGreaterThanOrEqual(0);
1053-
expect(failureHintIndex).toBeGreaterThanOrEqual(0);
1053+
// The failure hint should NOT be present if the suppressed error note was shown
1054+
expect(failureHintIndex).toBe(-1);
10541055
expect(noteIndex).toBeLessThan(stopIndex);
1055-
expect(stopIndex).toBeLessThan(failureHintIndex);
10561056
});
10571057

10581058
it('should group multiple cancelled tool call responses into a single history entry', async () => {

packages/cli/src/ui/hooks/useGeminiStream.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,10 @@ export const useGeminiStream = (
596596
if (!isLowErrorVerbosity || config.getDebugMode()) {
597597
return;
598598
}
599-
if (lowVerbosityFailureNoteShownRef.current) {
599+
if (
600+
lowVerbosityFailureNoteShownRef.current ||
601+
suppressedToolErrorNoteShownRef.current
602+
) {
600603
return;
601604
}
602605

0 commit comments

Comments
 (0)