TUI crash: undefined is not an object (evaluating 'r.text.feedback[t.toast.variant].base')
Los mantenedores suelen responder en 1 día
@Finn763 ya está trabajando en esto.
Desde el 12/10/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Empieza en packages/tui/src/ui/toast.tsx, especialmente en la búsqueda del tema en la línea 54, y lee el tipo de variante del toast en la línea 11 junto con el esquema de feedback en packages/theme/src/tui/schema.ts. Reproduce el problema con una variante no válida como warn o con un tema personalizado parcial al que le falte esa entrada. La tarea está terminada cuando una entrada de feedback no válida o ausente ya no hace que la TUI se bloquee; el issue no especifica un archivo de pruebas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
The TUI hard-crashes when a plugin calls ui.toast.show() with a toast variant that is not a valid theme feedback key. The theme lookup in packages/tui/src/ui/toast.tsx:54 is unguarded:
borderColor={theme.text.feedback[props.toast.variant].base}
A single invalid variant string from a third-party plugin (in my case "warn" instead of "warning") throws a TypeError in the render pass and takes down the entire TUI with the crash screen. My plugin's call was wrapped in try/catch, but the exception fires later during rendering, so plugin-level fail-open wrappers cannot catch it.
Environment
- opencode version: 2.0.27
- OS: macOS 24.6.0 (darwin x64)
- Terminal: tmux 3.6a
- Shell: /bin/zsh
- Install/channel: latest
- Active plugins: local global plugins in
~/.config/opencode/plugins/—brain-logger.js,identity-anchor.js,pantheon-hub/(TUI plugin; crash trigger)
Reproduction
- Add a TUI plugin in
~/.config/opencode/plugins/that callscontext.ui.toast.show({ message: "hello", variant: "warn" })— invalid: the variant union atpackages/tui/src/ui/toast.tsx:11is"info" | "success" | "warning" | "error", andtext.feedbackinpackages/theme/src/tui/schema.tsonly defineserror/warning/success/info. - Trigger the call (e.g. from a palette/slash command).
- The toast renders → TypeError → full TUI crash screen.
Expected Behavior
One (or more) of:
ui.toast.show()validates/clamps the variant at the plugin API boundary, falling back toinfofor unknown values;- the theme lookup at
toast.tsx:54guards against missing entries with a fallback color; - at minimum the error surfaces in the plugin's call frame rather than crashing the whole TUI render.
Actual Behavior
TypeError: undefined is not an object (evaluating 'r.text.feedback[t.toast.variant].base') — the entire TUI crashes.
Relevant stack frames:
at <anonymous> (chunk-k3c2wewa.js:2590:13646) ← toast render, unguarded theme lookup
at show (chunk-k3c2wewa.js:2590:14589)
at show (chunk-k3c2wewa.js:2592:29350)
at run (~/.config/opencode/plugins/pantheon-hub/tui.tsx:264:34) ← plugin command handler
Additional Context
- The triggering call was my own plugin bug (
"warn"is not a valid variant), but the reportable issue is that any plugin passing an invalid variant string — or a variant whose entry is missing from a partial custom theme (text.feedback.*entries areSchema.optionalinpackages/theme/src/tui/schema.ts:94-101) — kills the whole TUI. There is no error boundary in the toast render path. - The
warnvswarningmismatch is an easy mistake for plugin authors: the variant key iswarning, while log levels elsewhere usewarn(e.g.client.app.loglevels:debug,info,warn,error).
Full stack trace from the crash screen
Error: undefined is not an object (evaluating 'r.text.feedback[t.toast.variant].base')
at <anonymous> (/$bunfs/root/chunk-k3c2wewa.js:2590:13646)
at Ve (/$bunfs/root/chunk-qxet3sb1.js:2:9872)
at K (/$bunfs/root/chunk-qxet3sb1.js:2:9653)
at T_ (/$bunfs/root/chunk-qxet3sb1.js:2:3651)
at <anonymous> (/$bunfs/root/chunk-k3c2wewa.js:2590:13574)
at qi (/$bunfs/root/chunk-qxet3sb1.js:2:6895)
at Ve (/$bunfs/root/chunk-qxet3sb1.js:2:9872)
at K (/$bunfs/root/chunk-qxet3sb1.js:2:9653)
at Z (/$bunfs/root/chunk-qxet3sb1.js:2:11338)
at $e (/$bunfs/root/chunk-qxet3sb1.js:2:12211)
at wt (/$bunfs/root/chunk-qxet3sb1.js:2:11613)
at D (/$bunfs/root/chunk-qxet3sb1.js:2:11518)
at g (/$bunfs/root/chunk-j7geqk7h.js:3:23104)
at show (/$bunfs/root/chunk-k3c2wewa.js:2590:14589)
at show (/$bunfs/root/chunk-k3c2wewa.js:2592:29350)
at run (/Users/dev10/.config/opencode/plugins/pantheon-hub/tui.tsx:264:34)
at a (/$bunfs/root/chunk-qt5e0j2h.js:2:31593)
at u (/$bunfs/root/chunk-qt5e0j2h.js:2:32383)
at d (/$bunfs/root/chunk-qt5e0j2h.js:2:32909)
at a (/$bunfs/root/chunk-qt5e0j2h.js:2:92434)
at run (/$bunfs/root/chunk-qt5e0j2h.js:2:97068)
at Ze (/$bunfs/root/chunk-wp49df1n.js:27:10030)
at run (/$bunfs/root/chunk-wp49df1n.js:27:11283)
at a (/$bunfs/root/chunk-qt5e0j2h.js:2:31593)
at runBinding (/$bunfs/root/chunk-qt5e0j2h.js:2:34042)
at Se (/$bunfs/root/chunk-qt5e0j2h.js:2:54571)
at Be (/$bunfs/root/chunk-qt5e0j2h.js:2:48704)
at Ne (/$bunfs/root/chunk-qt5e0j2h.js:2:47228)
at Te (/$bunfs/root/chunk-qt5e0j2h.js:2:46395)
at <anonymous> (/$bunfs/root/chunk-qt5e0j2h.js:2:67932)
at emitWithPriority (/$bunfs/root/chunk-43sqsmcd.js:28:10236)
at processParsedKey (/$bunfs/root/chunk-43sqsmcd.js:28:9705)
at handleStdinEvent (/$bunfs/root/chunk-43sqsmcd.js:203:5433)
at <anonymous> (/$bunfs/root/chunk-43sqsmcd.js:203:4996)
at drain (/$bunfs/root/chunk-43sqsmcd.js:34:9334)
at drainStdinParser (/$bunfs/root/chunk-43sqsmcd.js:203:4968)
at <anonymous> (/$bunfs/root/chunk-43sqsmcd.js:203:2834)
at emit (node:events:100:22)
at addChunk (internal/streams/readable:267:47)
at readableAddChunkPushByteMode (internal/streams/readable:245:18)
at internalRead (native)
at processTicksAndRejections (native)
- Lenguaje dominante
- TypeScript
- Estrellas
- 213k
- Forks
- 28.4k
- Merge medio
- 8 h 51 min
- PR fusionados (30 d)
- 289
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de anomalyco/opencode
-
reproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anomalyco/opencode#55369 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
reproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
anomalyco/opencode#55351 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
anomalyco/opencode#55285 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
opencode on clean macos zsh .export path not working because it append and it fails because no ~/.zshrc filePosiblemente ocupada @fihaaade la tomó hace 1 día. Abiertoreproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
anomalyco/opencode#55068 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
mcp: allowing an MCP tool by its documented name hides it; the bare name must be allowed tooAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
anomalyco/opencode#54919 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de anomalyco/opencode
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
one-zero-eight/apply-bot#39 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bigbluebutton/bbb-ui-components-react#108 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
high priority
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
CI-CMG/deep-sea-corals-exb#84 · 1 comentario ·