@@ -22,11 +22,35 @@ export const isImplementorAgent = (agentType: string): boolean => {
2222
2323/**
2424 * Get the display name for an implementor agent
25+ * When a prompt is provided, shows "Prompt #N: [prompt]" format
26+ * Otherwise falls back to model-based naming like "Opus #1"
2527 */
2628export const getImplementorDisplayName = (
2729 agentType : string ,
2830 index ?: number ,
31+ prompt ?: string ,
32+ availableWidth ?: number ,
2933) : string => {
34+ // If we have both an index and a prompt, show "Prompt #N: [prompt]"
35+ if ( index !== undefined && prompt ?. trim ( ) ) {
36+ // Strip "Strategy: " prefix if present (added by editor-multi-prompt)
37+ const cleanPrompt = prompt . startsWith ( 'Strategy: ' )
38+ ? prompt . slice ( 'Strategy: ' . length )
39+ : prompt
40+ // Calculate max prompt length based on terminal width
41+ // Account for: status indicator (2), "Prompt #N: " (~12), potential "Selected " prefix (9)
42+ const prefixLength = `Prompt #${ index + 1 } : ` . length + 2 + 9 // +2 for status indicator, +9 for "Selected "
43+ const margin = 30 // Large margin to prevent wrapping
44+ const maxLength = availableWidth
45+ ? Math . max ( 20 , availableWidth - prefixLength - margin )
46+ : 40
47+ const displayPrompt =
48+ cleanPrompt . length > maxLength
49+ ? cleanPrompt . slice ( 0 , maxLength ) + '...'
50+ : cleanPrompt
51+ return `Prompt #${ index + 1 } : ${ displayPrompt } `
52+ }
53+
3054 let baseName = 'Implementor'
3155 // Check most specific patterns first (editor-implementor2-* with model suffix)
3256 if ( agentType . includes ( 'editor-implementor2-gpt-5' ) ) {
0 commit comments