Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
✅ Deterministic PR hygiene checks passed. |
Preserve the existing direct-encoder fix and cover four generic error codes across streaming and folded responses. Verified tree matches local commit 25f1104c7631e713199de631505c1dba01ff49d3.
Merged
6 of 7 tasks
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.
Transferred upstream
The completed fix and regression coverage continue in lidge-jun/opencodex#8148, targeting
dev, from this same branch atf13774704a72178e687f9304097002f2d10f3868. The upstream PR is ready for review and contains the current validation results and resolved source-review findings. This fork-local PR is closed as transferred; the branch remains the upstream PR's source.Motivation
anthropicFailedStatus()returns 400 for generic-coded overflow errors, but the direct Anthropic Messages encoder did not synthesize thecontext_length_exceededcode or the "prompt is too long" wording, causing direct-stream clients to receive a fatal unrecoverable error instead of a compaction-triggering response.Description
isContextOverflowError()insrc/protocols/encoders/messages.tsto detect broadened generic-coded overflow assertions.isContextOverflowError()is true, the direct encoder now synthesizes thecontext_length_exceededcode (unless the original error is the deterministic undeclared-tool code) soanthropicErrorBody()produces the "prompt is too long" wording.tests/responses/protocol-direct-encoders-messages.test.tsthat feeds a genericserver_erroroverflow and asserts parity between the direct encoder and the legacy bridge/converter for both streamed frames and folded (non-stream) responses.Testing
bun test tests/responses/protocol-direct-encoders-messages.test.tsand observed52 pass, 0 failconfirming the new regression case and existing parity tests passed.bun run typecheck(viabun check --no-script --noEmit) with no type errors reported across the tree.git diff --checkwith no issues found, and attemptedbun run test:changedwhich could not run due to this checkout lacking adevcomparison ref (no upstream/dev present).Codex Task