mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-07 02:51:50 +00:00
fix(tui): address virtual row and perf log review notes
Keep transcript row keys stable across capped-history trims and rename React Profiler timestamp fields so JSONL consumers don't confuse absolute timestamps with durations.
This commit is contained in:
parent
625c31fcea
commit
b51c528613
2 changed files with 5 additions and 4 deletions
|
|
@ -133,6 +133,7 @@ export function useMainApp(gw: GatewayClient) {
|
||||||
const historyItemsRef = useRef(historyItems)
|
const historyItemsRef = useRef(historyItems)
|
||||||
const lastUserMsgRef = useRef(lastUserMsg)
|
const lastUserMsgRef = useRef(lastUserMsg)
|
||||||
const msgIdsRef = useRef(new WeakMap<Msg, string>())
|
const msgIdsRef = useRef(new WeakMap<Msg, string>())
|
||||||
|
const msgIdSeqRef = useRef(0)
|
||||||
const heightCachesRef = useRef(new Map<string, Map<string, number>>())
|
const heightCachesRef = useRef(new Map<string, Map<string, number>>())
|
||||||
|
|
||||||
colsRef.current = cols
|
colsRef.current = cols
|
||||||
|
|
@ -180,7 +181,7 @@ export function useMainApp(gw: GatewayClient) {
|
||||||
return hit
|
return hit
|
||||||
}
|
}
|
||||||
|
|
||||||
const next = messageHeightKey(msg)
|
const next = `${messageHeightKey(msg)}:${++msgIdSeqRef.current}`
|
||||||
|
|
||||||
msgIdsRef.current.set(msg, next)
|
msgIdsRef.current.set(msg, next)
|
||||||
|
|
||||||
|
|
@ -188,7 +189,7 @@ export function useMainApp(gw: GatewayClient) {
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const virtualRows = useMemo<TranscriptRow[]>(
|
const virtualRows = useMemo<TranscriptRow[]>(
|
||||||
() => historyItems.map((msg, index) => ({ index, key: `${index}:${messageId(msg)}`, msg })),
|
() => historyItems.map((msg, index) => ({ index, key: messageId(msg), msg })),
|
||||||
[historyItems, messageId]
|
[historyItems, messageId]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,11 @@ const onRender: ProfilerOnRenderCallback = (id, phase, actualMs, baseMs, startTi
|
||||||
writeRow({
|
writeRow({
|
||||||
actualMs: round2(actualMs),
|
actualMs: round2(actualMs),
|
||||||
baseMs: round2(baseMs),
|
baseMs: round2(baseMs),
|
||||||
commitMs: round2(commitTime),
|
commitTimeMs: round2(commitTime),
|
||||||
id,
|
id,
|
||||||
phase,
|
phase,
|
||||||
src: 'react',
|
src: 'react',
|
||||||
startMs: round2(startTime),
|
startTimeMs: round2(startTime),
|
||||||
ts: Date.now()
|
ts: Date.now()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue