Discriminate status-dependent record and option types (RunRecord, SessionIndexEntry, InputState, durable-only options)
Los mantenedores suelen responder en 1 día
@jherr ya está trabajando en esto.
Desde el 16/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.2k
- Forks
- 365
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 242
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 3 días. 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 3 días. 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 3 días. Abiertohas-pr waiting-on: maintainer
TanStack/ai#1802 · 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 4 días. Abiertowaiting-on: maintainer
TanStack/ai#1797 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
ai-harness: a forwarded command completes with no result, also when the owner rejects itPosiblemente ocupada @tombeckenham la tomó hace 4 días. Abiertowaiting-on: maintainer
TanStack/ai#1796 · 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 76/100
radix-ui/primitives#4228 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
SignalK/freeboard-sk#1093 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
[测试] 等待仓库加载后再记录多仓库排序基线Posiblemente ocupada @myot233 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día