mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-06 02:41:48 +00:00
fix(tui): apply details mode live
This commit is contained in:
parent
6814646b36
commit
a8fcd1c742
12 changed files with 56 additions and 19 deletions
|
|
@ -25,6 +25,7 @@ const StreamingAssistant = memo(function StreamingAssistant({
|
|||
cols,
|
||||
compact,
|
||||
detailsMode,
|
||||
detailsModeCommandOverride,
|
||||
progress,
|
||||
sections,
|
||||
t
|
||||
|
|
@ -40,6 +41,7 @@ const StreamingAssistant = memo(function StreamingAssistant({
|
|||
cols={cols}
|
||||
compact={compact}
|
||||
detailsMode={detailsMode}
|
||||
detailsModeCommandOverride={detailsModeCommandOverride}
|
||||
key={`seg:${i}`}
|
||||
msg={msg}
|
||||
sections={sections}
|
||||
|
|
@ -52,6 +54,7 @@ const StreamingAssistant = memo(function StreamingAssistant({
|
|||
<ToolTrail
|
||||
activity={progress.activity}
|
||||
busy={busy}
|
||||
commandOverride={detailsModeCommandOverride}
|
||||
detailsMode={detailsMode}
|
||||
outcome={progress.outcome}
|
||||
reasoning={progress.reasoning}
|
||||
|
|
@ -73,6 +76,7 @@ const StreamingAssistant = memo(function StreamingAssistant({
|
|||
cols={cols}
|
||||
compact={compact}
|
||||
detailsMode={detailsMode}
|
||||
detailsModeCommandOverride={detailsModeCommandOverride}
|
||||
isStreaming
|
||||
msg={{
|
||||
role: 'assistant',
|
||||
|
|
@ -89,6 +93,7 @@ const StreamingAssistant = memo(function StreamingAssistant({
|
|||
cols={cols}
|
||||
compact={compact}
|
||||
detailsMode={detailsMode}
|
||||
detailsModeCommandOverride={detailsModeCommandOverride}
|
||||
msg={{ kind: 'trail', role: 'system', text: '', tools: progress.streamPendingTools }}
|
||||
sections={sections}
|
||||
t={t}
|
||||
|
|
@ -127,6 +132,7 @@ const TranscriptPane = memo(function TranscriptPane({
|
|||
cols={composer.cols}
|
||||
compact={ui.compact}
|
||||
detailsMode={ui.detailsMode}
|
||||
detailsModeCommandOverride={ui.detailsModeCommandOverride}
|
||||
msg={row.msg}
|
||||
sections={ui.sections}
|
||||
t={ui.theme}
|
||||
|
|
@ -142,6 +148,7 @@ const TranscriptPane = memo(function TranscriptPane({
|
|||
cols={composer.cols}
|
||||
compact={ui.compact}
|
||||
detailsMode={ui.detailsMode}
|
||||
detailsModeCommandOverride={ui.detailsModeCommandOverride}
|
||||
progress={progress}
|
||||
sections={ui.sections}
|
||||
t={ui.theme}
|
||||
|
|
@ -353,6 +360,7 @@ interface StreamingAssistantProps {
|
|||
cols: number
|
||||
compact?: boolean
|
||||
detailsMode: DetailsMode
|
||||
detailsModeCommandOverride: boolean
|
||||
progress: AppLayoutProgressProps
|
||||
sections?: SectionVisibility
|
||||
t: Theme
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ export const MessageLine = memo(function MessageLine({
|
|||
cols,
|
||||
compact,
|
||||
detailsMode = 'collapsed',
|
||||
detailsModeCommandOverride = false,
|
||||
isStreaming = false,
|
||||
msg,
|
||||
sections,
|
||||
|
|
@ -28,15 +29,16 @@ export const MessageLine = memo(function MessageLine({
|
|||
// feeds Thinking + Tool calls. Gating on every section would let
|
||||
// `thinking` (expanded by default) keep an empty wrapper alive when only
|
||||
// `tools` is hidden — exactly the empty-Box bug Copilot caught.
|
||||
const thinkingMode = sectionMode('thinking', detailsMode, sections)
|
||||
const toolsMode = sectionMode('tools', detailsMode, sections)
|
||||
const activityMode = sectionMode('activity', detailsMode, sections)
|
||||
const thinkingMode = sectionMode('thinking', detailsMode, sections, detailsModeCommandOverride)
|
||||
const toolsMode = sectionMode('tools', detailsMode, sections, detailsModeCommandOverride)
|
||||
const activityMode = sectionMode('activity', detailsMode, sections, detailsModeCommandOverride)
|
||||
const thinking = msg.thinking?.trim() ?? ''
|
||||
|
||||
if (msg.kind === 'trail' && (msg.tools?.length || thinking)) {
|
||||
return thinkingMode !== 'hidden' || toolsMode !== 'hidden' || activityMode !== 'hidden' ? (
|
||||
<Box flexDirection="column">
|
||||
<ToolTrail
|
||||
commandOverride={detailsModeCommandOverride}
|
||||
detailsMode={detailsMode}
|
||||
reasoning={thinking}
|
||||
reasoningTokens={msg.thinkingTokens}
|
||||
|
|
@ -118,6 +120,7 @@ export const MessageLine = memo(function MessageLine({
|
|||
{showDetails && (
|
||||
<Box flexDirection="column" marginBottom={1}>
|
||||
<ToolTrail
|
||||
commandOverride={detailsModeCommandOverride}
|
||||
detailsMode={detailsMode}
|
||||
reasoning={thinking}
|
||||
reasoningTokens={msg.thinkingTokens}
|
||||
|
|
@ -146,6 +149,7 @@ interface MessageLineProps {
|
|||
cols: number
|
||||
compact?: boolean
|
||||
detailsMode?: DetailsMode
|
||||
detailsModeCommandOverride?: boolean
|
||||
isStreaming?: boolean
|
||||
msg: Msg
|
||||
sections?: SectionVisibility
|
||||
|
|
|
|||
|
|
@ -681,6 +681,7 @@ interface Group {
|
|||
|
||||
export const ToolTrail = memo(function ToolTrail({
|
||||
busy = false,
|
||||
commandOverride = false,
|
||||
detailsMode = 'collapsed',
|
||||
outcome = '',
|
||||
reasoningActive = false,
|
||||
|
|
@ -696,6 +697,7 @@ export const ToolTrail = memo(function ToolTrail({
|
|||
activity = []
|
||||
}: {
|
||||
busy?: boolean
|
||||
commandOverride?: boolean
|
||||
detailsMode?: DetailsMode
|
||||
outcome?: string
|
||||
reasoningActive?: boolean
|
||||
|
|
@ -712,12 +714,12 @@ export const ToolTrail = memo(function ToolTrail({
|
|||
}) {
|
||||
const visible = useMemo(
|
||||
() => ({
|
||||
thinking: sectionMode('thinking', detailsMode, sections),
|
||||
tools: sectionMode('tools', detailsMode, sections),
|
||||
subagents: sectionMode('subagents', detailsMode, sections),
|
||||
activity: sectionMode('activity', detailsMode, sections)
|
||||
thinking: sectionMode('thinking', detailsMode, sections, commandOverride),
|
||||
tools: sectionMode('tools', detailsMode, sections, commandOverride),
|
||||
subagents: sectionMode('subagents', detailsMode, sections, commandOverride),
|
||||
activity: sectionMode('activity', detailsMode, sections, commandOverride)
|
||||
}),
|
||||
[detailsMode, sections]
|
||||
[commandOverride, detailsMode, sections]
|
||||
)
|
||||
|
||||
const [now, setNow] = useState(() => Date.now())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue