fix(ui): show glob pattern in tool description

This commit is contained in:
Bohdan Triapitsyn
2026-08-01 21:32:06 +03:00
parent 86ef96302d
commit 4cab15605a
3 changed files with 28 additions and 1 deletions
@@ -4,6 +4,7 @@ import { readTaskTagSessionIdFromOutput } from './taskSessionIdParser';
import { tryParseJsonOutput } from '../toolRenderers';
import { getStreamingThrottleText } from '../../hooks/useStreamingTextThrottle';
import { getStreamingOutputAppend, getToolOutput } from './toolOutput';
import { getToolDescriptionFallback } from './toolRenderUtils';
describe('getToolOutput', () => {
test('prefers authoritative state output', () => {
@@ -64,3 +65,15 @@ describe('OpenChamber tool output', () => {
expect(tryParseJsonOutput(JSON.stringify(result))).toEqual({ data: result, isJson: true });
});
});
describe('getToolDescriptionFallback', () => {
test('uses the glob pattern when the provided description and title are empty', () => {
expect(getToolDescriptionFallback('glob', '', { pattern: 'packages/electron/README.md' }))
.toBe('packages/electron/README.md');
});
test('prefers an existing glob description over the pattern', () => {
expect(getToolDescriptionFallback('glob', 'Electron docs', { pattern: 'packages/electron/README.md' }))
.toBe('Electron docs');
});
});