Skip to content

Commit 51438fd

Browse files
committed
fix(cli): show agent prompts in previews
1 parent 651f03a commit 51438fd

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

cli/src/components/message-block.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ export const MessageBlock = ({
198198
const firstLine = lines[0] || ''
199199

200200
const streamingPreview = isStreaming
201-
? `${sanitizePreview(firstLine)}...`
201+
? agentBlock.initialPrompt
202+
? sanitizePreview(agentBlock.initialPrompt)
203+
: `${sanitizePreview(firstLine)}...`
202204
: ''
203205

204206
const finishedPreview =

cli/src/hooks/use-send-message.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -621,22 +621,22 @@ export const useSendMessage = ({
621621
return msg
622622
}
623623

624-
const existingBlocks: ContentBlock[] = msg.blocks
625-
? [...msg.blocks]
626-
: []
624+
const existingBlocks: ContentBlock[] = msg.blocks
625+
? [...msg.blocks]
626+
: []
627627

628-
const newAgentBlocks: ContentBlock[] = agents.map(
629-
(agent: any, index: number) => ({
630-
type: 'agent',
631-
agentId: `${toolCallId}-${index}`,
632-
agentName: agent.agent_type || 'Agent',
633-
agentType: agent.agent_type || 'unknown',
634-
content: agent.prompt || '',
635-
status: 'running' as const,
636-
blocks: [] as ContentBlock[],
637-
initialPrompt: agent.prompt || '',
638-
}),
639-
)
628+
const newAgentBlocks: ContentBlock[] = agents.map(
629+
(agent: any, index: number) => ({
630+
type: 'agent',
631+
agentId: `${toolCallId}-${index}`,
632+
agentName: agent.agent_type || 'Agent',
633+
agentType: agent.agent_type || 'unknown',
634+
content: '',
635+
status: 'running' as const,
636+
blocks: [] as ContentBlock[],
637+
initialPrompt: agent.prompt || '',
638+
}),
639+
)
640640

641641
return {
642642
...msg,

0 commit comments

Comments
 (0)