You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UseGenerationReturn discards TInput: generate is typed (input: Record<string, any>) #1003
Found while reviewing the @tanstack/ai-octane port (#1000). Fixed there; filing so the other adapters can catch up.
Problem
useGeneration takes a TInput extends Record<string, any> type parameter, and its internal generate really is (input: TInput) => Promise<void>. But the exported return type throws that away:
In ai-octane this needed no other changes — the media hooks (useGenerateImage/Audio/Speech/Video) declare their own return types and don't reference UseGenerationReturn.
Caveat
This changes the arity of an exported type, so it's breaking for anyone who writes UseGenerationReturn<T> explicitly. Worth batching into a release that's already taking a version bump. ai-octane could absorb it freely (unpublished at 0.0.0), which is why it diverges today — see packages/ai-octane/status.json.
Test
packages/ai-octane/typetests/use-generation.test-d.ts locks this in with @ts-expect-error cases for each of the three bad calls above; verified to fail if the widening is reintroduced.
Looks like this was fixed on main in #1011 (996a9802b).
UseGenerationReturn is now <TOutput, TInput = Record<string, any>>, with generate: (input: TInput) => Promise<void> in @tanstack/ai-react, ai-vue, and ai-solid (with the same fix threaded through svelte/angular in #1011). The Record<string, any> cast is gone.
#1000 fixed the same issue independently in @tanstack/ai-octane, but main uses <TOutput, TInput> to preserve compatibility with existing UseGenerationReturn<MyOutput> call sites.
So the “STILL PRESENT UPSTREAM” note in #1000’s status.json is now stale as well.
This is fixed on main by #1011. UseGenerationReturn is now <TOutput, TInput> and generate is typed (input: TInput) => Promise<void> in ai-react, ai-vue, ai-solid (and Svelte and Angular). Closing.
Activity
fix(ai-octane): fix three defects inherited from the React adapter
harshlocham commentedon Aug 11, 2026
Looks like this was fixed on
mainin #1011 (996a9802b).UseGenerationReturnis now<TOutput, TInput = Record<string, any>>, withgenerate: (input: TInput) => Promise<void>in@tanstack/ai-react,ai-vue, andai-solid(with the same fix threaded through svelte/angular in #1011). TheRecord<string, any>cast is gone.#1000 fixed the same issue independently in
@tanstack/ai-octane, butmainuses<TOutput, TInput>to preserve compatibility with existingUseGenerationReturn<MyOutput>call sites.So the “STILL PRESENT UPSTREAM” note in #1000’s
status.jsonis now stale as well.fix(ai-octane): fix three defects inherited from the React adapter
fix(ai-octane): fix three defects inherited from the React adapter
fix(ai-octane): fix three defects inherited from the React adapter
fix(ai-octane): fix three defects inherited from the React adapter
fix(ai-octane): fix three defects inherited from the React adapter
fix(ai-octane): fix three defects inherited from the React adapter
feat(ai-octane): port Octane bindings from @octanejs/tanstack-ai (#1000)
AlemTuzlak commentedon Sep 25, 2026
This is fixed on
mainby #1011.UseGenerationReturnis now<TOutput, TInput>andgenerateis typed(input: TInput) => Promise<void>inai-react,ai-vue,ai-solid(and Svelte and Angular). Closing.