Skip to content

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

Closed

Description

@shahshlok

Description

TypeError: undefined is not an object (evaluating 'color.buffer')
    at setCursorColor (../../node_modules/.bun/@[email protected]+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:11120:51)
    at setCursorColor (../../node_modules/.bun/@[email protected]+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/[email protected]/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:724:3)
    at runTop (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:833:7)
    at runUserEffects (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:943:36)
    at runUpdates (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:849:17)
    at completeUpdates (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:900:17)
    at runUpdates (../../node_modules/.bun/[email protected]/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/@[email protected]+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:2350:38)
    at processInput (../../node_modules/.bun/@[email protected]+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:2321:14)
    at <anonymous> (../../node_modules/.bun/@[email protected]+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:14967:13)
    at emit (node:events:95:22)
    at process (../../node_modules/.bun/@[email protected]+81ecd8642a1892ca/node_modules/@opentui/core/index-ztfy2qy3.js:5940:12)
    at <anonymous> (../../node_modules/.bun/@[email protected]+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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 25, 2025
  2. github-actions commented on Nov 25, 2025

    @github-actions
    Contributor

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

    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.

  3. self-assigned this
    on Nov 25, 2025
  4. rekram1-node commented on Nov 25, 2025

    @rekram1-node
    Collaborator

    ahh okay

  5. rekram1-node commented on Nov 25, 2025

    @rekram1-node
    Collaborator

    @shahshlok can you show me opencode debug config

  6. shahshlok commented on Nov 25, 2025

    @shahshlok
    Author

    @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"
      }
    }
  7. shahshlok commented on Nov 25, 2025

    @shahshlok
    Author

    @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

  8. shahshlok commented on Nov 25, 2025

    @shahshlok
    Author

    I hope this helps

    Screen.Recording.2025-11-24.at.10.47.48.PM.mp4
  9. shahshlok commented on Nov 27, 2025

    @shahshlok
    Author

    @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

  10. rekram1-node commented on Dec 3, 2025

    @rekram1-node
    Collaborator

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

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions