ai-harness: recovery runs a turn without the user message when the turn never started
I maintainer di solito rispondono entro 1 giorno
@tombeckenham ci sta già lavorando.
Dal 15/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 3.2k
- Fork
- 361
- Merge medio
- 1g 8h
- PR unite (30g)
- 261
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TanStack/ai
-
withPersistence does not save activity rows when a run is stopped or failsForse già presa @tombeckenham l’ha presa oggi. Apertawaiting-on: maintainer
TanStack/ai#1804 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Activity events that a chat middleware emits are streamed but never recorded or persistedForse già presa @AlemTuzlak l’ha presa oggi. Apertawaiting-on: maintainer
TanStack/ai#1803 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
withPersistence stores the durability batch hint on a stopped or failed assistant messageForse già presa @tombeckenham l’ha presa oggi. Apertahas-pr waiting-on: maintainer
TanStack/ai#1802 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Activity events that a chat middleware emits are streamed but never recorded or persistedForse già presa @AlemTuzlak l’ha presa oggi. Apertawaiting-on: maintainer
TanStack/ai#1801 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
withPersistence stores the durability batch hint on a stopped or failed assistant messageForse già presa @tombeckenham l’ha presa oggi. Apertawaiting-on: maintainer
TanStack/ai#1800 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
bug engine
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
frostney/GocciaScript#1746 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
agilepathway/label-checker#739 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
CopilotKit/OpenBot#800 ·
I maintainer di solito rispondono entro 1 giorno
-
Endpoint links in the tag operations list are below the 24px target sizeForse già presa @AdzerKI l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
ehmpathy/rhachet-roles-bhuild#471 ·
I maintainer di solito rispondono entro 1 giorno