Skip to content

The agent that grows with you

test(desktop): trim empty-prose pairing tests to the two reproducer invariants

teknium14a833f1c53a4
diff --git a/apps/desktop/src/app/session/hooks/use-session-actions/resume-empty-prose-pairing.test.ts b/apps/desktop/src/app/session/hooks/use-session-actions/resume-empty-prose-pairing.test.ts
index 46536fbc609..f7a743aafb3 100644
--- a/apps/desktop/src/app/session/hooks/use-session-actions/resume-empty-prose-pairing.test.ts
+++ b/apps/desktop/src/app/session/hooks/use-session-actions/resume-empty-prose-pairing.test.ts
@@ -72,87 +72,3 @@ describe('reconcileResumeMessages — empty-prose pairing', () => {
expect(reconciled[1].parts).toEqual([{ type: 'text', text: 'a settled unrelated answer' }])
})
})
-
-/**
- * The carry the issue explicitly protects: identified rows and genuinely live
- * flat projections must retain cached reasoning/tools after the guards above.
- */
-describe('reconcileResumeMessages — structural carry stays for matched turns', () => {
- it('still re-grafts cached structure onto a live flat row of the same turn', () => {
- const cachedLive: ChatMessage = {
- id: 'assistant-stream-1',
- pending: true,
- parts: [
- { type: 'reasoning', text: 'thinking', timestamp: 1 },
- { type: 'tool-call', toolCallId: 'call-1', toolName: 'read_file', timestamp: 2 },
- { type: 'text', text: 'partial answer', timestamp: 3 }
- ],
- role: 'assistant'
- }
-
- const authoritative: ChatMessage[] = [
- user('u1', 'do the thing'),
- {
- id: 'assistant-stream-1',
- pending: true,
- parts: [{ type: 'text', text: 'partial answer — more deltas', timestamp: 4 }],
- role: 'assistant'
- }
- ]
-
- const [, assistant] = reconcileResumeMessages(authoritative, [cachedLive])
-
- expect(assistant.parts.some(part => part.type === 'reasoning')).toBe(true)
- expect(assistant.parts.some(part => part.type === 'tool-call')).toBe(true)
- expect(assistant.parts.filter(part => part.type === 'text').at(-1)).toMatchObject({
- text: 'partial answer — more deltas'
- })
- })
-
- it('still grafts structure onto a settled text row matched by identical non-empty prose', () => {
- const cachedLive: ChatMessage = {
- id: 'assistant-stream-1',
- pending: true,
- parts: [
- { type: 'reasoning', text: 'thinking', timestamp: 1 },
- { type: 'tool-call', toolCallId: 'call-1', toolName: 'read_file', timestamp: 2 },
- { type: 'text', text: 'final answer', timestamp: 3 }
- ],
- role: 'assistant'
- }
-
- const authoritative: ChatMessage[] = [
- user('u1', 'do the thing'),
- { id: 'stored-1', parts: [{ type: 'text', text: 'final answer' }], role: 'assistant' }
- ]
-
- const [, assistant] = reconcileResumeMessages(authoritative, [cachedLive])
-
- expect(assistant.parts.some(part => part.type === 'reasoning')).toBe(true)
- expect(assistant.parts.some(part => part.type === 'tool-call')).toBe(true)
- })
-
- it('still preserves the empty-shell case: a traces-only live row survives an empty hydrated shell', () => {
- // #75825-adjacent: text-length comparison alone cannot tell an empty shell
- // from a traces-only row; structure must survive.
- const cachedLive: ChatMessage = {
- id: 'assistant-stream-live',
- pending: true,
- parts: [
- { type: 'reasoning', text: 'planning', timestamp: 1 },
- { type: 'tool-call', toolCallId: 'call-1', toolName: 'terminal', timestamp: 2 }
- ],
- role: 'assistant'
- }
-
- const authoritative: ChatMessage[] = [
- user('u1', 'run the tools'),
- { id: 'assistant-stream-sess', pending: true, parts: [], role: 'assistant' }
- ]
-
- const [, assistant] = reconcileResumeMessages(authoritative, [cachedLive])
-
- expect(assistant.id).toBe('assistant-stream-live')
- expect(assistant.parts.map(part => part.type)).toEqual(['reasoning', 'tool-call'])
- })
-})
diff --git a/apps/desktop/src/app/session/hooks/use-session-actions/utils.ts b/apps/desktop/src/app/session/hooks/use-session-actions/utils.ts
index c757a78e42f..1d96404a576 100644
--- a/apps/desktop/src/app/session/hooks/use-session-actions/utils.ts
+++ b/apps/desktop/src/app/session/hooks/use-session-actions/utils.ts
@@ -850,7 +850,6 @@ export function appendLiveSessionProjection(messages: ChatMessage[], projection:
// timeline projection history uses instead of as a user bubble (#112144).
// `toChatMessages` yields nothing for `hidden`, so the prompt is omitted.
const displayKind = projection.inflight?.display_kind
-
const typed = displayKind
? toChatMessages([
{