fix: register routes without /v1 prefix for OpenCLAW compatibility#1
Open
HalfzwareLinda wants to merge 1 commit intomnemon-dev:mainfrom
Open
fix: register routes without /v1 prefix for OpenCLAW compatibility#1HalfzwareLinda wants to merge 1 commit intomnemon-dev:mainfrom
HalfzwareLinda wants to merge 1 commit intomnemon-dev:mainfrom
Conversation
OpenCLAW's openai-completions provider appends /chat/completions to the baseUrl without a /v1 prefix. This causes all requests to hit the 404 handler, which OpenCLAW then classifies as model_not_found. Register both /v1/chat/completions and /chat/completions (and similarly /v1/models and /models) so the proxy works regardless of whether the client includes the /v1 prefix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
/v1/chat/completionsand/chat/completions(and/v1/modelsand/models) so the proxy works with clients that omit the/v1prefixopenai-completionsprovider appends/chat/completionsdirectly tobaseUrlwithout/v1, causing all requests to 404Additional note: stale dist/
The published
dist/adapter/openai-to-cli.jsis missing theextractContentText()function that already exists in the TypeScript source. This causes OpenCLAW messages to arrive as[object Object]instead of actual text. Rebuildingdist/from current sources fixes this.Test plan
/chat/completionsreturns 200 with correct response/v1/chat/completionsstill works (no regression)🤖 Generated with Claude Code