opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Unstable TUI

Open randomm opened this issue 3 weeks ago • 4 comments

Description

Good work on the v1.0! I have been testing it for just over a day now. At least on my system (Mac M2, Ghostty) the v1 UI is quite unstable. I have also, as many other users, have experienced disappearing content area, that sporadically comes back, or you have to try to change the theme to make it redraw. This still happening with v1.0.25.

However, this is a new one I started seeing today after upgrading to 1.0.25, please see the screen grab. The "saving lockfile" thing stays there for a long time, assuming until a bigger redraw of the UI.

OpenCode version

1.0.25

Steps to reproduce

Difficult to say. I use a somewhat complex opencode.json with many subagents, not sure if that affects. Happy to test any alternative versions.

Screenshot and/or share link

Image

Operating System

macOS 15.3.2

Terminal

Ghostty

randomm avatar Nov 05 '25 11:11 randomm

This issue might be a duplicate of existing issues. Please check:

  • #3905: Describes the same issue where "message history randomly flickers/disappears" and "seems to happen in nearly every long-running session" - very similar to the disappearing content area you describe
  • #3776: Reports "Screen becomes completely blank" and mentions that "switching to a theme" brings the contents back - matches your observation about changing themes to make it redraw
  • #3669: "[BUG] Unable to Load Old Sessions" where "Conversation history flashes and disappears upon revisiting" - similar flickering behavior
  • #3719: "navigating away from an active session causes it to flicker/be blank when returning to it" - similar UI instability issues

Several of these issues also mention macOS and terminal-specific problems (including Ghostty), and the symptoms of disappearing content, flickering UI, and needing theme changes to redraw are very consistent across these reports.

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Nov 05 '25 11:11 github-actions[bot]

Also, myself as well as some other users have experienced a serious slowdown of the app as the session gets older. Not sure if that is related to the number of subagent sessions I have. I use a project manager agent and a set of system prompts that then direct the project manager to delegate to subagents. In my normal workflow there are many many subagent sessions, so potentially a lot of content in subagent tabs. Personally I would be fine for opencode TUI to start deleting the subagent sessions after a while. I usually only look at the latest one, or the current one that is working.

randomm avatar Nov 05 '25 11:11 randomm

Can confirm the slowdown on Mac M1 on Alacritty also. Aside from the other mentioned blackouts, the biggest issue I have been facing is inability to scroll when expected to provide a permission response.

It looks like new content is getting is getting drawn after permission event, and the performance issue is preventing scroll to see what happened.

This happens without subagent session also. Its possible the Anthropic Sonnet 4.5 from Anthropic provider is also slow, probably needs a lot more stability before I'd be able to use new version.

shubham-root avatar Nov 05 '25 13:11 shubham-root

I can also confirm a slowdown on Alacritty on Apple Silicon; it's sometimes unusable at all. I don't think it's about the agents, etc, but it definitely fails with long/big sessions. In 0.x, it was working perfectly fine. In 1.x, it's barely usable.

pigmej avatar Nov 05 '25 13:11 pigmej

Also, myself as well as some other users have experienced a serious slowdown of the app as the session gets older. Not sure if that is related to the number of subagent sessions I have. I use a project manager agent and a set of system prompts that then direct the project manager to delegate to subagents. In my normal workflow there are many many subagent sessions, so potentially a lot of content in subagent tabs. Personally I would be fine for opencode TUI to start deleting the subagent sessions after a while. I usually only look at the latest one, or the current one that is working.

Same here, I started using such a workflow just before the switch to v1 and it's mostly unusable now. (WezTerm on Mac M2 Pro)

dpausp avatar Nov 05 '25 14:11 dpausp

sorry about this - we're doing another pass on performance for the more intense sessions tonight

we'll track it down - can stay on 0.15.x in the meantime

thdxr avatar Nov 05 '25 16:11 thdxr

Some more anecdotal datapoints, but I've been seeing this on my M series MBPs in both wezterm and neovim-within-wezterm using neovim's embedded terminal. As @randomm similarly noticed it's most evident with longer sessions.

roshbhatia avatar Nov 05 '25 17:11 roshbhatia

I'm not sure if it's related, but around 60% of the opencode starts, I have a mess in the TUI. Each mouse move or keyboard tap prints something like coordinates:

Image

