opencode icon indicating copy to clipboard operation
opencode copied to clipboard

opentui: fatal: TextNodeRenderable only accepts strings, TextNodeRenderable instances, or StyledText instances

Open denis-vilantis opened this issue 1 month ago • 8 comments

Description

Error: TextNodeRenderable only accepts strings, TextNodeRenderable instances, or StyledText instances
    at add (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:189562:20)
    at _insertNode (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:196726:15)
    at appendNodes (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:196609:17)
    at insertExpression (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:196478:24)
    at runComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195643:24)
    at updateComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195626:17)
    at createRenderEffect (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195225:22)
    at insert (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:196429:23)
    at children (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:216073:15)
    at <anonymous> (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:196299:26)
    at runComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195643:24)
    at updateComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195626:17)
    at createMemo (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195246:22)
    at render (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:216066:25)
    at untrack (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195418:15)
    at <anonymous> (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:215907:38)
    at runComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195643:24)
    at updateComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195626:17)
    at createMemo (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195246:22)
    at ToolPart (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:215852:31)
    at untrack (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195418:15)
    at <anonymous> (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:196299:26)
    at runComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195643:24)
    at updateComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195626:17)
    at createMemo (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195246:22)
    at createRoot (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195188:22)
    at <anonymous> (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:196049:34)
    at untrack (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195418:15)
    at runComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195643:24)
    at updateComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195626:17)
    at createMemo (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195246:22)
    at AssistantMessage (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:215644:27)
    at untrack (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195418:15)
    at <anonymous> (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:196335:21)
    at runComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195643:24)
    at updateComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195626:17)
    at createMemo (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195246:22)
    at createRoot (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195188:22)
    at <anonymous> (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:196049:34)
    at untrack (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195418:15)
    at runComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195643:24)
    at updateComputation (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195626:17)
    at runTop (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195746:24)
    at runQueue (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195833:11)
    at completeUpdates (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195782:15)
    at runUpdates (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:195768:20)
    at setStore (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/index.js:199244:10)
    at sync (/nix/store/qh5663if2bihwa8d9j3365wb4rqw97c4-opencode-1.0.138/lib/opencode/dist/i...

OpenCode version

1.0.138

Steps to reproduce

work on a problem in Plan mode with Qwen3 Coder. At some random point it crashes. Restarting the app and re-opening the same session leads to immediate crash, repeatedly.

Screenshot and/or share link

Image

Operating System

nixos unstable

Terminal

xterm-kitty

denis-vilantis avatar Dec 15 '25 14:12 denis-vilantis

This issue appears to be a duplicate of an existing issue. Please check:

  • #4730: opentui: fatal: TextNodeRenderable only accepts strings, TextNodeRenderable instances, or StyledText instances

Both issues report the same error occurring in the opentui rendering layer. Feel free to ignore if your case has different symptoms or context.

github-actions[bot] avatar Dec 15 '25 14:12 github-actions[bot]

Can you replicate this on latest?

rekram1-node avatar Dec 15 '25 15:12 rekram1-node

Can you replicate this on latest?

$ opencode --version
1.0.153

opening one of the crashing sessions:

Image

denis-vilantis avatar Dec 15 '25 16:12 denis-vilantis

Do you have some custom tool or mcp tool that has special inputs or outputs that could be causing this?

can you share output of: opencode debug config

rekram1-node avatar Dec 15 '25 16:12 rekram1-node

maybe you can do: opencode export > session.json

so i can see the session that caused crashed?

rekram1-node avatar Dec 15 '25 16:12 rekram1-node

there's some spicy token stuff in those files, i'm gonna have to clean them up before posting. there are indeed some MCPs in my config. the last tool call in the crashing session however was simple bash:

$ tail -n200 sesh.json
            }
          }
        },
        {
          "id": "prt_b22b00f2d001x5seeBznYq7933",
          "sessionID": "ses_4dd7d86d6ffeS3T18TJfn1Sj2L",
          "messageID": "msg_b22afde26001kE0LXh7kVMLxd0",
          "type": "step-finish",
          "reason": "tool-calls",
          "snapshot": "86e3712edc85b3045286eea33d7a7b2ed60b4920",
          "cost": 0.01203045,
          "tokens": {
            "input": 54265,
            "output": 97,
            "reasoning": 0,
            "cache": {
              "read": 0,
              "write": 0
            }
          }
        }
      ]
    },
    {
      "info": {
        "id": "msg_b22b00f75002tzkOZgmmNVCcme",
        "sessionID": "ses_4dd7d86d6ffeS3T18TJfn1Sj2L",
        "role": "assistant",
        "time": {
          "created": 1765813522293,
          "completed": 1765813525378
        },
        "parentID": "msg_b22afa009001ON4x2KCb26ij2Z",
        "modelID": "openrouter/qwen/qwen3-coder",
        "providerID": "vilantis",
        "mode": "plan",
        "path": {
          "cwd": "/home/denis/repos/vilantis/ai-platform",
          "root": "/home/denis/repos/vilantis/ai-platform"
        },
        "cost": 0.01211667,
        "tokens": {
          "input": 54631,
          "output": 103,
          "reasoning": 0,
          "cache": {
            "read": 0,
            "write": 0
          }
        },
        "finish": "tool-calls"
      },
      "parts": [
        {
          "id": "prt_b22b01671001n5xIst1OXe52Qb",
          "sessionID": "ses_4dd7d86d6ffeS3T18TJfn1Sj2L",
          "messageID": "msg_b22b00f75002tzkOZgmmNVCcme",
          "type": "step-start",
          "snapshot": "86e3712edc85b3045286eea33d7a7b2ed60b4920"
        },
        {
          "id": "prt_b22b01672001Ewz5AVSO6tJ1h3",
          "sessionID": "ses_4dd7d86d6ffeS3T18TJfn1Sj2L",
          "messageID": "msg_b22b00f75002tzkOZgmmNVCcme",
          "type": "text",
          "text": "Now let me test the dynamic client registration endpoint:",
          "time": {
            "start": 1765813525330,
            "end": 1765813525330
          }
        },
        {
          "id": "prt_b22b01b00001SZjuPTahr04gBu",
          "sessionID": "ses_4dd7d86d6ffeS3T18TJfn1Sj2L",
          "messageID": "msg_b22b00f75002tzkOZgmmNVCcme",
          "type": "tool",
          "callID": "call_c74453b77080c0df",
          "tool": "bash",
          "state": {
            "status": "error",
            "input": {
              "command": {
                "client_name": "Test Client",
                "redirect_uris": [
                  "http://localhost:3000/callback"
                ],
                "grant_types": [
                  "authorization_code"
                ],
                "response_types": [
                  "code"
                ],
                "token_endpoint_auth_method": "none"
              },
              "description": "Test client registration"
            },
            "error": "Error: The bash tool was called with invalid arguments: [\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received object\"\n  }\n].\nPlease rewrite the input so it satisfies the expected schema.",
            "time": {
              "start": 1765813525251,
              "end": 1765813525253
            }
          }
        },
        {
          "id": "prt_b22b01b53001XYD4lOdSmBg1fP",
          "sessionID": "ses_4dd7d86d6ffeS3T18TJfn1Sj2L",
          "messageID": "msg_b22b00f75002tzkOZgmmNVCcme",
          "type": "step-finish",
          "reason": "tool-calls",
          "snapshot": "86e3712edc85b3045286eea33d7a7b2ed60b4920",
          "cost": 0.01211667,
          "tokens": {
            "input": 54631,
            "output": 103,
            "reasoning": 0,
            "cache": {
              "read": 0,
              "write": 0
            }
          }
        }
      ]
    },
    {
      "info": {
        "id": "msg_b22b01b9a0023jt6v6OYPGMG2G",
        "sessionID": "ses_4dd7d86d6ffeS3T18TJfn1Sj2L",
        "role": "assistant",
        "time": {
          "created": 1765813525402,
          "completed": 1765813546159
        },
        "error": {
          "name": "MessageAbortedError",
          "data": {
            "message": "The operation was aborted."
          }
        },
        "parentID": "msg_b22afa009001ON4x2KCb26ij2Z",
        "modelID": "openrouter/qwen/qwen3-coder",
        "providerID": "vilantis",
        "mode": "plan",
        "path": {
          "cwd": "/home/denis/repos/vilantis/ai-platform",
          "root": "/home/denis/repos/vilantis/ai-platform"
        },
        "cost": 0,
        "tokens": {
          "input": 0,
          "output": 0,
          "reasoning": 0,
          "cache": {
            "read": 0,
            "write": 0
          }
        }
      },
      "parts": [
        {
          "id": "prt_b22b054a1001BG9kqar6kQOz9c",
          "sessionID": "ses_4dd7d86d6ffeS3T18TJfn1Sj2L",
          "messageID": "msg_b22b01b9a0023jt6v6OYPGMG2G",
          "type": "step-start",
          "snapshot": "86e3712edc85b3045286eea33d7a7b2ed60b4920"
        },
        {
          "id": "prt_b22b054a1002lmatLqDUKI6R4D",
          "sessionID": "ses_4dd7d86d6ffeS3T18TJfn1Sj2L",
          "messageID": "msg_b22b01b9a0023jt6v6OYPGMG2G",
          "type": "text",
          "text": "Let me properly test the client registration:",
          "time": {
            "start": 1765813543485,
            "end": 1765813543485
          }
        },
        {
          "id": "prt_b22b05590001YjXbRuWaOUqJ2v",
          "sessionID": "ses_4dd7d86d6ffeS3T18TJfn1Sj2L",
          "messageID": "msg_b22b01b9a0023jt6v6OYPGMG2G",
          "type": "tool",
          "callID": "call_EoBfTulM56GoAUkcYVj9ZzNS",
          "tool": "bash",
          "state": {
            "status": "error",
            "input": {
              "command": "curl -s -X POST http://localhost:3000/register -H \"Content-Type: application/json\" -d '{\"client_name\": \"Test Client\", \"redirect_uris\": [\"http://localhost:3000/callback\"], \"grant_types\": [\"authorization_code\"], \"response_types\": [\"code\"], \"token_endpoint_auth_method\": \"none\"}' | jq '.'",
              "description": "Test client registration with MS 365 MCP server"
            },
            "error": "Tool execution aborted",
            "time": {
              "start": 1765813546159,
              "end": 1765813546159
            }
          }
        }
      ]
    }
  ]
}

hope that helps. please lmk if you still need the ~full config & session dump, I'll clean them up and post.

denis-vilantis avatar Dec 15 '25 17:12 denis-vilantis

Ideally if you can send full session I'll be able to replicate & debug easier.

You can dm me on discord if u prefer

rekram1-node avatar Dec 15 '25 22:12 rekram1-node

encrypted_files_rekram1-node_20251216_113726.tar.gz.age.gz

Hi @rekram1-node, I've encrypted the opencode-crash-debug directory for you using your GitHub SSH key.

The encrypted file is: encrypted_files_rekram1-node_20251216_113726.tar.gz.age

To decrypt the file, you'll need to:

  1. Unwrap it from gz first because github doesn't like .age files 🤷 )
  2. Use the age tool with your private SSH key (for the pubkey you have in your github profile):
    age -d -i ~/.ssh/your_private_key_file encrypted_files_rekram1-node_20251216_113726.tar.gz.age > decrypted.tar.gz
    tar xzf decrypted.tar.gz
    

This will extract the opencode-crash-debug directory that was causing the TextNodeRenderable error. Hope that helps. Thank you for looking into this!

denis-vilantis avatar Dec 16 '25 10:12 denis-vilantis