Skip to content

feat: serve tui.json schema at app.kilo.ai/tui.json#3202

Open
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
feat/tui-json-schema
Open

feat: serve tui.json schema at app.kilo.ai/tui.json#3202
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
feat/tui-json-schema

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot Bot commented May 12, 2026

Adds a Next.js route at apps/web/src/app/tui.json/route.ts that proxies https://opencode.ai/tui.json and serves it at https://app.kilo.ai/tui.json.

This mirrors the existing config.json route pattern. Once deployed, Kilo CLI's tui-migrate.ts and tui.json docs will reference app.kilo.ai/tui.json instead of opencode.ai/tui.json, eliminating the opencode.ai brand reference from user-facing schema URLs.

{ status: 502 }
);
}
const schema = await res.json();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 });
}

@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot Bot commented May 12, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
apps/web/src/app/tui.json/route.ts 22 res.json() can throw if upstream returns a 2xx non-JSON body, bypassing the res.ok guard and producing an unhandled 500
Other Observations (not in diff)

The sibling config.json/route.ts has the same unguarded res.json() call (line 51). It's out of scope for this PR but worth a follow-up fix there too.

Files Reviewed (1 file)
  • apps/web/src/app/tui.json/route.ts — 1 issue

Fix these issues in Kilo Cloud


Reviewed by claude-4.6-sonnet-20260217 · 193,421 tokens

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.

0 participants