Files
orca/src/renderer/src/components/native-chat/subagents/NativeChatSubagentPrompt.tsx
T
Kelvin Amoaba 978cfacc4e feat(native-chat): show what the main agent asked a subagent and its reply in the subagent's view
A subagent's view now opens with the prompt the main agent gave it, folded
past a few lines, and ends with its final reply once it settles. Claude's
prompt and reply come from the Agent call its run names; Codex's prompt
comes from the spawn call naming the child, and its reply is already its
last own message.
2026-11-13 19:38:59 +00:00

36 lines
1.2 KiB
TypeScript

import { useTranslate } from '@/i18n/use-translate'
import { NativeChatMarkdown } from '../markdown/NativeChatMarkdown'
import { NativeChatCodeBlock } from '../markdown/code/NativeChatCodeBlock'
import { NativeChatUserMessageFold } from '../messages/rows/NativeChatUserMessageFold'
/** Opens a subagent's view with the task the main agent gave it, folded like a long prompt. */
export function NativeChatSubagentPrompt({
agentId,
prompt
}: {
agentId: string
prompt: string
}): React.JSX.Element {
const t = useTranslate()
return (
<section className="rounded-xl border border-chat-user-border bg-chat-user-surface px-3.5 py-2.5">
<h3 className="mb-1 font-sans text-xs text-muted-foreground">
{t('components.native-chat.subagents.promptFromMain', 'Prompt from main agent')}
</h3>
<NativeChatUserMessageFold
messageId={`subagent-prompt:${agentId}`}
markdown={prompt}
className="-mx-3.5 px-3.5"
>
<NativeChatMarkdown
rowKey={`subagent-prompt:${agentId}`}
content={prompt}
variant="document"
className="text-sm text-chat-foreground-strong"
renderCodeBlock={NativeChatCodeBlock}
/>
</NativeChatUserMessageFold>
</section>
)
}