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.
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-thinkingCause 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-onboard2. 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 allowedThis 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 local4. 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.
- Add Opus 4.6 to the Model Catalog β Add a
claude-opus-4-6-thinkingentry to the model definition file within thepi-aipackage. - Model Mapping/Routing Configuration β Add a mapping so that the Antigravity provider recognizes the model ID.
- 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 restartStep 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 startStep 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 heldThis 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 inputlocalhost β 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
- 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. - 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.
- LaunchAgent often gets messed up. Remembering the
launchctl bootoutβinstall --forcepattern is helpful for service management on macOS. - Check the logs first.
~/.openclaw/logs/gateway.err.logcontains most of the answers.
Comments