Skip to content

Commit 3ff1739

Browse files
committed
release: v2026.4.7.1918 — Ollama input modalities fix
- Fixed gateway startup failure on fresh installs/upgrades - OpenClaw validator only allows [text, image] in model input - EverClaw templates had [text, image, audio] for Gemma 4 E2B/E4B - Added migration in setup.mjs to sanitize input arrays - Added A11 check in diagnose.sh to detect bad values - Updated both templates and setup-ollama.sh
1 parent a91dc5f commit 3ff1739

File tree

9 files changed

+84
-11
lines changed

9 files changed

+84
-11
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
All notable changes to EverClaw are documented here.
44

5+
## [2026.4.7.1833] - 2026-04-07 — Ollama Input Modalities Fix
6+
7+
### Fixed
8+
- **Gateway startup failure on fresh installs and upgrades** — OpenClaw's config validator only allows `["text", "image"]` in model `input` arrays. EverClaw templates and `setup-ollama.sh` were generating `["text", "image", "audio"]` for Gemma 4 E2B/E4B (which natively support audio), causing the gateway to reject the config and fail to start. Now all input arrays are capped to `["text", "image"]` until OpenClaw adds audio support.
9+
10+
### Added
11+
- **Model input modality migration**`setup.mjs` now sanitizes all provider model `input` arrays at apply time, removing unsupported values like `"audio"`. Defensive migration runs on all providers (not just Ollama) for future-proofing.
12+
- **A11 diagnostic check**`diagnose.sh` now detects unsupported input modalities and suggests running `setup.mjs --apply` to auto-fix.
13+
14+
### Changed
15+
- **`templates/openclaw-config-mac.json`** — Ollama model input: `["text", "image", "audio"]``["text", "image"]`
16+
- **`templates/openclaw-config-linux.json`** — Same
17+
- **`scripts/setup-ollama.sh`**`get_model_input_modalities()` now returns `["text", "image"]` for all models (E2B/E4B/26B/31B) with comment explaining OpenClaw validator limitation
18+
- **Comment updated**`_comment` in templates dropped "Vision + audio" to "Vision enabled where supported"
19+
20+
### Technical Notes
21+
- Root cause: OpenClaw recently tightened the config schema for `models[].input` to only allow `"text"` and `"image"`. EverClaw templates were ahead of the validator (Gemma 4 E2B/E4B do support audio natively), but the mismatch caused gateway rejections.
22+
- Migration is defensive: strips any value not in `{"text", "image"}` across ALL providers, not just Ollama.
23+
- Silent no-op if config is already valid (no write, no log message).
24+
525
## [2026.4.7.1756] - 2026-04-07 — Local Embeddings Fix (node-llama-cpp)
626

727
### Fixed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ RUN FDIR="/home/node/.openclaw/workspace/skills/everclaw/templates/flavors/${FLA
170170

171171
# ─── Environment ──────────────────────────────────────────────────────────────
172172

173-
ARG EVERCLAW_VERSION=2026.4.7.1756
173+
ARG EVERCLAW_VERSION=2026.4.7.1918
174174
ENV EVERCLAW_VERSION=${EVERCLAW_VERSION}
175175
ENV NODE_ENV=production
176176
ENV EVERCLAW_PROXY_PORT=8083

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
services:
1515
everclaw:
16-
image: ghcr.io/everclaw/everclaw:2026.4.7.1756
16+
image: ghcr.io/everclaw/everclaw:2026.4.7.1918
1717
build:
1818
context: .
1919
dockerfile: Dockerfile

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "everclaw",
3-
"version": "2026.4.7.1756",
3+
"version": "2026.4.7.1918",
44
"type": "module",
55
"description": "Open-source first AI inference via Morpheus decentralized network",
66
"scripts": {

scripts/diagnose.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,29 @@ print(count)
305305
fix "Memory search works without this, but only with a remote embedding provider"
306306
fi
307307
fi
308+
309+
# A11: Do any model input arrays contain unsupported values?
310+
# OpenClaw validator only allows "text" and "image". Values like "audio"
311+
# (valid for Gemma 4 E2B/E4B) cause gateway startup failure.
312+
if [[ -f "$OPENCLAW_CONFIG" ]]; then
313+
local bad_inputs
314+
bad_inputs=$(jq -r '
315+
[.models.providers // {} | to_entries[] |
316+
.key as $prov | .value.models // [] | .[] |
317+
.input // [] | .[] |
318+
select(. != "text" and . != "image") |
319+
$prov + ": " + .] | unique | .[]
320+
' "$OPENCLAW_CONFIG" 2>/dev/null)
321+
if [[ -n "$bad_inputs" ]]; then
322+
fail "Unsupported model input modalities found (gateway will reject these):"
323+
while IFS= read -r line; do
324+
fix " $line"
325+
done <<< "$bad_inputs"
326+
fix "Run: node scripts/setup.mjs --apply (auto-sanitizes input modalities)"
327+
else
328+
pass "All model input modalities valid (text/image only)"
329+
fi
330+
fi
308331
}
309332

310333
# ═════════════════════════════════════════════════════════════════════════════

scripts/setup-ollama.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,12 @@ get_model_context_window() {
8585
}
8686

8787
# Get input modalities by model
88+
# Note: Gemma 4 E2B/E4B models support "audio" natively, but OpenClaw's
89+
# config validator currently only allows ["text", "image"]. We cap all models
90+
# to ["text", "image"] until the validator is updated.
8891
get_model_input_modalities() {
8992
local model="$1"
9093
case "$model" in
91-
gemma4:e2b*|gemma4-e2b*|gemma4:e4b*|gemma4-e4b*) echo '["text", "image", "audio"]' ;;
92-
gemma4:26b*|gemma4-26b*|gemma4:31b*|gemma4-31b*) echo '["text", "image"]' ;;
9394
*) echo '["text", "image"]' ;;
9495
esac
9596
}

