summaryrefslogtreecommitdiffhomepage
path: root/packages/openai-stream/src/stream.ts
AgeCommit message (Collapse)Author
5 daysstyle: switch from tabs to 2-space indentationAdam Malczewski
10 daysfix(openai-stream): omit usage attrs from spans when provider doesn't reportAdam Malczewski
When a provider doesn't include a usage field in the SSE stream, the span attributes (usage.inputTokens, usage.outputTokens) are now absent instead of defaulting to 0. This makes it clear in the journal that the provider didn't report usage, rather than looking like 0 tokens were used.
10 daysfix(openai-stream): add stream_options.include_usage to all requestsAdam Malczewski
Without stream_options.include_usage, OpenAI-compatible providers omit the usage field from the SSE stream entirely. Umans returned 0 tokens for everything; OpenCode's proxy happened to include usage without it. Now both providers return proper prompt_tokens + completion_tokens. Note: Umans does not report cache_read_tokens or prompt_tokens_details.cached_tokens — cache hit rate will be 0% for Umans regardless. This is a provider limitation, not a parsing issue.
11 daysfeat(provider-umans): Umans AI Coding Plan provider + openai-stream libAdam Malczewski
Extract a generic @dispatch/openai-stream library from provider-openai-compat (convert-messages, convert-tools, parse-sse, listModels, stream, provider), parameterizing createOpenAICompatProvider with uid=1000(tradam) gid=1000(tradam) groups=1000(tradam),966(docker),968(ollama),998(wheel) + hook. Refactor provider-openai-compat to import from the lib (byte-identical behavior). New @dispatch/provider-umans extension wraps the Umans OpenAI-compatible backend (https://api.code.umans.ai/v1). Self-contained: reads UMANS_API_KEY from env directly (no auth-apikey dep). transformBody maps reasoningEffort → reasoning_effort (capping xhigh/max → high). Dynamic listModels via GET /v1/models. host-bin: registered provider-umans in CORE_EXTENSIONS + umans credential (gated on UMANS_API_KEY — the credential is the model-catalog index). Verified: tsc EXIT 0, 1059 vitest, biome clean (293 files). Boot smoke: umans models appear in GET /models (7 models live).