fix(typescript): cancel and bound background streams - #689
mikemikimike wants to merge 1 commit into
Conversation
|
@claude review the change |
|
Claude finished @brnaba-aws's task in 3m 15s —— View job Claude finished reviewing this PRTodo list:
SummaryOverall this is a well-structured fix for #662. The cancellation wiring in Bug: reasoning/"thinking" stream chunks are now silently dropped
const text = this.extractFromChunk(chunk);
if (typeof text === "string" && text.length > 0) {
...
this.push(text);
}
callback();Previously this was } else if (chunk.thinking) {
return chunk; // returns the whole object, not a string
}
const thinking = { thinking: true, content: chunk.contentBlockDelta.delta.reasoningContent.text };
yield thinking;Under the old truthy check, this object chunk was still forwarded to the consumer via This looks like an unintended side effect of tightening the guard to satisfy Suggested fix: give Minor observations (not blocking)
Validation noteI wasn't able to run the TypeScript build/tests/lint myself — network access (npm install / git fetch) is blocked in this sandboxed environment. The review above is based on a full manual read of the single-commit diff ( |
Fixes #662
Closes #662
Resolves #662
This change cancels background stream consumption when the returned output closes and applies bounds to stream chunks, stream bytes, and accumulated response text. It also adds regression coverage for cancellation, completion, limits, and provider errors.
Issue: #662
Validation: