Discriminate status-dependent record and option types (RunRecord, SessionIndexEntry, InputState, durable-only options)
メンテナーはふだん 1 日以内に返信
@jherr がすでに取り組んでいます。
2026年10月16日 から。
評価
この issue はまだ評価されていません。
説明
TanStack AI version
feat/harness-core branch (PR #1755), unreleased @tanstack/ai-harness, @tanstack/ai-persistence, @tanstack/ai.
Framework/Library version
Not framework specific.
Describe the change
Several record types are optional bags whose fields depend on a status or kind field. The code checks the combination at runtime, or papers over it with a fallback. Each one is a candidate for a discriminated union, so the type says what the runtime already enforces.
PR #1755 did this for Receipt, InputSettlement, MediaRecord, and AgentRun in @tanstack/ai-harness. These are deferred because each needs a wider change than one package's types:
Records keyed by status
RunRecord(packages/ai/src/activities/chat/middleware/run-store.ts):parentRunId,subagentRunId, andnameare all-or-none for a child run.finishedAtanderrordepend onstatus.SessionIndexEntry(packages/ai-persistence/src/types.ts):parentThreadIdandparentToolCallIdgo together.InputState(packages/ai-harness/src/log.ts):appliedneedsoperationId,joinedneedsinto,rejectedneedsreason,settledneedssettlement. Two sites fill the hole with?? '', and one of them can pass an empty operation id when it fails a stopped agent (session/harness-session.ts,failStoppedAgent).QueuedTurn(packages/ai-harness/src/session/types.ts): a kind bag of prompt, resolve, reset, continue, and wake.
Options that only mean something on a durable host
HarnessHostOptions.project,reduce, andcoalesceMsare read only whenstores.logis set. Keying the options on the persistence shape needs the twoHarnessPersistencearms exported under names.AgentStartOptions.resume,TurnAdditions.records, andOpenSessionOptions.logIdneedstores.log. The first two throw a clear error without it.logIdis ignored in silence. A type fix means aTDurableparameter fromcreateHarnessHostthrough to the session type.
Not worth a union
HarnessConfig.adapter: a plugin or stored model name can supply the model at runtime, so theNO_MODELruntime check stays.HarnessConfig.routingwith no root agents: a one-time warning fits better than a type.
Suggested order
InputState, because it hides a real bug.RunRecordandSessionIndexEntry, because every store implementation sees them.HarnessHostOptions, once the persistence arms have names.- The durable-only options, if the
TDurableplumbing turns out to be small.
- 主要言語
- TypeScript
- スター
- 3.2k
- フォーク
- 365
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 261
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/ai のほかの issue
-
withPersistence does not save activity rows when a run is stopped or fails対応中かも @tombeckenham が 1 日前に担当しました。 オープンwaiting-on: maintainer
メンテナーはふだん 1 日以内に返信
-
Activity events that a chat middleware emits are streamed but never recorded or persisted対応中かも @AlemTuzlak が 1 日前に担当しました。 オープンwaiting-on: maintainer
メンテナーはふだん 1 日以内に返信
-
withPersistence stores the durability batch hint on a stopped or failed assistant message対応中かも @tombeckenham が 1 日前に担当しました。 オープンhas-pr waiting-on: maintainer
メンテナーはふだん 1 日以内に返信
-
Activity events that a chat middleware emits are streamed but never recorded or persisted対応中かも @AlemTuzlak が 1 日前に担当しました。 オープンwaiting-on: maintainer
メンテナーはふだん 1 日以内に返信
-
withPersistence stores the durability batch hint on a stopped or failed assistant message対応中かも @tombeckenham が 1 日前に担当しました。 オープンwaiting-on: maintainer
メンテナーはふだん 1 日以内に返信
似ている issue
-
backend priority:P3 privacy-fix
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug desktop v3 windows
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
esengine/DeepSeek-Reasonix#13697 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:security documentation effort:S priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
app:web meta:ops
難易度 2/5 半日 初心者へのやさしさ 78/100
osu-tournament-rating/otr#1113 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100