Usually, I close it and try again. But sometimes, I have to try several times.

I'm using Alacritty / Arch Linux (omarchy).

fabioalmeidaweb avatar Nov 05 '25 23:11 fabioalmeidaweb

@fabioalmeidaweb it only happens when u are piping right? or is this a constant issue

rekram1-node avatar Nov 05 '25 23:11 rekram1-node

I have this issue without piping, but on Apple silicon with alacrity. It happens randomly so I cannot figure out what causes it. After exiting opencode instance I need to "reset" the terminal.

pigmej avatar Nov 05 '25 23:11 pigmej

yeah it happens randomly for me too - needs a restart

we released some perf fixes in 1.0.30 - can people try opening their fat sessions in there and let us know if it's any better?

more perf fixes are on the way, being worked on rn

thdxr avatar Nov 05 '25 23:11 thdxr

more fixes in 1.0.31

thdxr avatar Nov 06 '25 01:11 thdxr

Hi, i'm note sure i'm writing in the right Github issue but I encountered a bug which seems to be the same as the one mentioned by @fabioalmeidaweb

I'm using Alacritty + Zellij but I also tested this on a standard XFCE4 terminal and the problem is the same.

Here is an animated gif showing it, I can open opencode few times (3 to 5) and use it as expected without bug.

But sometimes / often (1 to 4 times on 5) I cannot enter CTRL+{some_key} shortcuts and the area to input text is "strange" (it has a black background bellow the characters instead of the actual opencode background).

On this animated gif I open OpenCode several times, after each execution I enter the CTRL+X keybinding. We can see that it works the first times but the last one when I enter CTRL + X we see ^X in the textarea instead, and then if I we move the mouse it displays lot of strange stuffs.

Image

I upgraded OpenCode to version 1.0.34 and the bug is still there.

Hope those information help more.

Thanks

bgaillard avatar Nov 06 '25 07:11 bgaillard

i am on 1.0.34, an M4 and kitty and am also having a lot of hangs with large but recently compacted sessions:

  • eg. pressing "enter" to confirm/allow an action was instantanious before, now takes a few seconds, such that i am unsure whether my command was registered in the first place
  • starting the TUI in the first place does is a lot slower too
  • i can't press f2 to switch betweens models anymore
  • i can't use ctrl u to delete the full command anymore (eg. after doing undo)
  • more often Error: The socket connection was closed unexpectedly. For more information, pass verbose: true in the second argument to fetch() (using anthropic models, on about every fourth message), but that might be unstable internet while travelling.

johannesrave avatar Nov 06 '25 08:11 johannesrave

I have one Macbook M2 on the v1.x series and another in the old v0.x series. The latter is perfectly functional, but any real world working on the v1.x series, currently, is not very possible. It gets very sluggish, to the point of ctrl+c not even working, or ctrl+z either. Have to shut down terminal tab and try again with opencode -c, in which point it sometimes is possible to continue. But any interaction with longer sessions, especially with ones that have lots of subagent sessions, is close to impossible. I am going to downgrade my other laptop from v1.x back to the older one until v1.x is stable.

Not complaining, this is stellar stuff that you guys are doing, and I understand that my use case - with tens and tens of subagent tabs/sub-sessions per session is probably a fringe use case, albeit a very useful one as I get a very long main chat with the orchestrator and with subagents doing all the heavy lifting.

randomm avatar Nov 06 '25 08:11 randomm

@fabioalmeidaweb it only happens when u are piping right? or is this a constant issue

I'm not piping, just running the "opencode" command. Sometimes works, sometimes it doesn't.

fabioalmeidaweb avatar Nov 06 '25 12:11 fabioalmeidaweb

@fabioalmeidaweb Ive just installed and not working for me to. Tried via pacman and curl install. Simply nothing happens.

                   .%;888:8898898:                helio@neo
                 x;XxXB%89b8:b8%b88:              ---------
              .8Xxd                8X:.           OS: Garuda Linux x86_64
            .8Xx;                    8x:.         Host: Predator PHN16-71 (V1.18)
          .tt8x          .d            x88;       Kernel: 6.17.6-zen1-1-zen
       .@8x8;          .db:              xx@;     Uptime: 1 hour, 3 mins
     ,tSXX°          .bbbbbbbbbbbbbbbbbbbB8x@;    Packages: 1882 (pacman)[stable]
   .SXxx            bBBBBBBBBBBBBBBBBBBBbSBX8;    Shell: fish 4.1.2
 ,888S                                     pd!    Resolution: 5120x1440
