Skip to content

Integrating OpenClaw with Home Assistant Assist pipeline#37

Merged
techartdev merged 1 commit intomainfrom
ha_ai_pipeline_integration
Feb 9, 2026
Merged

Integrating OpenClaw with Home Assistant Assist pipeline#37
techartdev merged 1 commit intomainfrom
ha_ai_pipeline_integration

Conversation

@techartdev
Copy link
Copy Markdown
Owner

  • Introduced enable_openai_api option in config.yaml to enable OpenAI-compatible Chat Completions endpoint.
  • Updated apply_gateway_settings function to handle OpenAI API settings.
  • Enhanced documentation in DOCS.md for integrating OpenClaw with Home Assistant Assist pipeline.
  • Added translations for enable_openai_api in English, Bulgarian, German, Spanish, and Polish.
  • Bumped version to 0.5.37 in config.yaml.

- Introduced `enable_openai_api` option in config.yaml to enable OpenAI-compatible Chat Completions endpoint.
- Updated `apply_gateway_settings` function to handle OpenAI API settings.
- Enhanced documentation in DOCS.md for integrating OpenClaw with Home Assistant Assist pipeline.
- Added translations for `enable_openai_api` in English, Bulgarian, German, Spanish, and Polish.
- Bumped version to 0.5.37 in config.yaml.
@techartdev techartdev requested a review from Copilot February 9, 2026 18:14
@techartdev techartdev changed the title Add OpenAI API integration and update translations Integrating OpenClaw with Home Assistant Assist pipeline Feb 9, 2026
Copy link
Copy Markdown
Contributor

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

Adds an add-on option to expose an OpenAI-compatible Chat Completions endpoint from the OpenClaw Gateway, wires that option into startup/config patching, and documents how to use it with Home Assistant’s Assist pipeline.

Changes:

  • Add enable_openai_api to the add-on options/schema and surface it in translations.
  • Pass the new option through run.sh into oc_config_helper.py, which writes gateway.http.endpoints.chatCompletions.enabled.
  • Expand DOCS.md with a new section describing HA Assist pipeline integration via Extended OpenAI Conversation.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
openclaw_assistant/config.yaml Adds enable_openai_api option + schema entry; bumps add-on version.
openclaw_assistant/run.sh Reads enable_openai_api from options and passes it to the config helper.
openclaw_assistant/oc_config_helper.py Extends gateway settings patching to toggle Chat Completions endpoint enablement.
DOCS.md Documents the new option and provides HA Assist pipeline integration steps.
openclaw_assistant/translations/en.yaml Adds UI strings for enable_openai_api.
openclaw_assistant/translations/bg.yaml Adds UI strings for enable_openai_api.
openclaw_assistant/translations/de.yaml Adds UI strings for enable_openai_api.
openclaw_assistant/translations/es.yaml Adds UI strings for enable_openai_api.
openclaw_assistant/translations/pl.yaml Adds UI strings for enable_openai_api.
Comments suppressed due to low confidence (1)

openclaw_assistant/run.sh:242

  • In this if ! python3 ...; then pattern, rc=$? captures the exit status of the negated condition (from !), not the underlying python3 exit code. That will typically set rc to 0 on failure, causing exit "${rc}" to exit successfully and mask startup failures. Refactor to capture the python3 exit code directly (run command, store $?, then branch on non-zero) so the add-on fails fast with the real error code.
    if ! python3 "$HELPER_PATH" apply-gateway-settings "$GATEWAY_MODE" "$GATEWAY_BIND_MODE" "$GATEWAY_PORT" "$ENABLE_OPENAI_API" "$ALLOW_INSECURE_AUTH"; then
      rc=$?
      echo "ERROR: Failed to apply gateway settings via oc_config_helper.py (exit code ${rc})."
      echo "ERROR: Gateway configuration may be incorrect; aborting startup."
      exit "${rc}"
    fi

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +99 to +105
# http.endpoints.chatCompletions should be nested inside gateway
if "http" not in gateway:
gateway["http"] = {}
if "endpoints" not in gateway["http"]:
gateway["http"]["endpoints"] = {}
if "chatCompletions" not in gateway["http"]["endpoints"]:
gateway["http"]["endpoints"]["chatCompletions"] = {}
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

This function will create/modify nested gateway.http.endpoints.chatCompletions keys and may persist them via write_config(). Today, if read_config() fails to parse an existing config file it returns None, and the caller treats that as {} and proceeds, which can overwrite an existing (but temporarily malformed/JSON5) openclaw.json with a partial JSON config. Consider failing fast when the config file exists but cannot be parsed (return False and do not write), and only initializing an empty config when the file truly does not exist.

Copilot uses AI. Check for mistakes.
@techartdev techartdev merged commit 57d0a58 into main Feb 9, 2026
6 checks passed
@techartdev techartdev deleted the ha_ai_pipeline_integration branch February 9, 2026 18:23
nycterent pushed a commit to nycterent/OpenClawHomeAssistant that referenced this pull request Feb 9, 2026
Merge upstream PR techartdev#37: OpenAI-compatible Chat Completions endpoint
for Home Assistant Assist pipeline integration. New enable_openai_api
option with translations in all 5 languages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
nycterent pushed a commit to nycterent/OpenClawHomeAssistant that referenced this pull request Feb 12, 2026
Merge upstream PR techartdev#37: OpenAI-compatible Chat Completions endpoint
for Home Assistant Assist pipeline integration. New enable_openai_api
option with translations in all 5 languages.

Co-Authored-By: Claude Opus 4.6 <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.

2 participants