You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(sse): route AgentRouter GPT models through Responses - #18560
Route the confirmed AgentRouter Responses-only models gpt-6-astra, gpt-6.1-sol, and gpt-5.6-sol through /v1/responses when a connection has no explicit protocol selection.
Preserve explicit Chat, Claude, Responses, custom-model, registry, and passthrough precedence.
Translate Responses output back to valid buffered and streaming Chat Completions output for Chat clients and dashboard probes.
npm run check:test-tla-order currently fails on the unchanged upstream file tests/unit/perplexity-research-tool.test.ts (test line 56, top-level await line 198, later test line 230). Running the same gate logic against base tip 689b1eb573 reproduces the failure and confirms the file is not allowlisted. This PR does not modify that file.
TDD evidence:
New resolver/handler regressions failed before the production fix because requests selected Chat and reproduced AgentRouter's endpoint HTTP 400.
Reverting only the production routing hunk made the real dashboard-runner regression fail against /v1/chat/completions; restoring it passed.
Independent SSE error, response.failed, and completed-empty fixtures reject false-positive health results.
Live acceptance used an isolated local OmniRoute data directory with the credential supplied only through the environment. Buffered Chat, streaming Chat, native Responses, and dashboard model tests completed for all three affected IDs. Diagnostics selected openai-responses; one Astra dashboard timeout and one empty gpt-5.6-sol response were treated as failures and passed one bounded retry.
The dashboard integration test exercises the real database, connection selection, route, handler, resolver, execution credentials, and stream reader while mocking only external AgentRouter HTTP.
Full unit/Vitest, coverage ratchet, and production build remain CI checks per the contribution guide.
Reviewer Notes
Automatic routing is intentionally an exact-ID set; no GPT-family or suffix matching was added.
No catalog targetFormat was added because it would override explicit connection choices.
No credentials or environment files are included in the diff.
Fresh-context review found one failure-fixture isolation gap; it was fixed by splitting SSE error, response.failed, and empty-output cases.
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
New Features
AgentRouter now uses the OpenAI Responses format by default for gpt-6-astra, gpt-6.1-sol, and gpt-5.6-sol.
Chat requests to these models continue to return Chat-compatible responses, including streaming responses.
Explicit connection format settings are preserved, and other models retain their existing format behavior.
AgentRouter now defaults three named models to the Responses endpoint when no explicit target format is set. The changes add tests for target-format selection, Chat-shaped output, and dashboard probe results.
The resolver defaults gpt-6-astra, gpt-6.1-sol, and gpt-5.6-sol to OpenAI Responses when no explicit target format is set. Tests cover explicit overrides and other models and providers. The changelog records the default and preservation of explicit settings.
Chat requests and Responses conversion tests/unit/agentrouter-chatcore-protocols.test.ts
Existing Chat cases now set OpenAI Chat explicitly. New streaming and non-streaming cases verify Responses endpoint requests and Chat-shaped output.
Dashboard model probe validation tests/unit/agentrouter-model-test-responses-17997.test.ts
Tests cover successful Responses output, SSE errors, failed streams, and completed streams with empty output.
The three models retain the intended default routing, and no actionable issue remains before normal merge checks.
Security architecture risk: Low · up to fda59
The change is narrowly scoped and preserves explicit settings and existing credentials. Ordinary translated requests disable remote response storage. Retention and recovery behavior remain unverified when storage is explicitly enabled.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The routing delta affects requests resolving to the three exact AgentRouter model identifiers without a higher-priority format selection. It changes which existing provider endpoint receives those requests, but does not supply another account key or establish additional tenant, infrastructure, or service authority.
Trust Boundaries and Controls
observed — Protocol metadata is copied into execution credentials for the current request rather than persisted to the connection. The added Chat regressions assert use of the supplied bearer key, absence of Claude-specific authentication headers, and unchanged original credentials.
Resilience and Maintainability Implications
inferred — Default stateless translation limits the remote-state transition introduced by automatic routing. When connection storage is enabled, however, store is omitted and continuation identifiers may survive. Repository evidence does not establish the external service's resulting retention, ownership, idempotency, or recovery guarantees; no remote-state creation or cleanup failure is verified.
Pre-merge checks: 5 · 1 · 1
Failed checks: 1 warning · 1 inconclusive
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
No Ai Attribution
All seven reviewed commit messages have no Co-Authored-By trailers or Generated with footer. The supplied PR body is explicitly truncated, so the complete body cannot be checked for the prohibited att…
Provide the complete PR body, or confirm that it contains neither an AI/bot Co-Authored-By trailer nor a Generated with footer.
Passed checks: 5 passed
Check name
Status
Explanation
Title check
The title "fix(sse): route AgentRouter GPT models through Responses" follows the Conventional Commits format with a valid type (fix) and scope (sse). It describes the main change: the three AgentRoute…
Description check
The description follows the repository template in part. It has a Summary, Related Issues (Closes #17997, Related to #17219), a Target Branch checklist, and a Validation section that lists the command…
Linked Issues check
The PR satisfies the coding requirements in #17997. resolveChatCoreTargetFormat selects OPENAI_RESPONSES for the exact models gpt-6-astra, gpt-6.1-sol, and gpt-5.6-sol when no explicit conne…
Out of Scope Changes check
The changed resolver, ChatCore protocol tests, dashboard probe test, and changelog entry directly support #17997. The changes preserve existing protocol precedence and test the required regression beh…
Tests For Production Code
The PR changes production code in open-sse/handlers/chatCore/targetFormat.ts. It also adds or updates three relevant unit-test files: tests/unit/chatcore-target-format.test.ts, `tests/unit/agentro…
Full details: Title check
Explanation
The title "fix(sse): route AgentRouter GPT models through Responses" follows the Conventional Commits format with a valid type (fix) and scope (sse). It describes the main change: the three AgentRouter GPT model IDs now route through the Responses endpoint. The diff touches the chat core target-format resolver (open-sse/handlers/chatCore/targetFormat.ts), so the scope 'sse' is a loose fit, but the title is still related to the main change.
Full details: Description check
Explanation
The description follows the repository template in part. It has a Summary, Related Issues (Closes #17997, Related to #17219), a Target Branch checklist, and a Validation section that lists the commands run and the test files changed. It lacks a Coverage Notes section that explains coverage for the touched src/ and open-sse/ code, though the Reviewer Notes section and the 'Coverage Notes' bullets in the description partly cover this. The Tests Added Or Updated section lists the changed test files, and the description states that focused test runs passed (36 passed). Required content is mostly complete, so the check passes.
Full details: Linked Issues check
Explanation
The PR satisfies the coding requirements in #17997. resolveChatCoreTargetFormat selects OPENAI_RESPONSES for the exact models gpt-6-astra, gpt-6.1-sol, and gpt-5.6-sol when no explicit connection format exists. Explicit connection and custom-model formats retain precedence. The resolver and ChatCore tests cover all three model IDs. The dashboard probe test verifies a Responses request and Chat-shaped probe success, with failure cases for SSE errors, failed Responses, and empty output.
Full details: Out of Scope Changes check
Explanation
The changed resolver, ChatCore protocol tests, dashboard probe test, and changelog entry directly support #17997. The changes preserve existing protocol precedence and test the required regression behavior. No unrelated change is demonstrated. The related reference to #17219 does not add a separate active coding target.
Full details: Tests For Production Code
Explanation
The PR changes production code in open-sse/handlers/chatCore/targetFormat.ts. It also adds or updates three relevant unit-test files: tests/unit/chatcore-target-format.test.ts, tests/unit/agentrouter-chatcore-protocols.test.ts, and tests/unit/agentrouter-model-test-responses-17997.test.ts. The tests cover the changed AgentRouter model routing and /v1/responses behavior.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 4 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Full details: No Ai Attribution
Explanation
All seven reviewed commit messages have no Co-Authored-By trailers or Generated with footer. The supplied PR body is explicitly truncated, so the complete body cannot be checked for the prohibited attribution. No full PR description is available in the checkout refs.
Resolution
Provide the complete PR body, or confirm that it contains neither an AI/bot Co-Authored-By trailer nor a Generated with <AI tool> footer.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.
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
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.
Summary
gpt-6-astra,gpt-6.1-sol, andgpt-5.6-solthrough/v1/responseswhen a connection has no explicit protocol selection.Related Issues
Target Branch
release/v3.8.53branch, notmain.release/v3.8.53tip689b1eb573e21ea1bac4467c2ccfd9b8aaa7c518.Validation
npm run lintCommands run after reconciliation:
npm run check:test-tla-ordercurrently fails on the unchanged upstream filetests/unit/perplexity-research-tool.test.ts(test line 56, top-level await line 198, later test line 230). Running the same gate logic against base tip689b1eb573reproduces the failure and confirms the file is not allowlisted. This PR does not modify that file.TDD evidence:
/v1/chat/completions; restoring it passed.error,response.failed, and completed-empty fixtures reject false-positive health results.Live acceptance used an isolated local OmniRoute data directory with the credential supplied only through the environment. Buffered Chat, streaming Chat, native Responses, and dashboard model tests completed for all three affected IDs. Diagnostics selected
openai-responses; one Astra dashboard timeout and one emptygpt-5.6-solresponse were treated as failures and passed one bounded retry.Tests Added Or Updated
tests/unit/chatcore-target-format.test.tstests/unit/agentrouter-chatcore-protocols.test.tstests/unit/agentrouter-model-test-responses-17997.test.tsExisting focused guards also run:
tests/unit/agentrouter-executor-protocols.test.tstests/unit/agentrouter-live-catalog.test.tsCoverage Notes
Reviewer Notes
targetFormatwas added because it would override explicit connection choices.error,response.failed, and empty-output cases.