mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
* fix(chat): name the attachment that expired when a send is refused The claim step knew which uploads were gone but threw a bare error, so the refusal could only say "This attachment expired". It now carries each expired upload's id and file name: every client names them, and desktop marks those image chips. Older hosts and clients keep today's generic words. * test(chat): read expired-attachment details through the wire reader
20 lines
953 B
TypeScript
20 lines
953 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { agentSessionWriteNoticeParts } from '../../../src/shared/agent-session/failures/agent-session-refusal-notice'
|
|
import { agentSessionRefusalFailure } from '../../../src/shared/agent-session/failures/agent-session-write-failure'
|
|
import { mobileAgentSessionWriteNoticeText } from './agent-session-write-notice-copy'
|
|
|
|
describe('mobileAgentSessionWriteNoticeText', () => {
|
|
it('names the attachment an expired refusal lists, as its card labels it', () => {
|
|
const failure = agentSessionRefusalFailure({
|
|
code: 'agent_session_operation_invalid',
|
|
details: {
|
|
reason: 'attachmentExpired',
|
|
expiredAttachments: [{ uploadId: 'upload-1', name: 'notes.pdf' }]
|
|
}
|
|
})
|
|
expect(
|
|
mobileAgentSessionWriteNoticeText(agentSessionWriteNoticeParts(failure, 'composer-send'))
|
|
).toBe('notes.pdf expired. Your message was not sent. Remove it and attach it again.')
|
|
})
|
|
})
|