fix: retain fitting OpenAI read baselines - #14
Merged
Conversation
Author
|
Merge gate: exact production transcript replay retained the 61,900-byte latest read at 107,045 estimated total tokens; focused tests 33/33, typecheck, repository verify, static/security checks, mechanical tier, LLM skill tier, JSONB parity, and specialized slow tests passed. Shard 7/9/10 failures exactly reproduce on the prior head and are unrelated database/extraction failures. Serial failed on an unrelated temporary Git index.lock race. Proceeding under the explicitly authorized ingestion repair/deploy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Keep the newest successful singleton read exact when the complete OpenAI provider request is proven to fit its token window.
Why
The Unicode-safe byte fallback projected a 61.9 KB canonical page even though the full Terra request used only about 64k message tokens. That prevented staged ingestion proposals from preserving required update baselines.
Changes
Testing
bun test test/ai/gateway-tool-loop-openai-budget.test.ts test/ai/tool-loop-context-exact-results.test.ts test/ai/gateway-tool-loop.test.tsbun run typecheck