ai-harness: recovery runs a turn without the user message when the turn never started
Los mantenedores suelen responder en 1 día
@tombeckenham ya está trabajando en esto.
Desde el 15/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
TanStack AI version
@tanstack/ai-harness on the feat/harness-core branch (not released yet).
Framework/Library version
Node 24.8.0. No UI framework: the bug is in the durable host.
Describe the bug and the steps to reproduce it
A durable host (stores.log) stores a prompt in the log, then stops before the turn starts (before it writes its run lease). The next host that opens the thread recovers the input and runs the turn. But the transcript has no user message for that input, so the model gets an empty message list.
Expected: the transcript is ['First.', 'One.']. Actual: ['One.'], and the model call has no messages.
Steps:
- Open a durable host whose
runs.createOrResumenever returns, so the turn never starts. - Send
prompt('First.')and wait for the receipt. - Stop the host's claim renewal, and wait until the claim expires.
- Open the thread on a second host. It recovers the input and calls the model.
- Read
transcript()on the second host.
Found during the review of #1780. That PR is not the cause: the same test fails on feat/harness-core before #1780.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
A test in packages/ai-harness/tests/:
import { expect, it, vi } from 'vitest'
import { memoryLogStore, memoryPersistence } from '@tanstack/ai-persistence'
import { createHarnessHost, defineHarness } from '../src'
import { mockAdapter, text } from './helpers'
it('recovery keeps the user message of a turn that never started', async () => {
const { runs, metadata, workClaims } = memoryPersistence().stores
const persistence = {
stores: { log: memoryLogStore(), runs, metadata, workClaims },
}
const { adapter, calls } = mockAdapter([() => text('One.')])
const harness = defineHarness({ name: 'probe', adapter })
const owner = await createHarnessHost({
lease: { ttlMs: 200, renewMs: 50 },
persistence: {
stores: {
...persistence.stores,
runs: Object.assign(Object.create(runs), {
createOrResume: () => new Promise(() => {}),
}),
},
},
}).open(harness, { threadId: 't1' })
await owner.prompt('First.').receipt
;(owner as unknown as { stopClaimTimer: () => void }).stopClaimTimer()
await new Promise((resolve) => setTimeout(resolve, 300))
const next = await createHarnessHost({ persistence }).open(harness, {
threadId: 't1',
})
await vi.waitFor(() => expect(calls).toHaveLength(1), { timeout: 3_000 })
await new Promise((resolve) => setTimeout(resolve, 200))
expect((await next.transcript()).map((message) => message.content)).toEqual([
'First.',
'One.',
])
})
Do you intend to try to help solve this bug with your own PR?
Maybe, I'll investigate and start debugging
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.2k
- Forks
- 365
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 249
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/ai
-
withPersistence does not save activity rows when a run is stopped or failsPosiblemente ocupada @tombeckenham la tomó hace 1 día. Abiertowaiting-on: maintainer
TanStack/ai#1804 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Activity events that a chat middleware emits are streamed but never recorded or persistedPosiblemente ocupada @AlemTuzlak la tomó hace 1 día. Abiertowaiting-on: maintainer
TanStack/ai#1803 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
withPersistence stores the durability batch hint on a stopped or failed assistant messagePosiblemente ocupada @tombeckenham la tomó hace 1 día. Abiertohas-pr waiting-on: maintainer
TanStack/ai#1802 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Discriminate status-dependent record and option types (RunRecord, SessionIndexEntry, InputState, durable-only options)Posiblemente ocupada @jherr la tomó hace 2 días. Abiertoenhancement waiting-on: maintainer
TanStack/ai#1799 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
ai-harness: an input with no principal runs with the owner session's principalPosiblemente ocupada @tombeckenham la tomó hace 2 días. Abiertowaiting-on: maintainer
TanStack/ai#1797 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/ai
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
auth: agent-bearer --manager-call is told to use the MCP instance argument on an ambiguous managerAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
Lyric and ApostrophesAbiertobug module: playback
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chthollyphile/folia-major#739 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agilepathway/label-checker#773 · 2 comentarios ·
Los mantenedores suelen responder en 1 día