Skip to content

chore: remove obsolete /api/modelstats endpoint#2740

Merged
chrarnoldus merged 1 commit intomainfrom
remove-modelstats-endpoint
Apr 24, 2026
Merged

chore: remove obsolete /api/modelstats endpoint#2740
chrarnoldus merged 1 commit intomainfrom
remove-modelstats-endpoint

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot Bot commented Apr 23, 2026

Summary

  • Removes apps/web/src/app/api/modelstats/route.ts, a hardcoded JSON endpoint that is no longer consumed by any current client.
  • The only remaining caller is the legacy extension repo (Kilo-Org/kilocode-legacy) in webview-ui/src/components/kilocode/settings/KiloModelInfoView.tsx.

Verification

  • Searched the cloud repo for any reference to modelstats: none remain after this deletion.
  • Inspected the legacy caller: the fetch runs inside react-query with a try/catch that reports via telemetry and rethrows. React-query surfaces the error as data: undefined, and the component reads modelStats?.find(...) with optional chaining, so the pricing row simply doesn't render. The rest of KiloModelInfoView (description, supports flags, context window, max output) is unaffected. Failure is graceful.

Visual Changes

N/A

Reviewer Notes

If we still want to keep the legacy extension functional indefinitely, we could leave an empty-array stub instead — but the existing fallback already handles a 404 without user-visible breakage.

This endpoint is only consumed by the legacy kilocode-legacy extension
(KiloModelInfoView.tsx). That code path wraps the fetch in try/catch,
reports the error via telemetry, and renders without pricing stats when
the request fails, so removal degrades gracefully.
@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot Bot commented Apr 23, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/app/api/modelstats/route.ts 1 Removing this route breaks a still-consumed API contract for kilocode-legacy; that client catches the 404, but it still loses the model pricing data it currently renders.
Other Observations (not in diff)

No additional observations.

Files Reviewed (1 files)
  • apps/web/src/app/api/modelstats/route.ts - 1 issue

Reviewed by gpt-5.4-20260305 · 143,421 tokens

@chrarnoldus chrarnoldus marked this pull request as draft April 23, 2026 11:02
catgirl3d pushed a commit to catgirl3d/kilocode-legacy-p that referenced this pull request Apr 23, 2026
The /api/modelstats endpoint is being removed from the cloud backend
(Kilo-Org/cloud#2740). This drops the now-dead fetch and the unused
averageKiloCodeCost translation strings.
@chrarnoldus chrarnoldus marked this pull request as ready for review April 24, 2026 11:41
@chrarnoldus chrarnoldus merged commit 0c357ab into main Apr 24, 2026
16 checks passed
@chrarnoldus chrarnoldus deleted the remove-modelstats-endpoint branch April 24, 2026 11:42
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