fix(ci): pass KILO_ORG_ID to docs-sync LLM steps - #12519
Merged
Merged
Conversation
Without KILO_ORG_ID the kilo provider sends no X-KiloCode-OrganizationId header, so the gateway bills the key owner's personal balance instead of the org. The dry run (run 30107542234) 402'd every triage chunk with "Add credits to continue, or switch to a free model" and silently classified 0/187 PRs. Hoist KILO_API_KEY + KILO_ORG_ID to job-level env, matching smoke-test.yml.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by claude-sonnet-5 · Input: 20 · Output: 1.7K · Cached: 400.5K Review guidance: REVIEW.md from base branch |
Collaborator
Author
|
(bot) Validation dry run from this branch: https://github.com/Kilo-Org/kilocode/actions/runs/30111081805 — success.
Compare with the failed run (30107542234): 8/8 chunks 402'd, 0 docs-worthy. |
St0rmz1
approved these changes
Jul 24, 2026
t7tran
pushed a commit
to t7tran/kilocode
that referenced
this pull request
Aug 14, 2026
Without KILO_ORG_ID the kilo provider sends no X-KiloCode-OrganizationId header, so the gateway bills the key owner's personal balance instead of the org. The dry run (run 30107542234) 402'd every triage chunk with "Add credits to continue, or switch to a free model" and silently classified 0/187 PRs. Hoist KILO_API_KEY + KILO_ORG_ID to job-level env, matching smoke-test.yml.
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.
Issue
Follow-up to #12512 (docs-sync bot). No tracking issue — exception: this fixes a defect found in the first dry run after that PR merged.
Failed dry run: https://github.com/Kilo-Org/kilocode/actions/runs/30107542234/job/89528563405
Context
The docs-sync dry run went green but every LLM call failed: all 8 triage chunks 402'd with
Add credits to continue, or switch to a free model, so 187/187 PRs were degraded to "unclassified" and triage reported 0 docs-worthy.Root cause: the workflow passed
KILO_API_KEYto the LLM steps but notKILO_ORG_ID. Without the org ID the CLI's kilo provider sends noX-KiloCode-OrganizationIdheader (packages/core/src/plugin/provider/kilo.ts), so the gateway falls back to the key owner's personal balance (getBalanceAndOrgSettingsin kilocode-backend) instead of the organization balance. The personal balance is empty → HTTP 402 on a paid model.Evidence the key itself is fine: the same
KILO_API_KEY+KILO_ORG_IDpair ran the paid smoke-test gate successfully in the publish run ~12 minutes before the docs-sync dry run (run 30106281647). Same secret, same day — works with the org ID, 402s without.Implementation
KILO_API_KEY+KILO_ORG_IDto job-levelenv:indocs-sync.yml, matching the existing pattern insmoke-test.yml(and the CLI's own generated GitHub workflow template, which emits both). This covers the triage, edit, and fix-verify steps and any future CLI-invoking steps.Env:doc comments intriage.mjs/edit.mjsto name both variables.Screenshots / Video
N/A — CI-only change.
How to Test
Manual/local verification
python3 -c "import yaml; yaml.safe_load(...)"on the edited workflow — valid (agent-executed).Reviewer test steps
gh workflow run docs-sync.yml --ref fix/docs-sync-kilo-org-id -f dry_run=trueAdd credits to continueand chunks produce real classifications (not all "triage failed to classify this PR").Blocked checks and substitute verification
Checklist