opentui: fatal: undefined is not an object (evaluating 'color.buffer') #3102

Open
opened 2026-02-16 17:38:38 -05:00 by yindo · 8 comments
Owner

Originally created by @shahshlok on GitHub (Nov 24, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

TypeError: undefined is not an object (evaluating 'color.buffer')
    at setCursorColor (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:11120:51)
    at setCursorColor (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:15239:14)
    at <anonymous> (src/cli/cmd/tui/component/prompt/index.tsx:501:14)
    at runComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:724:3)
    at runTop (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:833:7)
    at runUserEffects (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:943:36)
    at runUpdates (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:849:17)
    at completeUpdates (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:900:17)
    at runUpdates (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:850:5)
    at move (src/cli/cmd/tui/context/local.tsx:73:11)
    at onSelect (src/cli/cmd/tui/app.tsx:301:19)
    at <anonymous> (src/cli/cmd/tui/component/dialog-command.tsx:22:16)
    at emit (node:events:95:22)
    at emitWithPriority (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:2350:38)
    at processInput (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:2321:14)
    at <anonymous> (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:14967:13)
    at emit (node:events:95:22)
    at process (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:5940:12)
    at <anonymous> (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:14909:23)
    at emit (node:events:95:22)
    at addChunk (internal:streams/readable:264:47)
    at readableAddChunkPushByteMode (internal:streams/readable:242:18)
    at internalRead (native:38:40)
    at processTicksAndRejections (native:7:39)...

OpenCode version

1.0.108

Steps to reproduce

  1. I have a custom tutor agent with the following:
---
description: "Global, read-only Tutor that teaches concepts, checks understanding, and helps you plan and build when ready."
mode: primary


tools:
  write: false
  edit: false
  patch: false
  bash: false
  read: true
  grep: true
  glob: true
  todoread: true
  webfetch: true

permission:
  write: deny
  edit: deny
  patch: deny
  bash: deny
  webfetch: ask
---

You are a friendly and insightful coding tutor.  
Your job is to **teach, ask, and guide**, not to code.  
You never modify files or run commands.  
You pause often to check the user’s familiarity before moving forward.
  1. Pressing tab to switch to it crashed it

This happened previously in issue #4648

  1. Additional Info:

I cannot switch to the tutor agent in 1.0.110 anymore. I can only cycle between Plan and Build

Screenshot and/or share link

No response

Operating System

MacOS

Terminal

Ghostty and Zed Integrated Terminal

Originally created by @shahshlok on GitHub (Nov 24, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description ``` TypeError: undefined is not an object (evaluating 'color.buffer') at setCursorColor (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:11120:51) at setCursorColor (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:15239:14) at <anonymous> (src/cli/cmd/tui/component/prompt/index.tsx:501:14) at runComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:742:22) at updateComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:724:3) at runTop (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:833:7) at runUserEffects (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:943:36) at runUpdates (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:849:17) at completeUpdates (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:900:17) at runUpdates (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:850:5) at move (src/cli/cmd/tui/context/local.tsx:73:11) at onSelect (src/cli/cmd/tui/app.tsx:301:19) at <anonymous> (src/cli/cmd/tui/component/dialog-command.tsx:22:16) at emit (node:events:95:22) at emitWithPriority (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:2350:38) at processInput (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:2321:14) at <anonymous> (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:14967:13) at emit (node:events:95:22) at process (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:5940:12) at <anonymous> (../../node_modules/.bun/@opentui+core@0.1.49+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:14909:23) at emit (node:events:95:22) at addChunk (internal:streams/readable:264:47) at readableAddChunkPushByteMode (internal:streams/readable:242:18) at internalRead (native:38:40) at processTicksAndRejections (native:7:39)... ``` ### OpenCode version 1.0.108 ### Steps to reproduce 1. I have a custom tutor agent with the following: ```markdown --- description: "Global, read-only Tutor that teaches concepts, checks understanding, and helps you plan and build when ready." mode: primary tools: write: false edit: false patch: false bash: false read: true grep: true glob: true todoread: true webfetch: true permission: write: deny edit: deny patch: deny bash: deny webfetch: ask --- You are a friendly and insightful coding tutor. Your job is to **teach, ask, and guide**, not to code. You never modify files or run commands. You pause often to check the user’s familiarity before moving forward. ``` 2. Pressing `tab` to switch to it crashed it This happened previously in issue #4648 3. Additional Info: I cannot switch to the tutor agent in 1.0.110 anymore. I can only cycle between Plan and Build ### Screenshot and/or share link _No response_ ### Operating System MacOS ### Terminal Ghostty and Zed Integrated Terminal
yindo added the opentuibug labels 2026-02-16 17:38:38 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 24, 2025):

This issue is a duplicate of an existing issue. Please check:

  • #4648: opentui: fatal: undefined is not an object (evaluating 'color.buffer')

Both issues report the identical error when pressing tab to switch agents, particularly with custom agent configurations. Your report even mentions issue #4648 explicitly. Consider consolidating discussion there to help the maintainers track the problem more effectively.

@github-actions[bot] commented on GitHub (Nov 24, 2025): This issue is a duplicate of an existing issue. Please check: - #4648: opentui: fatal: undefined is not an object (evaluating 'color.buffer') Both issues report the identical error when pressing tab to switch agents, particularly with custom agent configurations. Your report even mentions issue #4648 explicitly. Consider consolidating discussion there to help the maintainers track the problem more effectively.
Author
Owner

@rekram1-node commented on GitHub (Nov 24, 2025):

ahh okay

@rekram1-node commented on GitHub (Nov 24, 2025): ahh okay
Author
Owner

@rekram1-node commented on GitHub (Nov 25, 2025):

@shahshlok can you show me opencode debug config

@rekram1-node commented on GitHub (Nov 25, 2025): @shahshlok can you show me `opencode debug config`
Author
Owner

@shahshlok commented on GitHub (Nov 25, 2025):

@shahshlok can you show me opencode debug config

Sure,

  ~ ❯ opencode debug config
{
  "$schema": "https://opencode.ai/config.json",
  "tui": {
    "scroll_speed": 1
  },
  "agent": {
    "tutor": {
      "prompt": "You are a friendly and insightful coding tutor.  \nYour job is to **teach, ask, and guide**, not to code.  \nYou never modify files or run commands.  \nYou pause often to check the user’s familiarity before moving forward.\n\n### Core Loop\n1. **Teach** – Explain the concept simply with analogies and tiny pseudo code examples.  \n2. **Ask** – Pause and ask one conceptual question to gauge understanding.  \n   - Do not give a plan or coding checklist until the user shows clear comprehension.  \n3. **Plan** – Once they’re ready, outline a concise, actionable checklist for implementation.  \n4. **Task** – Assign one small, focused exercise. Provide hints only, never full code.  \n5. **Review** – Use a hybrid of checklist and short narrative feedback. Encourage, correct, and highlight improvements.\n\n### Behavior and Style\n- Tone: encouraging, clear, slightly creative — a buddy mentor, not a strict teacher.  \n- Always teach before suggesting a plan.  \n- Adapt difficulty dynamically: small → moderate → project-linked.  \n- Ask permission before web searches (keep citations minimal).  \n- Use `read`, `grep`, and `glob` to reference code context, never to edit.  \n- Show short snippets (5–10 lines max) and point to exact paths for deeper review.  \n- Never access sensitive files like `.env`, keys, or secrets.  \n- If the user struggles, reteach gently with new examples or analogies.\n\n### Progress Tracking\n- Use a global learning log at `~/.config/opencode/learning_log.md`.  \n- Read-only: you never write to it.  \n- At each session start, read and summarize the last 3 entries (if available).  \n- After every review, remind the user to append one line:\n  `YYYY-MM-DD | topic | what I learned | sticking point | next step`\n\n### Refusal Template\n> I can’t edit or write code for you, but here’s a plan you can follow and a small hint to guide your approach.",
      "tools": {
        "write": false,
        "edit": true,
        "patch": false,
        "bash": true,
        "read": true,
        "grep": true,
        "glob": true,
        "todoread": true,
        "webfetch": true
      },
      "description": "Global, read-only Tutor that teaches concepts, checks understanding, and helps you plan and build when ready.",
      "mode": "primary",
      "permission": {
        "edit": "ask",
        "bash": "ask",
        "webfetch": "ask"
      },
      "name": "tutor"
    }
  },
  "mode": {},
  "plugin": [],
  "command": {},
  "username": "shlokshah",
  "keybinds": {
    "leader": "ctrl+x",
    "app_exit": "ctrl+c,ctrl+d,<leader>q",
    "editor_open": "<leader>e",
    "theme_list": "<leader>t",
    "sidebar_toggle": "<leader>b",
    "status_view": "<leader>s",
    "session_export": "<leader>x",
    "session_new": "<leader>n",
    "session_list": "<leader>l",
    "session_timeline": "<leader>g",
    "session_share": "none",
    "session_unshare": "none",
    "session_interrupt": "escape",
    "session_compact": "<leader>c",
    "messages_page_up": "pageup",
    "messages_page_down": "pagedown",
    "messages_half_page_up": "ctrl+alt+u",
    "messages_half_page_down": "ctrl+alt+d",
    "messages_first": "ctrl+g,home",
    "messages_last": "ctrl+alt+g,end",
    "messages_copy": "<leader>y",
    "messages_undo": "<leader>u",
    "messages_redo": "<leader>r",
    "messages_toggle_conceal": "<leader>h",
    "model_list": "<leader>m",
    "model_cycle_recent": "f2",
    "model_cycle_recent_reverse": "shift+f2",
    "command_list": "ctrl+p",
    "agent_list": "<leader>a",
    "agent_cycle": "tab",
    "agent_cycle_reverse": "shift+tab",
    "input_clear": "ctrl+c",
    "input_forward_delete": "ctrl+d",
    "input_paste": "ctrl+v",
    "input_submit": "return",
    "input_newline": "shift+return,ctrl+j",
    "history_previous": "up",
    "history_next": "down",
    "session_child_cycle": "<leader>right",
    "session_child_cycle_reverse": "<leader>left",
    "terminal_suspend": "ctrl+z"
  }
}
@shahshlok commented on GitHub (Nov 25, 2025): > [@shahshlok](https://github.com/shahshlok) can you show me `opencode debug config` Sure, ```bash   ~ ❯ opencode debug config { "$schema": "https://opencode.ai/config.json", "tui": { "scroll_speed": 1 }, "agent": { "tutor": { "prompt": "You are a friendly and insightful coding tutor. \nYour job is to **teach, ask, and guide**, not to code. \nYou never modify files or run commands. \nYou pause often to check the user’s familiarity before moving forward.\n\n### Core Loop\n1. **Teach** – Explain the concept simply with analogies and tiny pseudo code examples. \n2. **Ask** – Pause and ask one conceptual question to gauge understanding. \n - Do not give a plan or coding checklist until the user shows clear comprehension. \n3. **Plan** – Once they’re ready, outline a concise, actionable checklist for implementation. \n4. **Task** – Assign one small, focused exercise. Provide hints only, never full code. \n5. **Review** – Use a hybrid of checklist and short narrative feedback. Encourage, correct, and highlight improvements.\n\n### Behavior and Style\n- Tone: encouraging, clear, slightly creative — a buddy mentor, not a strict teacher. \n- Always teach before suggesting a plan. \n- Adapt difficulty dynamically: small → moderate → project-linked. \n- Ask permission before web searches (keep citations minimal). \n- Use `read`, `grep`, and `glob` to reference code context, never to edit. \n- Show short snippets (5–10 lines max) and point to exact paths for deeper review. \n- Never access sensitive files like `.env`, keys, or secrets. \n- If the user struggles, reteach gently with new examples or analogies.\n\n### Progress Tracking\n- Use a global learning log at `~/.config/opencode/learning_log.md`. \n- Read-only: you never write to it. \n- At each session start, read and summarize the last 3 entries (if available). \n- After every review, remind the user to append one line:\n `YYYY-MM-DD | topic | what I learned | sticking point | next step`\n\n### Refusal Template\n> I can’t edit or write code for you, but here’s a plan you can follow and a small hint to guide your approach.", "tools": { "write": false, "edit": true, "patch": false, "bash": true, "read": true, "grep": true, "glob": true, "todoread": true, "webfetch": true }, "description": "Global, read-only Tutor that teaches concepts, checks understanding, and helps you plan and build when ready.", "mode": "primary", "permission": { "edit": "ask", "bash": "ask", "webfetch": "ask" }, "name": "tutor" } }, "mode": {}, "plugin": [], "command": {}, "username": "shlokshah", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d,<leader>q", "editor_open": "<leader>e", "theme_list": "<leader>t", "sidebar_toggle": "<leader>b", "status_view": "<leader>s", "session_export": "<leader>x", "session_new": "<leader>n", "session_list": "<leader>l", "session_timeline": "<leader>g", "session_share": "none", "session_unshare": "none", "session_interrupt": "escape", "session_compact": "<leader>c", "messages_page_up": "pageup", "messages_page_down": "pagedown", "messages_half_page_up": "ctrl+alt+u", "messages_half_page_down": "ctrl+alt+d", "messages_first": "ctrl+g,home", "messages_last": "ctrl+alt+g,end", "messages_copy": "<leader>y", "messages_undo": "<leader>u", "messages_redo": "<leader>r", "messages_toggle_conceal": "<leader>h", "model_list": "<leader>m", "model_cycle_recent": "f2", "model_cycle_recent_reverse": "shift+f2", "command_list": "ctrl+p", "agent_list": "<leader>a", "agent_cycle": "tab", "agent_cycle_reverse": "shift+tab", "input_clear": "ctrl+c", "input_forward_delete": "ctrl+d", "input_paste": "ctrl+v", "input_submit": "return", "input_newline": "shift+return,ctrl+j", "history_previous": "up", "history_next": "down", "session_child_cycle": "<leader>right", "session_child_cycle_reverse": "<leader>left", "terminal_suspend": "ctrl+z" } } ```
Author
Owner

@shahshlok commented on GitHub (Nov 25, 2025):

@rekram1-node one more thing, tab allows me to switch from Build to Plan but then pressing tab after that does not switch, it gets frozen on Plan mode.

I am happy to give you any data that you want to help you better understand the issue

@shahshlok commented on GitHub (Nov 25, 2025): @rekram1-node one more thing, `tab` allows me to switch from Build to Plan but then pressing `tab` after that does not switch, it gets frozen on Plan mode. I am happy to give you any data that you want to help you better understand the issue
Author
Owner

@shahshlok commented on GitHub (Nov 25, 2025):

I hope this helps

https://github.com/user-attachments/assets/f6c14810-e8fd-4d0c-b9a8-e74c84d5891d

@shahshlok commented on GitHub (Nov 25, 2025): I hope this helps https://github.com/user-attachments/assets/f6c14810-e8fd-4d0c-b9a8-e74c84d5891d
Author
Owner

@shahshlok commented on GitHub (Nov 27, 2025):

@rekram1-node I think I found the issue, i had a custom theme file which mimicked the VSCode Modern Theme. Upon removing that custom theme, everything seems to be working fine

@shahshlok commented on GitHub (Nov 27, 2025): @rekram1-node I think I found the issue, i had a custom theme file which mimicked the VSCode Modern Theme. Upon removing that custom theme, everything seems to be working fine
Author
Owner

@rekram1-node commented on GitHub (Dec 3, 2025):

@shahshlok any chance u can send the custom theme, want to make sure we handle this gracefully

@rekram1-node commented on GitHub (Dec 3, 2025): @shahshlok any chance u can send the custom theme, want to make sure we handle this gracefully
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3102