fix(native-chat): avoid unretained summary blobs

This commit is contained in:
Brennan Benson
2026-08-16 22:14:59 -07:00
parent 4abb89a906
commit 61471580c7
2 changed files with 2 additions and 10 deletions
@@ -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 }] : []
}
}