Skip to content

fix: use "openai-completions" for OpenClaw provider api format#313

Merged
zomux merged 1 commit intoopenagents-org:developfrom
Edison-A-N:fix/openclaw-api-format-mismatch
Mar 19, 2026
Merged

fix: use "openai-completions" for OpenClaw provider api format#313
zomux merged 1 commit intoopenagents-org:developfrom
Edison-A-N:fix/openclaw-api-format-mismatch

Conversation

@Edison-A-N
Copy link
Copy Markdown
Contributor

Summary

Fixes an invalid api value written to OpenClaw's config file (~/.openclaw/openclaw.json) by the OpenAgents daemon.

Problem

_configure_openclaw_model() in daemon.py was writing "openai-chat" as the api field, which is not a valid OpenClaw api value. This caused OpenClaw to reject the config on startup with:

Error: Invalid enum value. Expected 'openai-completions' | 'openai-responses' | ... , received 'openai-chat'

Introduced in commit 48167e7 ("fix: configure OpenClaw model provider from OpenAgents env vars").

Fix

One-line change: "openai-chat""openai-completions" in src/openagents/client/daemon.py line 424.

"openai-completions" is the standard OpenClaw api value for OpenAI-compatible endpoints (used in OpenClaw's own onboarding flow).

…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.
Copilot AI review requested due to automatic review settings March 19, 2026 14:47
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 19, 2026

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 api field from openai-chat to openai-completions for 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.

Copy link
Copy Markdown
Contributor

@zomux zomux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@zomux zomux merged commit 36cd8eb into openagents-org:develop Mar 19, 2026
3 of 13 checks passed
Edison-A-N added a commit to Edison-A-N/openagents that referenced this pull request Mar 20, 2026
…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.
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.

3 participants