Skip to content

Release/v6.8.6 - #130

Merged
code-crusher merged 2 commits into
mainfrom
release/v6.8.6
Sep 15, 2026
Merged

code-crusher merged 2 commits into
mainfrom
release/v6.8.6

Conversation

@code-crusher

Copy link
Copy Markdown
Member

Summary

Release v6.8.6.

Fixed

  • Plan-aware default model. getKilocodeDefaultModel no longer returns the hardcoded openRouterDefaultModelId. It now resolves the default from the live MatterAI catalog (/v1/web/models): free accounts get the entry the backend flags freePlan, every other plan gets the first catalog entry (index 0, ordered by the catalog's sortOrder). The account plan comes from /axoncode/profile; a failed profile fetch is treated as free, and any catalog failure still falls back to openRouterDefaultModelId. The stale-model reset paths in ClineProvider now pass the Kilocode token and organization id so they resolve the same plan-aware default instead of the hardcoded one.

Verification

  • tsc --noEmit passes.
  • vitest run api/providers/__tests__/kilocode-openrouter.spec.ts api/providers/__tests__/kilocode-models.spec.ts — 31/31 pass.
  • ClineProvider.spec.ts has 27 pre-existing failures, identical with and without these changes (verified by stashing them).

After merge: tag v6.8.6 and run the Publish Extension workflow.

matterai-app[bot] added 2 commits September 15, 2026 17:56
…count plan

getKilocodeDefaultModel no longer returns the hardcoded openRouterDefaultModelId. It fetches /v1/web/models and /axoncode/profile in parallel and returns the entry the backend flags freePlan for free accounts, or the first catalog entry (index 0) for every other plan, with a 10-minute TTL cache and a fallback to openRouterDefaultModelId on failure. The stale-model reset paths in ClineProvider now pass the Kilocode token and organization id.
@matterai-app

matterai-app Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary By MatterAI MatterAI logo

🔄 What Changed

This pull request introduces dynamic default model resolution for the Kilocode provider by fetching live catalog and profile data with caching support, and updates the Cline provider webview configuration logic to handle stale models automatically.

🔍 Impact of the Change

Improves user experience by ensuring account plan changes and catalog updates are dynamically reflected without requiring an extension reload, while maintaining fallback resilience.

📁 Total Files Changed

Click to Expand
File ChangeLog
getKilocodeDefaultModel.ts Added cached model catalog fetching, profile evaluation, and free-plan filtering logic.
ClineProvider.ts Integrated dynamic default model resolution when encountering stale Kilocode models.
package.json Bumped extension version to 6.8.6.

🧪 Test Added/Recommended

Added

  • N/A

Recommended

  • Add unit tests for fetchCatalogDefaultModel and isFreePlan under various plan scenarios and error conditions.

🔒 Security Vulnerabilities

  • N/A

@matterai-app matterai-app Bot left a comment

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.

🧪 PR Review is completed: The new live-catalog default model resolution is well structured (TTL cache, parallel fetches, safe fallback), but a malformed profile body can throw and defeat the documented 'profile failure must not block' guarantee, and the profile schema validates a field that is never read. Reviewed src/core/webview/ClineProvider.ts (token/orgId propagation to stale-model reset — good fix, no issues) and src/package.json (version bump, no issues).

Skipped files
  • CHANGELOG.md: Skipped file pattern

Comment on lines +82 to +84
const plan = profileResponse.ok
? ((await profileSchema.parseAsync(await profileResponse.json())).plan ?? undefined)
: undefined

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.

🟡 Logic Error / Error Handling

Issue: The comment above this code states "A failed profile fetch must not block the default", but that guarantee only covers a non-OK HTTP status. If profileResponse.ok is true but the body is malformed (invalid JSON, or a shape that fails profileSchema — e.g. tieredUsage present with a non-object value), parseAsync/json() throws, which propagates out of fetchCatalogDefaultModel, gets caught in fetchKilocodeDefaultModel, and silently discards the successfully fetched catalog in favor of the hardcoded openRouterDefaultModelId fallback.

Fix: Wrap the profile parse in a try/catch so any profile failure (status, JSON, or schema) degrades to plan = undefined (treated as free) instead of throwing away the catalog result.

Impact: The catalog-derived default is always used when the catalog fetch succeeds, matching the documented intent and avoiding unnecessary fallbacks to the hardcoded model on transient profile API glitches.

Suggested change
const plan = profileResponse.ok
? ((await profileSchema.parseAsync(await profileResponse.json())).plan ?? undefined)
: undefined
let plan: string | undefined
if (profileResponse.ok) {
try {
plan = (await profileSchema.parseAsync(await profileResponse.json())).plan ?? undefined
} catch {
plan = undefined
}
}

@code-crusher
code-crusher merged commit d31993b into main Sep 15, 2026
3 of 9 checks passed
@code-crusher
code-crusher deleted the release/v6.8.6 branch September 15, 2026 12:38
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