Uh oh!
There was an error while loading. Please reload this page.
fix(tui): guard Object.entries against null MCP/theme/input - #44356
fix(tui): guard Object.entries against null MCP/theme/input#44356pantha704 wants to merge 1 commit into
Conversation
TUI crash: TypeError Object.entries requires that input parameter not be null or undefined. Harden theme resolve, MCP status views, tool input formatting, and attention packs so missing objects do not take down the renderer.
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Enough1122
commented
Aug 23, 2026
Low-risk hardening, but I'd push back on the approach: most of these guards defend an invariant that the codebase already enforces, and scattering
Happy with #2/#3 as-is; #1 needs either a repro or a narrower scope before this lands. |
Issue for this PR
Closes#44100
Type of change
What does this PR do?
TUI dies with
TypeError: Object.entries requires that input parameter not be null or undefinedon 0.0.0-beta-17823 (same stack as #44100). Solid is iterating a value that is still null: theme colors, MCP status, toolinput, attention sounds.This PR passes
?? {}(or optional chaining) at those call sites, falls back to the built-inopencodetheme if the active one is missing, and adds a test thatresolveTheme({})does not throw.How did you verify your code works?
Added
packages/tui/test/theme.test.tscoverage for a theme object with nothemekey.Screenshots / recordings
N/A (crash guard, no UI change).
Checklist