mirror of
https://github.com/stablyai/orca.git
synced 2026-10-22 08:03:37 +00:00
fix(native-chat): avoid unretained summary blobs
This commit is contained in:
@@ -178,7 +178,7 @@ describe('unhandled provider frame journal fallback', () => {
|
||||
expect(row?.body.providerFrame?.kind).toBe('notification:warning')
|
||||
})
|
||||
|
||||
it('bounds a provider sentence and persists its overflow', () => {
|
||||
it('bounds a provider sentence inline', () => {
|
||||
const message = 'abcdefghij'
|
||||
const row = unhandledProviderFrameJournalItem(
|
||||
'codex',
|
||||
@@ -194,7 +194,6 @@ describe('unhandled provider frame journal fallback', () => {
|
||||
|
||||
expect(row?.body.text).toContain('abcdefgh')
|
||||
expect(row?.body.text).toContain('[Orca: output truncated')
|
||||
expect(row?.blobs.map((blob) => blob.payload)).toContain(message)
|
||||
})
|
||||
|
||||
it('unwraps a nested sentence and falls back to the opcode when there is none', () => {
|
||||
|
||||
@@ -79,19 +79,12 @@ export function unhandledProviderFrameJournalItem(
|
||||
// one; the raw frame stays behind the row's disclosure either way.
|
||||
const message = readableMessage(payload)
|
||||
const display = message ? boundInlineText(message, limits) : null
|
||||
const blobs = new Map<string, string>()
|
||||
if (bounded.truncated) {
|
||||
blobs.set(bounded.digest, serialized)
|
||||
}
|
||||
if (message && display?.bounded.truncated) {
|
||||
blobs.set(display.bounded.digest, message)
|
||||
}
|
||||
return {
|
||||
body: {
|
||||
kind: 'status',
|
||||
text: display?.text ?? `${provider} · ${kind}`,
|
||||
providerFrame: { provider, kind, payload: bounded }
|
||||
},
|
||||
blobs: [...blobs].map(([digest, blobPayload]) => ({ digest, payload: blobPayload }))
|
||||
blobs: bounded.truncated ? [{ digest: bounded.digest, payload: serialized }] : []
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user