feat: serve tui.json schema at app.kilo.ai/tui.json#3202
feat: serve tui.json schema at app.kilo.ai/tui.json#3202kilo-code-bot[bot] wants to merge 1 commit into
Conversation
| { status: 502 } | ||
| ); | ||
| } | ||
| const schema = await res.json(); |
There was a problem hiding this comment.
WARNING: Unhandled res.json() parse failure
If the upstream returns a 2xx response with a non-JSON body (e.g. an HTML gateway page), res.json() will throw, bypassing the res.ok guard and surfacing as an unhandled 500 rather than a clean 502. The sibling config.json/route.ts has the same pattern, but it wraps the result in a typed cast rather than fixing the throw either — worth addressing here while the file is new.
Consider wrapping in a try/catch:
let schema: unknown;
try {
schema = await res.json();
} catch {
return NextResponse.json({ error: 'upstream returned non-JSON body' }, { status: 502 });
}
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)The sibling Files Reviewed (1 file)
Fix these issues in Kilo Cloud Reviewed by claude-4.6-sonnet-20260217 · 193,421 tokens |
Adds a Next.js route at
apps/web/src/app/tui.json/route.tsthat proxieshttps://opencode.ai/tui.jsonand serves it athttps://app.kilo.ai/tui.json.This mirrors the existing
config.jsonroute pattern. Once deployed, Kilo CLI'stui-migrate.tsandtui.jsondocs will referenceapp.kilo.ai/tui.jsoninstead ofopencode.ai/tui.json, eliminating the opencode.ai brand reference from user-facing schema URLs.