Skip to content

fix(tui): skip malformed theme files instead of failing entire discovery - #44365

Closed
serg3k wants to merge 5 commits into
anomalyco:devfrom
serg3k:fix/theme-file-error
Closed

serg3k wants to merge 5 commits into
anomalyco:devfrom
serg3k:fix/theme-file-error

Conversation

@serg3k

@serg3k serg3k commented Aug 23, 2026

Copy link
Copy Markdown

Fixes #44263

A single invalid themes/*.json file anywhere in the discovered .opencode directories disables every custom theme. discoverThemes() parses each matched file with JSON.parse with no per-file error handling, so the first malformed file rejects the whole discovery pass.

The fix wraps each file's parse in a try/catch, skipping and silently ignoring malformed files while still loading all valid themes. This matches the convention the TUI config loader documents ("every broken-config path degrades gracefully rather than crashing").

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tui: one malformed custom theme file silently disables all custom themes

1 participant