Arang.dev
Search

Applying the Claude Opus 4.6 Model in OpenClaw – Resolving the Unknown Model Error

Documenting the cause and solution for the 'Unknown model' error when using the Claude Opus 4.6 Thinking model in OpenClaw.

#OpenClaw#Claude#Opus 4.6#Troubleshooting#AI
🌐 Translated

This post was machine-translated from Korean by AI. Some expressions may differ from the original.

Read the original (Korean)

Situation

Claude Opus 4.5 was discontinued on Google Antigravity and transitioned to Opus 4.6. While Opus 4.6 can be used normally in the Antigravity app, an error occurred when changing the model to google-antigravity/claude-opus-4-6-thinking in OpenClaw.

⚠️ Agent failed before reply: Unknown model: google-antigravity/claude-opus-4-6-thinking

Cause Analysis

1. Need to Switch from npm Installation to git Installation

The existing OpenClaw installed via npm is located in /opt/homebrew/lib/node_modules/openclaw, which makes it difficult to modify the source or update dependencies. A git-based installation was necessary to modify the model registry.

curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- \
  --install-method git \
  --git-dir ~/src/openclaw \
  --no-onboard

2. Control UI Origin Error

After installing via git, the WebSocket connection from the Control UI was disconnected when the gateway was launched.

disconnected (1008): origin not allowed

This issue occurred because the Control UI's Origin was not in the gateway's allowed list. This can be resolved by adding controlUi.allowedOrigins to openclaw.json, or by accessing the UI provided by the gateway (http://127.0.0.1:18789/).

3. gateway.mode Issue

The gateway service would start, but the port would not open.

Gateway start blocked: set gateway.mode=local (current: remote) or pass --allow-unconfigured.

If gateway.mode is set to remote, the service will refuse to start locally.

openclaw config set gateway.mode local

4. Core Cause: pi-ai Model Registry Not Reflected

When checking with openclaw models list, Opus 4.6 was not listed at all.

$ openclaw models list --provider google-antigravity --all --plain
google-antigravity/claude-opus-4-5-thinking
google-antigravity/claude-sonnet-4-5
google-antigravity/claude-sonnet-4-5-thinking
google-antigravity/gemini-3-flash
google-antigravity/gemini-3-pro-high
# ... Opus 4.6이 μ—†λ‹€

OpenClaw relies on the model catalog of the internal package @mariozechner/pi-ai for model validation. Although the default model was changed to Opus 4.6 in PR #10720, the actual model definition required an update to the pi-ai package.

Resolution Process

Step 1: Issue Confirmation

The same issue was reported in GitHub Issue #10716, and a solution was found in the comments.

Step 2: Source Code Modification

Referring to the issue comments, three files were modified. The key was to add the Opus 4.6 model definition to the model registry.

  1. Add Opus 4.6 to the Model Catalog β€” Add a claude-opus-4-6-thinking entry to the model definition file within the pi-ai package.
  2. Model Mapping/Routing Configuration β€” Add a mapping so that the Antigravity provider recognizes the model ID.
  3. Default Model Change β€” Update the default value to claude-opus-4-6-thinking.

Step 3: Build and Apply

cd ~/src/openclaw
pnpm install
pnpm build
openclaw gateway restart

Step 4: Service Restoration

The LaunchAgent was often messed up. Complete initialization and reinstallation:

# κΈ°μ‘΄ μ„œλΉ„μŠ€ 정리
openclaw gateway stop || true
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
 
# lock 파일 정리 (OAuth 락 κΌ¬μž„ λ°©μ§€)
find ~/.openclaw /tmp/openclaw -type f -name "*.lock" -delete 2>/dev/null
 
# μž¬μ„€μΉ˜
openclaw doctor --repair
openclaw gateway install --force
openclaw gateway start

Step 5: Verification

$ openclaw models list --provider google-antigravity --all --plain | grep 4-6
google-antigravity/claude-opus-4-6-thinking
google-antigravity/claude-sonnet-4-6-thinking
 
$ openclaw gateway status
# RPC probe: ok βœ…

Side Issues Encountered

OAuth Token Refresh Lock

There was an issue where multiple gateway processes tried to refresh the OAuth token simultaneously, causing a lock.

OAuth token refresh failed: Lock file is already being held

This can be resolved by stopping all gateway processes, deleting the lock file, and restarting only one process.

Confusion with gateway.bind Value

Specifying local for gateway.bind results in a validation error. Valid values are loopback, lan, etc. Use loopback for local-only use.

openclaw config set gateway.bind loopback  # βœ…
openclaw config set gateway.bind local     # ❌ Invalid input

localhost β†’ IPv6 Issue on Alpine Linux

This is a separate issue where localhost is resolved to IPv6 (::1) in Docker containers (Alpine-based), causing health checks to fail. Specifying 127.0.0.1 resolves this.

Lessons Learned

  1. Switching between npm installation ↔ git installation is simpler than expected. The ~/.openclaw/ directory stores all the state, so only the installation path changes, and settings/sessions/authentication are preserved.
  2. Model support spans multiple layers. Even if the Provider supports the model, it must be registered in the client's (OpenClaw) model registry to be actually usable.
  3. LaunchAgent often gets messed up. Remembering the launchctl bootout β†’ install --force pattern is helpful for service management on macOS.
  4. Check the logs first. ~/.openclaw/logs/gateway.err.log contains most of the answers.

Comments

Loading comments...
Applying the Claude Opus 4.6 Model in OpenClaw – Resolving the Unknown Model Error | Arang