| provider-switch-api-protocol-validation |
Reject invalid OpenClaw api protocol writes and self-heal stale entries |
gateway-backend-communication |
runtime-bridge |
Prevent ClawX from writing models.providers.*.api values outside the OpenClaw allowlist into openclaw.json, and opportunistically prune pre-existing invalid entries when the user switches default provider so a clean switch can rescue the Gateway from Invalid-config restart loops. |
| harness/specs/tasks/provider-switch-api-protocol-validation.md |
| electron/shared/providers/registry.ts |
| electron/shared/providers/types.ts |
| electron/utils/openclaw-auth.ts |
| electron/services/providers/provider-runtime-sync.ts |
| tests/unit/openclaw-auth.test.ts |
|
| Selecting OpenRouter (or any built-in provider) as default writes a Gateway-valid api protocol so Gateway reload stays healthy. |
| Attempting to save a provider whose api protocol is not in the OpenClaw allowlist surfaces an actionable error in the UI without polluting openclaw.json or triggering a Gateway restart. |
| Switching default to a healthy provider after a prior corrupt openclaw.json (legacy api=openrouter typo) self-heals the file before the next reload signal so the Gateway boots cleanly. |
|
|
| active-config-guards |
| backend-communication-boundary |
| renderer-main-boundary |
| api-client-transport-policy |
|
| tests/unit/openclaw-auth.test.ts |
|
| electron/shared/providers/types.ts exports OPENCLAW_API_PROTOCOLS as the single source of truth for openclaw.json api values, plus assertValidApiProtocol and InvalidApiProtocolError. |
| setOpenClawDefaultModel, setOpenClawDefaultModelWithOverride, syncProviderConfigToOpenClaw, and upsertOpenClawProviderEntry all invoke assertValidApiProtocol before any write to openclaw.json. |
| syncDefaultProviderToRuntime calls pruneInvalidApiProviderEntries before the OAuth and non-OAuth branches so a switch to any healthy provider drops legacy invalid models.providers entries. |
| Renderer does not add new direct ipcRenderer or Gateway HTTP calls. |
| Unit tests cover both the rejection path (no file write on invalid api) and the self-heal path (legacy entries pruned while valid ones remain). |
|
|