Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

ai-harness: recovery runs a turn without the user message when the turn never started

オープン
#1,795 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@tombeckenham がすでに取り組んでいます。

2026年10月15日 から。

評価

この issue はまだ評価されていません。

説明

waiting-on: maintainer
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:

  1. Open a durable host whose runs.createOrResume never returns, so the turn never starts.
  2. Send prompt('First.') and wait for the receipt.
  3. Stop the host's claim renewal, and wait until the claim expires.
  4. Open the thread on a second host. It recovers the input and calls the model.
  5. 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.
主要言語
TypeScript
スター
3.2k
フォーク
365
平均マージ
1日 8時間
マージ済み PR(30日)
261

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/ai のほかの issue

TanStack/ai の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。