diff --git a/packages/cli/src/ui/components/shared/TabHeader.test.tsx b/packages/cli/src/ui/components/shared/TabHeader.test.tsx index 680ff51d28..c403e0d8ff 100644 --- a/packages/cli/src/ui/components/shared/TabHeader.test.tsx +++ b/packages/cli/src/ui/components/shared/TabHeader.test.tsx @@ -173,6 +173,28 @@ describe('TabHeader', () => { unmount(); }); + it('truncates long headers when not selected', async () => { + const longTabs: Tab[] = [ + { key: '0', header: 'ThisIsAVeryLongHeaderThatShouldBeTruncated' }, + { key: '1', header: 'AnotherVeryLongHeader' }, + ]; + const { lastFrame, waitUntilReady, unmount } = renderWithProviders( + , + ); + await waitUntilReady(); + const frame = lastFrame(); + + // Current tab (index 0) should NOT be truncated + expect(frame).toContain('ThisIsAVeryLongHeaderThatShouldBeTruncated'); + + // Inactive tab (index 1) SHOULD be truncated to 16 chars (15 chars + …) + const expectedTruncated = 'AnotherVeryLong…'; + expect(frame).toContain(expectedTruncated); + expect(frame).not.toContain('AnotherVeryLongHeader'); + + unmount(); + }); + it('falls back to default when renderStatusIcon returns undefined', async () => { const renderStatusIcon = () => undefined; const { lastFrame, waitUntilReady, unmount } = renderWithProviders( diff --git a/packages/cli/src/ui/components/shared/TabHeader.tsx b/packages/cli/src/ui/components/shared/TabHeader.tsx index ad4e98cf3a..6ba93b37ff 100644 --- a/packages/cli/src/ui/components/shared/TabHeader.tsx +++ b/packages/cli/src/ui/components/shared/TabHeader.tsx @@ -94,16 +94,19 @@ export function TabHeader({ {showStatusIcons && ( {getStatusIcon(tab, i)} )} - - {tab.header} - + + + {tab.header} + + ))} {showArrows && {' →'}} diff --git a/packages/core/src/tools/ask-user.test.ts b/packages/core/src/tools/ask-user.test.ts index df206890c3..57a0556466 100644 --- a/packages/core/src/tools/ask-user.test.ts +++ b/packages/core/src/tools/ask-user.test.ts @@ -103,19 +103,6 @@ describe('AskUserTool', () => { expect(result).toContain("must have required property 'header'"); }); - it('should return error if header exceeds max length', () => { - const result = tool.validateToolParams({ - questions: [ - { - question: 'Test?', - header: 'This is way too long', - type: QuestionType.CHOICE, - }, - ], - }); - expect(result).toContain('must NOT have more than 16 characters'); - }); - it('should return error if options has fewer than 2 items', () => { const result = tool.validateToolParams({ questions: [ @@ -276,13 +263,7 @@ describe('AskUserTool', () => { describe('validateBuildAndExecute', () => { it('should hide validation errors from returnDisplay', async () => { const params = { - questions: [ - { - question: 'Test?', - header: 'This is way too long', - type: QuestionType.TEXT, - }, - ], + questions: [], }; const result = await tool.validateBuildAndExecute( diff --git a/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap b/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap index 8ec768d843..0da9d24e14 100644 --- a/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap +++ b/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap @@ -80,8 +80,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snaps "items": { "properties": { "header": { - "description": "MUST be 16 characters or fewer or the call will fail. Very short label displayed as a chip/tag. Use abbreviations: "Auth" not "Authentication", "Config" not "Configuration". Examples: "Auth method", "Library", "Approach", "Database".", - "maxLength": 16, + "description": "Very short label displayed as a chip/tag. Use abbreviations: "Auth" not "Authentication", "Config" not "Configuration". Examples: "Auth method", "Library", "Approach", "Database".", "type": "string", }, "multiSelect": { @@ -869,8 +868,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > "items": { "properties": { "header": { - "description": "MUST be 16 characters or fewer or the call will fail. Very short label displayed as a chip/tag. Use abbreviations: "Auth" not "Authentication", "Config" not "Configuration". Examples: "Auth method", "Library", "Approach", "Database".", - "maxLength": 16, + "description": "Very short label displayed as a chip/tag. Use abbreviations: "Auth" not "Authentication", "Config" not "Configuration". Examples: "Auth method", "Library", "Approach", "Database".", "type": "string", }, "multiSelect": { diff --git a/packages/core/src/tools/definitions/model-family-sets/default-legacy.ts b/packages/core/src/tools/definitions/model-family-sets/default-legacy.ts index ae9c4831ad..854aa4ddeb 100644 --- a/packages/core/src/tools/definitions/model-family-sets/default-legacy.ts +++ b/packages/core/src/tools/definitions/model-family-sets/default-legacy.ts @@ -609,9 +609,8 @@ The agent did not use the todo list because this task could be completed by a ti }, header: { type: 'string', - maxLength: 16, description: - 'MUST be 16 characters or fewer or the call will fail. Very short label displayed as a chip/tag. Use abbreviations: "Auth" not "Authentication", "Config" not "Configuration". Examples: "Auth method", "Library", "Approach", "Database".', + 'Very short label displayed as a chip/tag. Use abbreviations: "Auth" not "Authentication", "Config" not "Configuration". Examples: "Auth method", "Library", "Approach", "Database".', }, type: { type: 'string', diff --git a/packages/core/src/tools/definitions/model-family-sets/gemini-3.ts b/packages/core/src/tools/definitions/model-family-sets/gemini-3.ts index 6bb2809874..41c58a55bc 100644 --- a/packages/core/src/tools/definitions/model-family-sets/gemini-3.ts +++ b/packages/core/src/tools/definitions/model-family-sets/gemini-3.ts @@ -587,9 +587,8 @@ The agent did not use the todo list because this task could be completed by a ti }, header: { type: 'string', - maxLength: 16, description: - 'MUST be 16 characters or fewer or the call will fail. Very short label displayed as a chip/tag. Use abbreviations: "Auth" not "Authentication", "Config" not "Configuration". Examples: "Auth method", "Library", "Approach", "Database".', + 'Very short label displayed as a chip/tag. Use abbreviations: "Auth" not "Authentication", "Config" not "Configuration". Examples: "Auth method", "Library", "Approach", "Database".', }, type: { type: 'string',