fix: use "openai-completions" for OpenClaw provider api format#313
Conversation
…enClaw api format OpenClaw no longer accepts "openai-chat" as a valid api option in its config schema. Update _configure_openclaw_model() to write "openai-completions" which is the correct value for OpenAI-compatible endpoints.
|
@Edison-A-N is attempting to deploy a commit to the Raphael's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Fixes OpenClaw config generation by ensuring the OpenAgents daemon writes a valid api enum value for OpenAI-compatible endpoints.
Changes:
- Update OpenClaw provider
apifield fromopenai-chattoopenai-completionsfor non-Anthropic base URLs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
zomux
left a comment
There was a problem hiding this comment.
LGTM. Confirmed that OpenClaw validates the api field as an enum — openai-chat is not a valid value, openai-completions is the correct one for OpenAI-compatible endpoints. Verified against OpenClaw's error output and existing config.
…enClaw api format (openagents-org#313) OpenClaw no longer accepts "openai-chat" as a valid api option in its config schema. Update _configure_openclaw_model() to write "openai-completions" which is the correct value for OpenAI-compatible endpoints.
Summary
Fixes an invalid
apivalue written to OpenClaw's config file (~/.openclaw/openclaw.json) by the OpenAgents daemon.Problem
_configure_openclaw_model()indaemon.pywas writing"openai-chat"as theapifield, which is not a valid OpenClaw api value. This caused OpenClaw to reject the config on startup with:Introduced in commit 48167e7 ("fix: configure OpenClaw model provider from OpenAgents env vars").
Fix
One-line change:
"openai-chat"→"openai-completions"insrc/openagents/client/daemon.pyline 424."openai-completions"is the standard OpenClaw api value for OpenAI-compatible endpoints (used in OpenClaw's own onboarding flow).