Skip to content

fix(cli): exclude gpt-5.6-terra models from explicit prompt cache breakpoints - #13052

Closed
chrarnoldus wants to merge 1 commit into
mainfrom
fix/exclude-terra-from-prompt-cache-breakpoint
Closed

fix(cli): exclude gpt-5.6-terra models from explicit prompt cache breakpoints#13052
chrarnoldus wants to merge 1 commit into
mainfrom
fix/exclude-terra-from-prompt-cache-breakpoint

Conversation

@chrarnoldus

Copy link
Copy Markdown
Collaborator

Summary

@chrarnoldus chrarnoldus self-assigned this Aug 10, 2026

function supportsPromptCacheBreakpoint(model: Provider.Model): boolean {
if (isLikelyChatGPTSubscription(model)) return false
if (model.api.id.includes("terra")) return false

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: Consider matching -terra instead of a bare terra substring

includes("terra") matches anywhere in the model id, so a hypothetical future non-Terra model whose name merely contains the substring (e.g. a terraform-themed variant) would silently lose explicit breakpoints. includes("-terra") would still catch gpt-5.6-terra and prefixed gateway ids like openai/gpt-5.6-terra while avoiding that false positive. This is consistent with the broad includes checks already used nearby (claude, anthropic), and the failure mode is a graceful fallback to automatic caching, so feel free to reject.


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

@kilo-code-bot

kilo-code-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/opencode/src/provider/transform.ts 338 includes("terra") is a broad substring match; includes("-terra") would avoid hypothetical false positives

The fix is correct and well-scoped: the Terra exclusion sits inside the existing kilocode_change block, covers both supportsPromptCacheBreakpoint call sites (caching gate and provider options), and the new test genuinely exercises it (non-zero cost bypasses the ChatGPT-subscription heuristic, so the test fails without the new line). Changeset is present and user-facing. No memory-leak or security concerns — pure predicate change.

Fix these issues in Kilo Cloud

Files Reviewed (3 files)
  • packages/opencode/src/provider/transform.ts - 1 issue
  • packages/opencode/test/provider/transform.test.ts - 0 issues
  • .changeset/exclude-terra-from-prompt-cache-breakpoint.md - 0 issues

Reviewed by kimi-k3 · Input: 58.4K · Output: 6.6K · Cached: 237.5K

Review guidance: REVIEW.md from base branch main

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.

1 participant