[pull] main from Alishahryar1:main - #183
Merged
Merged
Conversation
## Problem Responses ingress was detouring through Anthropic Messages before reaching OpenAI-compatible upstreams. That duplicated translation work, obscured protocol ownership, and prevented a provider such as OpenCode from selecting Chat Completions or Responses directly for the requested model. ## Changes | Before | After | | --- | --- | | Responses was translated through Messages and then translated again for the selected upstream. | Messages and Responses remain distinct ingress protocols and route directly to Chat Completions or Responses. | | Provider execution exposed one Messages-shaped path. | The provider port exposes the full two-input by two-output matrix behind one shared candidate, retry, fallback, deadline, and cancellation loop. | | Native Responses events were reconstructed through an Anthropic lifecycle. | Native Responses requests and events preserve upstream identity and usage while FCC rewrites only its public model metadata. | | Live Responses-ingress validation covered only the four OpenCode routing cells. | Live Responses-ingress validation covers NVIDIA NIM, OpenRouter free, Groq, Gemini Flash Lite, Mistral, and OpenCode Zen; the Groq smoke default tracks a current catalog model. | Adds direct Responses-to-Chat request/output translation, native Responses relay and presentation, catalog-driven four-way OpenCode routing, shared provider retry ownership, and deterministic matrix/lifecycle contracts. Removes the obsolete Responses-to-Anthropic detour and bumps the package to 5.14.9. <!-- greptile_comment --> <details open><summary><h3>Greptile Summary</h3></summary> This change adds direct routing for Messages and Responses requests across Chat Completions and Responses upstream transports, while preserving native Responses streaming lifecycle events and public model identity. Structured Responses input and tool token estimation now stops traversal at the configured character bound. </details> <h3>Confidence Score: 5/5</h3> No blocking failure remains. Focused transport, lifecycle, model-identity, retry, truncation, and bounded-serialization checks completed successfully. <details><summary><h3><a href="https://www.greptile.com/trex"><img alt="T-Rex" src="https://greptile-static-assets.s3.amazonaws.com/trex/trex_green.svg" height="20" align="absmiddle"></a> T-Rex Logs</h3></summary> **What T-Rex did** - Executed the JSON cap validation script with oversized nested inputs and the json.dumps guard, confirmed the estimator completed within the cap and that the largest dumped string stayed under the limit, while token-estimation tests passed. - Ran native Responses core and transport contract suites, then exercised the two-ingress by two-upstream protocol matrix, and finished with the consolidated focused contract suite where all tests passed. - Validated that the unsafe whole-container serialization condition was detected before dump attempts, and verified the estimator respected the token and size caps via code-paths that bound and slice inputs before serialization. - Captured the end-to-end contract run, showing the native-core and Responses-transport tests followed by the protocol-matrix tests and the focused test run, with all required tests passing and a verbose artifact available for review. <a href="https://app.greptile.com/trex/runs/20856046/artifacts"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewAllArtifactsDark.svg?v=4"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewAllArtifacts.svg?v=4"><img alt="View all artifacts" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewAllArtifacts.svg?v=4"></picture></a> <sub><a href="https://www.greptile.com/trex"><img alt="T-Rex" src="https://greptile-static-assets.s3.amazonaws.com/trex/trex_green.svg" height="14" align="absmiddle"></a> Ran code and verified through T-Rex</sub> </details> <sub>Reviews (4): Last reviewed commit: ["test: refresh Groq smoke model"](beba33e) | [Re-trigger Greptile](https://app.greptile.com/api/retrigger?id=57000900)</sub> <!-- /greptile_comment -->
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )