Skip to content

refactor(cli): rely on catalog model variants - #13103

Merged
chrarnoldus merged 8 commits into
mainfrom
chore/remove-inferred-variants
Aug 14, 2026
Merged

refactor(cli): rely on catalog model variants#13103
chrarnoldus merged 8 commits into
mainfrom
chore/remove-inferred-variants

Conversation

@chrarnoldus

@chrarnoldus chrarnoldus commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Remove Kilo-specific model-name heuristics that diverged from OpenCode v1.18.13 while retaining the package-based broad reasoning fallback for explicitly configured custom providers.

Bundled model variants now come from models.dev reasoning metadata, explicit configuration, or the Kilo Gateway catalog. Unknown GLM, Kimi, MiniMax, and Qwen IDs on supported custom-provider packages remain covered by the broad fallback.

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@chrarnoldus chrarnoldus self-assigned this Aug 13, 2026
chrarnoldus and others added 4 commits August 13, 2026 10:16
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
{
reasoningEffort: effort,
reasoningSummary: reasoningSummary(model), // kilocode_change
reasoningSummary: "auto",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: The gpt-5.6 detailed-summary kilocode_change was moved to the wrong case

In the base, the @ai-sdk/openai / @ai-sdk/amazon-bedrock/mantle branch (this one) used reasoningSummary: reasoningSummary(model) so that GPT-5.6 variants on direct OpenAI get reasoningSummary: "detailed". This PR moved the reasoningSummary(model) call up into the @ai-sdk/github-copilot branch (line 984) and reverted this branch to "auto".

Two consequences:

  1. reasoningSummary() (in src/kilocode/provider/reasoning-summary.ts) returns "auto" for any npm other than @ai-sdk/openai, so in the github-copilot branch it is a no-op — the kilocode behavior is effectively lost, not relocated.
  2. The retained test packages/opencode/test/kilocode/provider/gpt-5.6-summary.test.ts ("requests detailed summaries for every direct OpenAI reasoning variant") asserts every variant from ProviderTransform.variants() for gpt-5.6 on @ai-sdk/openai has reasoningSummary === "detailed" — it will now fail against this branch.

This looks like an accidental swap of two adjacent, similar-looking hunks during the revert. Suggest restoring the marker here and reverting the copilot branch to upstream "auto":

Suggested change
reasoningSummary: "auto",
reasoningSummary: reasoningSummary(model), // kilocode_change

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 81e30df: direct OpenAI variants use reasoningSummary(model), while GitHub Copilot remains on the upstream auto value.

{
reasoningEffort: effort,
reasoningSummary: "auto",
reasoningSummary: reasoningSummary(model), // kilocode_change

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: This kilocode_change is a no-op in the github-copilot branch

reasoningSummary() only returns something other than "auto" when model.api.npm === "@ai-sdk/openai"; this branch handles @ai-sdk/github-copilot models, so reasoningSummary(model) here always evaluates to "auto". It appears this marker was accidentally swapped with the one that belongs in the @ai-sdk/openai branch below (see the comment on line 1044). Once that is restored, this line should go back to the upstream value to keep the diff minimal:

Suggested change
reasoningSummary: reasoningSummary(model), // kilocode_change
reasoningSummary: "auto",

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 81e30df: the no-op Copilot change was reverted to reasoningSummary: "auto".

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@kilo-code-bot

kilo-code-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Incremental review of 81e30df..7b48fc4. The transform.ts change is a verbatim relocation of the reasoningVariants block (and helpers) from after schema to before options — added and removed line sets are identical, so no behavioral change; the new position matches the upstream layout. The previously fixed defects (gpt-5.6 reasoningSummary(model) in the @ai-sdk/openai branch, upstream "auto" in the github-copilot branch) are preserved intact in the moved code.

The test change expands the custom-provider fallback coverage to a 3-package × 4-model-ID matrix; expectations match customProviderVariants in src/kilocode/provider/provider.ts (anthropic: thinking: { type: "disabled" } / { effort }; openai/openai-compatible: reasoningEffort).

Files Reviewed (2 files)
  • packages/opencode/src/provider/transform.ts
  • packages/opencode/test/kilocode/provider-reasoning-options.test.ts
Previous Review Summaries (2 snapshots, latest commit 7b48fc4)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 7b48fc4)

Status: No Issues Found | Recommendation: Merge

Incremental review of 81e30df..7b48fc4. The transform.ts change is a verbatim relocation of the reasoningVariants block (and helpers) from after schema to before options — added and removed line sets are identical, so no behavioral change; the new position matches the upstream layout. The previously fixed defects (gpt-5.6 reasoningSummary(model) in the @ai-sdk/openai branch, upstream "auto" in the github-copilot branch) are preserved intact in the moved code.

The test change expands the custom-provider fallback coverage to a 3-package × 4-model-ID matrix; expectations match customProviderVariants in src/kilocode/provider/provider.ts (anthropic: thinking: { type: "disabled" } / { effort }; openai/openai-compatible: reasoningEffort).

Files Reviewed (2 files)
  • packages/opencode/src/provider/transform.ts
  • packages/opencode/test/kilocode/provider-reasoning-options.test.ts

Previous review (commit 81e30df)

Status: No Issues Found | Recommendation: Merge

The two findings from the previous review (gpt-5.6 reasoningSummary marker swapped into the wrong branch) were resolved in 81e30df — verified the @ai-sdk/openai branch now uses reasoningSummary(model) and the github-copilot branch is back to upstream "auto".

Spot-checked the result against upstream opencode v1.18.13: transform.ts now matches upstream except for intentional, marked kilocode_change blocks. No dangling references, balanced markers, and updated test expectations are consistent with the new behavior.

Files Reviewed (5 files)
  • .changeset/trim-inferred-variants.md
  • packages/opencode/src/provider/transform.ts
  • packages/opencode/test/kilocode/provider/grok-reasoning-variants.test.ts (deleted)
  • packages/opencode/test/kilocode/transform-opus-4.7.test.ts (deleted)
  • packages/opencode/test/provider/transform.test.ts

Reviewed by kimi-k3 · Input: 55K · Output: 1.6K · Cached: 101.4K

Review guidance: REVIEW.md from base branch main

chrarnoldus and others added 2 commits August 13, 2026 13:18
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@chrarnoldus
chrarnoldus merged commit d3bee2d into main Aug 14, 2026
33 checks passed
@chrarnoldus
chrarnoldus deleted the chore/remove-inferred-variants branch August 14, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants