Skip to content

Commit d9d79e3

Browse files
committed
fix(tui): pin OpenTUI to 0.3.4 to match OpenCode 1.17.11 (#200)
OpenCode 1.17.11 reverted bundled OpenTUI 0.4.2 -> 0.3.4, but the plugin pinned ^0.4.2 as a regular dependency, so npm installed a second OpenTUI 0.4.2 in the plugin tree. The sidebar then mounted 0.4.2 renderables into the host's 0.3.4 renderer, which kept the TUI process burning CPU at idle (additive per sidebar plugin). Pin @opentui/core + @opentui/solid to 0.3.4 to match the host so the sidebar shares a single, version-matched OpenTUI. Peer-only deps are not viable: the OpenCode TUI loader does not resolve host-provided @opentui/* for raw-TS tui.json plugins, so a peer-dep flip re-breaks with MODULE_NOT_FOUND (the original 1.17.10 failure). A host-side loader fix is being tracked upstream as the durable resolution.
1 parent 93d6f8c commit d9d79e3

4 files changed

Lines changed: 31 additions & 20 deletions

File tree

.alfonso/release-notes/v0.30.2.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# v0.30.2
2+
3+
A patch release fixing high idle CPU usage in the TUI sidebar.
4+
5+
## Fixes
6+
7+
- **High idle CPU in the TUI sidebar (#200).** OpenCode 1.17.11 reverted its bundled OpenTUI from 0.4.2 back to 0.3.4, but Magic Context had pinned OpenTUI 0.4.2. That version mismatch made the sidebar mount UI objects built against a different OpenTUI than the host renderer, which kept a TUI process burning CPU even when the session was idle. The cost was additive per sidebar plugin (the same mismatch affected other sidebar plugins too). OpenTUI is now pinned to 0.3.4 to match OpenCode 1.17.11, so the sidebar returns to baseline idle CPU. Thanks to @null-axiom for the report and the cross-plugin cross-check that pointed straight at the shared dependency.
8+
9+
We're also working with the OpenCode team on a host-side fix so TUI plugins always share the host's OpenTUI runtime, which removes this class of version-mismatch entirely.

bun.lock

Lines changed: 18 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"@jitl/quickjs-singlefile-cjs-release-asyncify": "0.32.0",
4545
"@opencode-ai/plugin": "^1.17.11",
4646
"@opencode-ai/sdk": "^1.17.11",
47-
"@opentui/core": "^0.4.2",
48-
"@opentui/solid": "^0.4.2",
47+
"@opentui/core": "0.3.4",
48+
"@opentui/solid": "0.3.4",
4949
"ai-tokenizer": "^1.0.6",
5050
"comment-json": "^5.0.0",
5151
"quickjs-emscripten": "^0.32.0",

packages/plugin/src/shared/announcement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ import { getMagicContextStorageDir } from "./data-path";
2424
* Bump only when there are user-visible changes worth a startup dialog.
2525
* Does NOT need to match the published package version.
2626
*/
27-
export const ANNOUNCEMENT_VERSION = "0.30.1";
27+
export const ANNOUNCEMENT_VERSION = "0.30.2";
2828

2929
/**
3030
* Short, user-facing bullet strings. Keep each line ~80 chars or shorter so the
3131
* TUI dialog renders cleanly without horizontal scroll on a typical terminal.
3232
*/
3333
export const ANNOUNCEMENT_FEATURES: ReadonlyArray<string> = [
34-
"Local embeddings work on OpenCode Desktop again (#195): /ctx-embed no longer fails with 'Unsupported device: cpu' on the Desktop app.",
34+
"Fixed high idle CPU in the OpenCode TUI sidebar (#200): OpenTUI is pinned to match OpenCode 1.17.11, so the sidebar no longer burns CPU when idle.",
3535
];
3636

3737
/**

0 commit comments

Comments
 (0)