8X88/                                       q     DE: GNOME 49.1
8X88/                                             WM: Mutter (Wayland)
GBB.                                              WM Theme: Tahoe-Dark
 x%88        d888@8@X@X@X88X@@XX@@X@8@X.          Theme: Tahoe-Dark [GTK2/3/4]
   dxXd    dB8b8b8B8B08bB88b998888b88x.           Icons: MacTahoe-dark [GTK2/3/4]
    dxx8o                      .@@;.              Terminal: GNOME Terminal 3.58.0
      dx88                   .t@x.                Terminal Font: FiraCode Nerd Font Mono 12
        d:SS@8ba89aa67a853Sxxad.                  CPU: 13th Gen Intel(R) Core(TM) i7-13650HX (20) @ 4.900GHz
          .d988999889889899dd.                    GPU: GeForce RTX 4060 Max-Q / Mobile
                                                  GPU: Raptor Lake-S UHD Graphics
                                                  Memory: 11134MiB / 23741MiB

⚡ opencode --print-logs
INFO  2025-11-06T18:25:42 +168ms service=default version=1.0.35 args=["--print-logs"] opencode
INFO  2025-11-06T18:25:42 +0ms service=project directory=/home/helio fromDirectory
INFO  2025-11-06T18:25:42 +7ms service=config path=/home/helio/.config/opencode/config.json loading
INFO  2025-11-06T18:25:42 +1ms service=config path=/home/helio/.config/opencode/opencode.json loading
INFO  2025-11-06T18:25:42 +0ms service=config path=/home/helio/.config/opencode/opencode.jsonc loading
INFO  2025-11-06T18:25:42 +1ms service=bun cmd=["/home/helio/.opencode/bin/opencode","add","@opencode-ai/[email protected]","--exact"] cwd=/home/helio/.config/opencode running
INFO  2025-11-06T18:25:42 +1ms service=bun cmd=["/home/helio/.opencode/bin/opencode","add","@opencode-ai/[email protected]","--exact"] cwd=/home/helio/.opencode running


insign avatar Nov 06 '25 18:11 insign

@pigmej if u run opencode --print-logs what do u see

rekram1-node avatar Nov 06 '25 18:11 rekram1-node

can we make a seperate issue for the thing where opencode starts up weirdly and needs a restart? i have that as well sometimes

thdxr avatar Nov 06 '25 19:11 thdxr

we landed some more perf fixes in 1.0.36 specifically for long sessions

also what is helpful is doing opencode export > dump.json and picking a session you have an issue with. if you can send us that dump we can load it locally and dig deeper - already fixed a few issues this way

thdxr avatar Nov 06 '25 19:11 thdxr

OK we figured out the issue it being broken on start and needing a restart. when the autoupdate process in the background runs it was breaking things - this is why it was flakey

just pushed the fix for that so no need for a new issue

thdxr avatar Nov 07 '25 00:11 thdxr

Hi, thanks a lot @thdxr, I just updated OpenCode to version 1.0.39 and I can confirm what I described in my previous comment is working now and there are not bugs anymore 👍 .

bgaillard avatar Nov 07 '25 07:11 bgaillard

WIth 1.0.39 I also stopped having most of my issues so far.

pigmej avatar Nov 07 '25 09:11 pigmej

Here too, thanks.

insign avatar Nov 07 '25 09:11 insign

OK we figured out the issue it being broken on start and needing a restart. when the autoupdate process in the background runs it was breaking things - this is why it was flakeyjust pushed the fix for that so no need for a new issue

Nice catch! Thank you!

Is this autoupdate process triggered even if I installed using a package manager? In my case, I'm using "yay" (AUR), but when I try to "opencode upgrade", I'm unable to do so because it's managed by a package manager.

fabioalmeidaweb avatar Nov 07 '25 13:11 fabioalmeidaweb

yeah it won't do it for anything that requires sudo

thdxr avatar Nov 12 '25 02:11 thdxr

going to mark this as completed, any remaining issues if you run into them please open a new issue - ty

thdxr avatar Nov 12 '25 02:11 thdxr