feat: add tui.json route to serve Kilo-branded TUI keybind schema#3205
Open
kilo-code-bot[bot] wants to merge 1 commit into
Open
feat: add tui.json route to serve Kilo-branded TUI keybind schema#3205kilo-code-bot[bot] wants to merge 1 commit into
kilo-code-bot[bot] wants to merge 1 commit into
Conversation
| { status: 502 }, | ||
| ); | ||
| } | ||
| const upstream: unknown = await res.json(); |
Contributor
Author
There was a problem hiding this comment.
WARNING: Unhandled JSON.parse failure — if the upstream returns a 200 with a non-JSON body (e.g. a CloudFlare HTML error page), res.json() will throw and the route will return an unhandled 500 instead of a graceful 502.
Consider wrapping:
let upstream: unknown;
try {
upstream = await res.json();
} catch {
return NextResponse.json(
{ error: `upstream ${UPSTREAM} returned invalid JSON` },
{ status: 502 },
);
}Note: config.json/route.ts has the same gap, so this pattern could be addressed in both places.
Contributor
Author
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)
Files Reviewed (1 file)
Fix these issues in Kilo Cloud Reviewed by claude-sonnet-4.6 · 140,218 tokens |
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
apps/web/src/app/tui.json/route.ts, a Next.js route that proxieshttps://opencode.ai/tui.jsonand exposes it athttps://app.kilo.ai/tui.json.apps/web/src/app/config.json/route.ts: fetch upstream at request time, cache at the CDN edge for 1 hour (s-maxage=3600, stale-while-revalidate), and allow CORS (access-control-allow-origin: *).Verification
https://app.kilo.ai/tui.jsonafter deploy — should return the upstream JSON Schema with a 200.Visual Changes
N/A
Reviewer Notes
TUI_SCHEMA_URLinpackages/opencode/src/cli/cmd/tui/config/tui-migrate.ts(kilocode repo) and in the keybinds docs athttps://app.kilo.ai/docs/customize/keybinds. No code changes are needed in those places once this route is deployed.merge()function andextras.tscan be added here following the same pattern asconfig.json/.