test: make stream capture tests reach their bounds and correct docs - #35
Conversation
The five OpenAI chat recovery tests relied on maxAttributeLength, which no longer shrinks the fixed 48 KiB retention budget, so their reject and refund paths never ran. Prefill content up to the budget instead. The Anthropic fallback-tail fixture now rejects slices, so a full iterations[::-1] scan fails.
Retention uses the fixed bounds with any core; only the mask is assumed. TypeScript transcription counts serialized UTF-16 length, and Python Responses capture uses the core default of 1,024 items.
aikins01
left a comment
There was a problem hiding this comment.
Thanks, the recovery tests now hit the real 48 KiB budget, and they fail when the separator, string, or field refund is removed, which the old versions didn't catch. The Anthropic fixture now catches a slice-based full scan too.
One sibling spot still needs the same correction: the root README (lines 119–120) gives one set of bounds for both SDKs. Python Responses uses 48 KiB and 1,024 items while TypeScript uses 1,000, and TypeScript transcription counts 65,536 UTF-16 units of serialized JSON while Python keeps 64 KiB of UTF-8. Could you split those there to match the package READMEs?
|
Good catch, fixed in bb4875d. The root README now splits Responses and transcription by language. Chat and Anthropic stay as one line since both SDKs use 48 KiB and 1,000 there. |
aikins01
left a comment
There was a problem hiding this comment.
thanks for the quick fix, the README now matches both SDKs
Closes #31
Tests
maxAttributeLength. Each one now prefills content to the real 48 KiB budget, so the 256-char value actually gets rejected and recovery happens right at the boundary. I checked each test by breaking the mechanism it's named for (separator refund, role field refund, recoverable id capture, id release, shell reserved once). The old tests passed all five breakages; the new ones fail each.iterations[::-1]scan fails.Docs
packages/sdk/README.md: an older core keeps the same fixed retention bounds, and only the mask is assumed. I also fixed the matchingLEGACY_CAPTURE_POLICYcomment in openai and anthropic.maxAttributeLengthstays because the policy type requires it.