Discriminate status-dependent record and option types (RunRecord, SessionIndexEntry, InputState, durable-only options)
I maintainer di solito rispondono entro 1 giorno
@jherr ci sta già lavorando.
Dal 16/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 3.2k
- Fork
- 365
- Merge medio
- 1g 9h
- PR unite (30g)
- 249
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 2 giorni fa. 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 2 giorni fa. 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 2 giorni fa. Apertahas-pr waiting-on: maintainer
TanStack/ai#1802 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
ai-harness: an input with no principal runs with the owner session's principalForse già presa @tombeckenham l’ha presa 3 giorni fa. Apertawaiting-on: maintainer
TanStack/ai#1797 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
ai-harness: a forwarded command completes with no result, also when the owner rejects itForse già presa @tombeckenham l’ha presa 3 giorni fa. Apertawaiting-on: maintainer
TanStack/ai#1796 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
paperclipai/paperclip#16785 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
code-yeongyu/senpi#3661 ·
I maintainer di solito rispondono entro 1 giorno
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
lingdojo/kana-dojo#32731 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
mastra-ai/mastra#27538 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Yeachan-Heo/oh-my-codex#3822 ·
I maintainer di solito rispondono entro 1 giorno