opencode/packages/cli-rs/parity/deviations/U01-broken-custom-opencode-theme.md
Simon Klee 6b1df0cceb
feat(cli-rs): add the native CLI and TUI (#63477)
Add packages/cli-rs, an OpenCode client written in Rust on OpenTUI's Rust crates. It is a client only.
2026-11-22 00:07:01 +01:00

1.1 KiB

U01: a broken custom opencode theme falls back to the built-in one

TypeScript. A custom theme file named opencode replaces the built-in opencode theme (packages/tui/src/theme/index.ts:42-52), and opencode is the theme every failed theme falls back to. When the custom opencode is malformed, that fallback fails too: the selected memo rethrows for opencode (packages/tui/src/context/theme.tsx:298-308), so the TUI stops. For example, setCustomThemes({ opencode: { base: {} } }) makes parseTheme(allThemes().opencode) throw Invalid theme: opencode value is an invalid value.

Rust. ThemeState (crates/ui/src/theme/state.rs) shows the failed theme's error toast as for any broken theme, then loads the built-in opencode theme and logs custom theme opencode: <message>; using the built-in opencode theme. This holds whether the broken custom opencode was selected or was the fallback of another theme (a broken custom theme, or system without a terminal palette).

Reason. Defects the TypeScript client shares are fixed in Rust and recorded as deviations. A broken theme file should not stop the client.