fix(kiloclaw): set baseUrl when creating kilocode provider entry for org instances#1879
Draft
evanjacobson wants to merge 1 commit intochore/kiloclaw-3.24-version-bumpfrom
Draft
Conversation
…org instances OpenClaw's ModelProviderSchema requires baseUrl to be a non-empty string. The org header block creates a models.providers.kilocode entry to inject X-KiloCode-OrganizationId but never set baseUrl, causing config validation to fail on every org instance boot with: models.providers.kilocode.baseUrl: Invalid input: expected string, received undefined Fix: set baseUrl to the production URL (falling back from any existing dev override set earlier in the function by KILOCODE_API_BASE_URL).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes a bug introduced in #1836 earlier today, which caused a zod validation to fail in OpenClaw itself (not our own infra). This missing field in openclaw.json is unfixable by the doctor, and results in the instance restarting itself until it crashes. This affects org instances only.
Org instances boot with
KILOCODE_ORGANIZATION_IDset, which causesgenerateBaseConfigto create amodels.providers.kilocodeentry to inject theX-KiloCode-OrganizationIdheader. That entry was missingbaseUrl, which OpenClaw'sModelProviderSchemahas required as a non-empty string since at least January 2026. Every org instance boot failed with:The fix is a single line: set
baseUrlto the production URL (https://api.kilo.ai/api/gateway/) when creating the entry, falling back from any existing dev override set earlier byKILOCODE_API_BASE_URL.Personal instances are unaffected — they never set
KILOCODE_ORGANIZATION_IDso the entry is never created.Logs (truncated):
Verification
Visual Changes
N/A
Reviewer Notes
Confirmed via the openclaw/openclaw GitHub history that
baseUrl: z.string().min(1)has been required since commitd1e9490f(Jan 19 2026) — this is not an upstream regression, it was just missed when the org header feature was written.