Skip to content

fix: accept responses path appended to chat completions base#932

Open
lawyer112 wants to merge 1 commit into
jlcodes99:mainfrom
lawyer112:fix-cliproxy-responses-base-path
Open

fix: accept responses path appended to chat completions base#932
lawyer112 wants to merge 1 commit into
jlcodes99:mainfrom
lawyer112:fix-cliproxy-responses-base-path

Conversation

@lawyer112
Copy link
Copy Markdown

Summary

  • Accept /v1/chat/completions/v1/responses as a compatibility path for clients that append the Responses endpoint to a Chat Completions base URL.
  • Accept /v1/chat/completions/v1/responses/compact with the same compatibility behavior.
  • Add a regression test that verifies the appended Responses path is routed through the OpenAI Responses handler instead of returning 404 endpoint not supported.

Why

Some clients/configurations can accidentally use http://host:port/v1/chat/completions as the base URL and then append /v1/responses, producing:

/v1/chat/completions/v1/responses

In local reproduction, /v1/responses worked while this appended path consistently returned 404. This compatibility route avoids failing those requests and keeps them within the Responses handling path.

Related: #908

Testing

go test ./... -count=1
ok github.com/router-for-me/CLIProxyAPI/v7/cockpit-cliproxy 0.670s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant