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
ui-sdk: the inference relay omits firstChunkMs on a first-chunk budget refusal and observes usage with no operation #4438
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-sdkWire protocol, runtime schemas, the server and client SDK surfaces.priority: p3Someday. Needs a driving use case before it starts.type: fixSomething is broken and must behave the way it is documented.
Part of #4426 (follow-ups from #4278). Found in the review of PR #4435, which merged main's metered relay reader into the epic's relay clocks.
Context
readRelayResponse.read() charges the chunk and throws on refusal (packages/ui-sdk/src/server/relay-response.ts:39-45). The mark at packages/ui-sdk/src/server/inference-relay.ts:256 therefore never runs for a first read that resolved but was refused. docs/integration-contract/http.md:635 defines firstChunkMs as "first upstream read resolved, including EOF".
The usage observer at inference-relay.ts:249 is created even when there is no egress operation, and its result is discarded.
Scope
The relay's first-read mark and the observer guard. No field or shape change.
Acceptance criteria
A first chunk that exceeds the remaining budget records the budget refusal and firstChunkMs.
An upstream read that rejects still leaves firstChunkMs absent, and the mark is attempted once.
A relay without an egress operation creates no usage observer and schedules no parsing.
Each test is shown failing with its guard removed.
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-sdkWire protocol, runtime schemas, the server and client SDK surfaces.priority: p3Someday. Needs a driving use case before it starts.type: fixSomething is broken and must behave the way it is documented.
Activity