Skip to content

Managed stream completion doesn't report the served provider or model #133

Closed

Description

@stackbilt-admin

Problem

generateManagedResponseStream doesn't report which provider and model served the stream. StreamCompletion has only outcome, emittedChars, and usage, and TokenUsage has no model field. Non-streaming generateResponse does return provider and model.

Why it matters

An application that enforces a per-task model allowlist can check every non-streaming response, but can't check a streamed one. With fallbackRules: [] and only one provider configured, routing to another provider shouldn't happen, but the application can't confirm that, and telemetry can't record the served model for streams. It also can't tell which model to bill a partial stream against without assuming the requested one.

Reproduction

@stackbilt/[email protected]:

const { stream, completion } = await llm.generateManagedResponseStream({ model, messages, maxTokens: 100 });
for await (const _ of stream) { /* read */ }
const done = await completion;
// Keys on done: outcome, emittedChars, usage. No provider or model.

Confirmed from dist/types.d.ts (StreamCompletion, TokenUsage).

Expected

Add provider and model to StreamCompletion, set to what actually served the request, so streams can be checked the same way as other responses.

Relationship to existing issues

Related to #128 (a pinned model fails over with no marker) and to the accounting work in #110. Filed separately because it's a small API addition.

Scope

Read from the published types and used in a live evaluation. Our application records this as a limit and allowlists streaming only with one provider and no fallback.

Activity

  1. added a commit that references this issue on Nov 6, 2026
    0a2dae1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions