Skip to content

fix: register routes without /v1 prefix for OpenCLAW compatibility#1

Open
HalfzwareLinda wants to merge 1 commit intomnemon-dev:mainfrom
HalfzwareLinda:fix/openclaw-compat
Open

fix: register routes without /v1 prefix for OpenCLAW compatibility#1
HalfzwareLinda wants to merge 1 commit intomnemon-dev:mainfrom
HalfzwareLinda:fix/openclaw-compat

Conversation

@HalfzwareLinda
Copy link
Copy Markdown

Summary

  • Register both /v1/chat/completions and /chat/completions (and /v1/models and /models) so the proxy works with clients that omit the /v1 prefix
  • OpenCLAW's openai-completions provider appends /chat/completions directly to baseUrl without /v1, causing all requests to 404

Additional note: stale dist/

The published dist/adapter/openai-to-cli.js is missing the extractContentText() function that already exists in the TypeScript source. This causes OpenCLAW messages to arrive as [object Object] instead of actual text. Rebuilding dist/ from current sources fixes this.

Test plan

  • Verified /chat/completions returns 200 with correct response
  • Verified /v1/chat/completions still works (no regression)
  • Tested with OpenCLAW v2026.4.11 agents end-to-end

🤖 Generated with Claude Code

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>
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