fix(cli): strip internal agent metadata from provider request options - #11767
Merged
Conversation
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summaries (3 snapshots, latest commit be7e978)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit be7e978)Status: 1 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Files Reviewed (4 files)
Previous review (commit d275dce)Status: 1 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Files Reviewed (6 files)
Previous review (commit c94a097)Status: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by gpt-5.4-20260305 · Input: 56.7K · Output: 5K · Cached: 221.7K Review guidance: REVIEW.md from base branch |
chrarnoldus
force-pushed
the
fix/strip-agent-internal-options
branch
from
June 29, 2026 08:31
d275dce to
c94a097
Compare
…nal-options Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
…vider options Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
imanolmzd-svg
approved these changes
Jun 30, 2026
5 tasks
t7tran
pushed a commit
to t7tran/kilocode
that referenced
this pull request
Aug 14, 2026
…nal-options fix(cli): strip internal agent metadata from provider request options
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
Fixes #11754. Non-default agents (Ask, Plan, org-provided modes, marketplace agents like Code-Reviewer, and Scout/reference agents) failed with a 400
Unsupported parameter(s)error on strict providers (e.g. NVIDIA NIM, GLM-5.1, MiniMax M3).Root cause
agent.optionsis forwarded verbatim intoproviderOptions(session/llm/request.ts), relying on the upstream invariant that it only holds genuine provider options. Kilo broke that invariant by storing internal/UI-only metadata there:displayName— human-readable name (org/marketplace agents)source— origin marker (organization)id— mode identifier, promoted intooptionsby the upstream "unknown frontmatter key" normalization and read insession/prompt.tsreference/resolved— configured reference descriptors for Scout/reference agents (agent/agent.ts)The default Code agent has empty options, which is why only non-default agents were affected. The Kilo gateway masks the symptom because
kiloProviderOptionswhitelists fields instead of forwarding the raw blob.Fix
An allowlist is impossible — arbitrary
optionskeys are legitimately provider options (that's howreasoningEffortetc. are configured via frontmatter). SostripInternalOptions(in the Kilo-ownedsrc/kilocode/agent/options.ts) drops only the known internal keys (id,displayName,source,reference,resolved) fromagent.optionsjust before they are merged intoproviderOptions, behind a singlekilocode_changemarker in the shared upstreamrequest.ts. Genuine provider options pass through untouched, andagent.optionsitself is not mutated.Related
#11773 (merged) is the complementary refactor that carries
displayName/sourceas typed agent fields so they no longer enteroptionsat the source. This PR is the runtime safety net and additionally coversid,reference, andresolved.Notes
Local
bun test/ typecheck could not be run in this environment (missing@opentui/solidpreload and a broken@babel/traversein the dep cache). The added helper is dependency-free; logic is covered bytest/kilocode/agent-options-strip.test.ts.