Skip to content

Commit 45005d6

Browse files
committed
Show the prompt rather than the Opus number
1 parent 54a26d8 commit 45005d6

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

cli/src/components/message-block.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -647,11 +647,8 @@ const AgentBranchWrapper = memo(
647647
selectedAgent.agentType,
648648
siblingBlocks,
649649
)
650-
const name = getImplementorDisplayName(
651-
selectedAgent.agentType,
652-
index,
653-
)
654-
statusText = `Selected ${name}`
650+
// Just show "Selected Prompt #N" without repeating the prompt text
651+
statusText = index !== undefined ? `Selected Prompt #${index + 1}` : 'Selected'
655652
reason = lastBlock?.input?.reason
656653
}
657654
}
@@ -706,6 +703,8 @@ const AgentBranchWrapper = memo(
706703
const displayName = getImplementorDisplayName(
707704
agentBlock.agentType,
708705
implementorIndex,
706+
agentBlock.initialPrompt,
707+
availableWidth,
709708
)
710709
const statusIndicator = isStreaming
711710
? '●'

cli/src/utils/implementor-helpers.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*/
2628
export 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

Comments
 (0)