feat(cli): overhaul thinking UI (#18725)

This commit is contained in:
Keith Guerin
2026-03-06 20:20:27 -08:00
committed by GitHub
parent 9455ecd78c
commit e5d58c2b5a
29 changed files with 763 additions and 184 deletions
@@ -33,6 +33,43 @@ describe('convertSessionToClientHistory', () => {
]);
});
it('should convert thinking tokens (thoughts) to model parts', () => {
const messages: ConversationRecord['messages'] = [
{
id: '1',
type: 'user',
timestamp: '2024-01-01T10:00:00Z',
content: 'Hello',
},
{
id: '2',
type: 'gemini',
timestamp: '2024-01-01T10:01:00Z',
content: 'Hi there',
thoughts: [
{
subject: 'Thinking',
description: 'I should be polite.',
timestamp: '2024-01-01T10:00:50Z',
},
],
},
];
const history = convertSessionToClientHistory(messages);
expect(history).toEqual([
{ role: 'user', parts: [{ text: 'Hello' }] },
{
role: 'model',
parts: [
{ text: '**Thinking** I should be polite.', thought: true },
{ text: 'Hi there' },
],
},
]);
});
it('should ignore info, error, and slash commands', () => {
const messages: ConversationRecord['messages'] = [
{