scripts/setup.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,37 @@ if (applyMode) {
679679
console.log(` ⚠️ Ollama migration check failed (not fatal): ${e.message}`);
680680
}
681681

682+
// ─── Model Input Modality Sanitization ─────────────────────────────
683+
// OpenClaw's config validator only allows "text" and "image" in model
684+
// input arrays. Gemma 4 E2B/E4B support "audio" natively, but the
685+
// validator rejects it — causing gateway startup failure on fresh
686+
// installs and upgrades. Strip unsupported values defensively across
687+
// ALL providers (not just Ollama) to future-proof.
688+
try {
689+
const ALLOWED_INPUTS = new Set(['text', 'image']);
690+
const providers = merged.models?.providers;
691+
let sanitized = false;
692+
if (providers && typeof providers === 'object') {
693+
for (const [provId, prov] of Object.entries(providers)) {
694+
if (!Array.isArray(prov.models)) continue;
695+
for (const m of prov.models) {
696+
if (!Array.isArray(m.input)) continue;
697+
const filtered = m.input.filter(v => ALLOWED_INPUTS.has(v));
698+
if (filtered.length !== m.input.length) {
699+
m.input = filtered;
700+
sanitized = true;
701+
}
702+
}
703+
}
704+
}
705+
if (sanitized) {
706+
writeFileSync(configPath, JSON.stringify(merged, null, 2) + '\n');
707+
console.log(' 🔧 Sanitized model input modalities (removed unsupported values like "audio")');
708+
}
709+
} catch (e) {
710+
console.log(` ⚠️ Input modality sanitization failed (not fatal): ${e.message}`);
711+
}
712+
682713
// ─── Stage 4: Security Tier ───────────────────────────────────────
683714

684715
if (!noSecurity) {

templates/openclaw-config-linux.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
]
8282
},
8383
"ollama": {
84-
"_comment": "Local Ollama inference fallback. Run 'bash scripts/setup-ollama.sh --apply' to auto-detect your RAM/GPU and install the optimal Gemma 4 model (E2B/E4B/26B/31B). Vision + audio enabled where supported.",
84+
"_comment": "Local Ollama inference fallback. Run 'bash scripts/setup-ollama.sh --apply' to auto-detect your RAM/GPU and install the optimal Gemma 4 model (E2B/E4B/26B/31B). Vision enabled where supported.",
8585
"baseUrl": "http://127.0.0.1:11434/v1",
8686
"api": "ollama",
8787
"models": [
@@ -91,8 +91,7 @@
9191
"reasoning": false,
9292
"input": [
9393
"text",
94-
"image",
95-
"audio"
94+
"image"
9695
],
9796
"cost": {
9897
"input": 0,

templates/openclaw-config-mac.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
]
8080
},
8181
"ollama": {
82-
"_comment": "Local Ollama inference fallback. Run 'bash scripts/setup-ollama.sh --apply' to auto-detect your RAM/GPU and install the optimal Gemma 4 model (E2B/E4B/26B/31B). Vision + audio enabled where supported.",
82+
"_comment": "Local Ollama inference fallback. Run 'bash scripts/setup-ollama.sh --apply' to auto-detect your RAM/GPU and install the optimal Gemma 4 model (E2B/E4B/26B/31B). Vision enabled where supported.",
8383
"baseUrl": "http://127.0.0.1:11434/v1",
8484
"api": "ollama",
8585
"models": [
@@ -89,8 +89,7 @@
8989
"reasoning": false,
9090
"input": [
9191
"text",
92-
"image",
93-
"audio"
92+
"image"
9493
],
9594
"cost": {
9695
"input": 0,

0 commit comments

Comments
 (0)