mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-04 02:21:47 +00:00
fix(tui): format thinking paragraphs
This commit is contained in:
parent
64de685d3f
commit
6a3873942f
2 changed files with 26 additions and 7 deletions
|
|
@ -12,7 +12,8 @@ import {
|
|||
parseToolTrailResultLine,
|
||||
pasteTokenLabel,
|
||||
sameToolTrailGroup,
|
||||
splitToolDuration
|
||||
splitToolDuration,
|
||||
thinkingPreview
|
||||
} from '../lib/text.js'
|
||||
|
||||
describe('isToolTrailResultLine', () => {
|
||||
|
|
@ -82,6 +83,17 @@ describe('estimateTokensRough', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('thinkingPreview', () => {
|
||||
it('adds paragraph breaks before markdown thinking headings', () => {
|
||||
const raw =
|
||||
'**Considering user instructions**\nI need to answer.**Planning tool execution**\nI can run tools.**Determining weather search parameters**\nUse SF.'
|
||||
|
||||
expect(thinkingPreview(raw, 'full')).toBe(
|
||||
'**Considering user instructions**\nI need to answer.\n\n**Planning tool execution**\nI can run tools.\n\n**Determining weather search parameters**\nUse SF.'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('boundedLiveRenderText', () => {
|
||||
it('preserves short live text verbatim', () => {
|
||||
expect(boundedLiveRenderText('one\ntwo', { maxChars: 100, maxLines: 10 })).toBe('one\ntwo')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue