Repository navigation
refactor(translate): expose prepared translation trips - #709
Merged
Merged
Conversation
Replace fluent protocol subpaths with named root translators returning plain trips or input failures. Keep request builders and event adapters intact while containing expected input exceptions at public operations. Consume translation failures at gateway attempt and payload boundaries, and encode rewritten JSON errors at the transport boundary. Preserve the current model context and remote-image loader requirements for the pairwise request backend. Validate named translation and gateway suites, owning TypeScript projects, and changed lint targets.
Preserve the param and code supplied by raw translation input failures in Messages and GenerateContent error envelopes. Omit absent details and keep the rejecting candidate performance context intact. Keep protocol error results precise and validate both detail envelopes, the named translation boundary suites, and gateway TypeScript checks.
Port the reviewed capture, error telemetry, and Responses attempt explanations to their public-boundary owners. Remove redundant dispatcher and assertion narration and update the dashboard capture reference.
Keep the reviewed Struct Any explanation beside the public-boundary field-preservation matrix.
2 tasks done
Move Responses canonicalization and Gemini Part classification into their protocol modules. Protocol errors are ordinary native data, adapted at translation entrypoints. Share HTTP/RPC status facts while preserving gateway status policy.
Keep expected token-counting input failures as gateway API errors so final response rendering records the selected candidate's zero-output error. Preserve fallback across candidates and verify final failure attribution and successful fallback through real HTTP requests and performance records.
…blic-boundary # Conflicts: # packages/translate/__tests__/protocols/openai-chat-completions/as-source/continuous-usage_test.ts # packages/translate/__tests__/protocols/round-trip-receive_test.ts # packages/translate/__tests__/protocols/routes_test.ts # packages/translate/src/protocols/openai-chat-completions/via-openai-responses/content.ts # packages/translate/src/protocols/openai-responses/via-anthropic-messages/request.ts # packages/translate/src/protocols/openai-responses/via-openai-chat-completions/content.ts
Menci
marked this pull request as ready for review
November 12, 2026 11:43
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.
Expose named route functions and ordinary
TranslateTrip | TranslateInputErroroutcomes. Trips providetarget,eventsanderror; gateway callers consume input errors locally and encode translated JSON error bodies at the transport boundary.Translation input failures advance to the next candidate, allowing a different model's target protocol or middleware to serve the request. Terminal Gemini token-counting input failures retain their API-error result and performance attribution through response rendering, so the final failure is recorded once.
Request builders, native event adapters and replay behavior retain main semantics. Existing model and loader inputs remain until #673 replaces the request backend.
Protocol-native Responses request canonicalization and Gemini Part/status facts live in
@floway-dev/protocols. Native HTTP/WS callers consume that boundary directly; translation entrypoints adapt protocol input failures to ordinary input-error results. Existing gateway status policies are preserved.Validation: the prior 31 named files (690 tests), translate/gateway TypeScript projects and scoped lint; the telemetry repair additionally passed five named gateway suites (51 tests), gateway TypeScript and three-file lint. HTTP regressions verify one final failure record with the last candidate's attribution and successful fallback without an intermediate failure record.