fix: wait for gateway ready before post-install model validation

Root cause: gateway restart is async (systemd), but validateNoReplyModelAvailable()
ran immediately after, hitting a race condition where the new gateway process
hadn't finished initializing yet. This caused 'model not listed' validation
failures, triggering config rollback even though the config was correct.

Changes:
- Add waitForGatewayReady() that polls 'openclaw gateway status' for RPC probe
- Add retry loop (5 attempts, 2s interval) to validateNoReplyModelAvailable()
- Fix CONFIG.example.json: contextWindow 4096->200000, maxTokens 64->8192
  (OpenClaw requires minimum 16000 contextWindow)
This commit is contained in:
zhi
2026-02-26 08:45:37 +00:00
parent 15975e3970
commit de04e21aa1
3 changed files with 53 additions and 11 deletions

View File

@@ -40,8 +40,8 @@
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 4096,
"maxTokens": 64
"contextWindow": 200000,
"maxTokens": 8192
}
]
}