mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-25 17:18:11 +00:00
fmt(js): npm run fix on merge (#71196)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
62e07223d6
commit
9823f15f6a
5 changed files with 10 additions and 17 deletions
|
|
@ -81,7 +81,10 @@ describe('useMessageStream agent-init error surfacing (#63078)', () => {
|
|||
|
||||
act(() =>
|
||||
handleEvent!({
|
||||
payload: { message: 'agent initialization timed out after 601s — your message was not sent; retry once the session is ready' },
|
||||
payload: {
|
||||
message:
|
||||
'agent initialization timed out after 601s — your message was not sent; retry once the session is ready'
|
||||
},
|
||||
session_id: SID,
|
||||
type: 'error'
|
||||
})
|
||||
|
|
|
|||
|
|
@ -437,12 +437,7 @@ export function useMessageStream({
|
|||
)
|
||||
|
||||
const completeAssistantMessage = useCallback(
|
||||
(
|
||||
sessionId: string,
|
||||
text: string,
|
||||
responsePreviewed?: boolean,
|
||||
failure?: { error: string; partial: boolean }
|
||||
) => {
|
||||
(sessionId: string, text: string, responsePreviewed?: boolean, failure?: { error: string; partial: boolean }) => {
|
||||
let shouldHydrate = false
|
||||
|
||||
const completedState = updateSessionState(sessionId, state => {
|
||||
|
|
|
|||
|
|
@ -565,9 +565,9 @@ describe('appendLiveSessionProjection', () => {
|
|||
const userRows = restored.filter(message => message.role === 'user')
|
||||
expect(userRows).toHaveLength(1)
|
||||
expect(userRows[0].id).toBe('stored-user')
|
||||
const userText = userRows[0].parts
|
||||
.map(part => ('text' in part ? part.text : ''))
|
||||
.join('')
|
||||
|
||||
const userText = userRows[0].parts.map(part => ('text' in part ? part.text : '')).join('')
|
||||
|
||||
expect(userText).toBe('current running prompt')
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -367,6 +367,7 @@ export function appendLiveSessionProjection(
|
|||
// Only suppress the projection when the latest authoritative user row is the
|
||||
// same turn — older identical prompts must not hide a newly accepted repeat.
|
||||
const latestUser = [...messages].reverse().find(message => message.role === 'user')
|
||||
|
||||
const inflightUserAlreadyPersisted =
|
||||
latestUser && textWithoutImageRefs(chatMessageText(latestUser)) === textWithoutImageRefs(inflightUser)
|
||||
|
||||
|
|
|
|||
|
|
@ -250,13 +250,7 @@ describe('toChatMessages', () => {
|
|||
}
|
||||
])
|
||||
|
||||
expect(messages.map(message => message.role)).toEqual([
|
||||
'user',
|
||||
'assistant',
|
||||
'system',
|
||||
'system',
|
||||
'system'
|
||||
])
|
||||
expect(messages.map(message => message.role)).toEqual(['user', 'assistant', 'system', 'system', 'system'])
|
||||
expect(messages.map(chatMessageText)).toEqual([
|
||||
'real user turn',
|
||||
'real assistant reply',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue