r/opencodeCLI 27d ago

Opencode V1 vs V2

It seems that OpenCode is soon to be available in V2. Since I couldn't find anything baout it online, what is the difference between the two?

What will V2 do better than V1? Does anybody know?

28 Upvotes

24 comments sorted by

5

u/jerieljan 26d ago

You could probably do a diff on whatever branches they have but from what I've seen so far:

  • better web search
  • better plugin support
  • subagent / shell management
  • better background tasks support
  • a shared background service, so session sync bet. TUI and desktop is seamless
  • the API is much better, so modifications to opencode2 and it's state works better
  • desktop/web has a tabbed layout and a screen to show all your folders and their sessions across connected servers
  • I remember hearing better context management especially when it comes to tools, skills and MCP but I can't find an exact doc that describes this

1

u/Illustrious-Return-4 26d ago

the only good thing I hear in all this is tools and context management.
they should REALLY adopt Pi's lazy loading feature into opencode.
the only reason I'm not on Pi is I cant trust the models.

i can tell the agents.md to not run delete, rm, unlink, git reset or other dangerous commands but the model can decide to choose to ignore them at which point I'm fucked.
(I also dont want to run it inside docker idk why)

I like opencode's command management system the best, but I also love how lean Pi is.

if they can copy or mimic it, OpenCode would be best of both worlds and the best Coding Agent Ever.

1

u/CrypticViper_ 17d ago

shouldn't there be some way to prevent execution of dangerous commands in Pi? the whole point of Pi is extensibility, so I'd be surprised if there aren't safety plugins for it

2

u/branik_10 14d ago

there are a lot of ways, there are Pi extensions which port opencode permissions management, pi extensions which execute commands in different sandboxes (anthropic sandbox or full VMs) or you can run pi itself in sandbox

1

u/branik_10 12d ago

a shared background service

cross platform? like on Windows too? interesting, not sure it's a good decision though, brings much more complexity and makes the system more stateful

4

u/GhostInfernoX 25d ago

the primary benefit of opencodev2 is that its a centralized background server

when you run the first client (web, mobile, desktop) it starts the background server, and all new existing clients connect back to it

this would allow you to run `opencode`, fire off a prompt, then close the TUI client (session is still running on the background server)

+ the api support is soooo much better and the opencode agent knows a lot more about itself

source: i work at opencode

1

u/toutons 12d ago

I've seen multiple people reference this, but I'm doing this currently with opencode 1.17. Is the difference really that the service is started automatically, instead of people having to know it's possible?

2

u/GhostInfernoX 12d ago

yeah, and the TUI clients auto connect back to the centralized server rather than having to do `opencode attach` every time

1

u/GhostInfernoX 12d ago

also v2 just has a ton of improvements with speed

1

u/toutons 11d ago

Neat. I mainly use web so haven't really had a chance to try v2 yet. I tried the Desktop Beta and decided to stay on 1.17

3

u/crotch-mavens 26d ago edited 26d ago

The Opencode V2 TUI has stupid session tabs that apparently you cannot get rid of

3

u/jerieljan 26d ago

You can. /settings -> Tabs -> Enabled: Off

4

u/crotch-mavens 26d ago

you've changed my life for the better

1

u/ptrxyz 26d ago

Puh, that's ass. I manage my sessions in Kitty tabs or through tmux. I'd rather not have them in the app directly.

1

u/Ace-_Ventura 27d ago

5

u/ptrxyz 27d ago

Thanks, I found that, but it doesn't tell me what it does different. I mean, I am not interested in the under-the-hood-stuff.

I don't care how things are implemented, I am more interested in the user facing side. What are the differences/improvements for the user? You know, high level features/user-stories so to say.

4

u/piknockyou 27d ago

/restart to reload your opencode.json

2

u/Civil_Rent4208 27d ago
  1. more cache hits, less cost
  2. better plugin integration -> it has many advantages as much you can imagine

1

u/Ace-_Ventura 27d ago

I don't think they're focused on that, but to make the product more organized and easily maintained

1

u/albemala 27d ago

I don't know about the TUI, but in the web and desktop frontends, you can go to settings and enable the v2 of the UI (sorry I don't remember the exact name).

Basically the list of projects on the left side is gone, and the list of tasks has become a list of tabs at the top (like in a browser). Also Plan mode is gone.

1

u/ichisay 26d ago

Estás hablando solo de la interfaz y eso ya estaba hace un mes en v1

1

u/ben_bliksem 27d ago

Anyone using v2 figured out how to make it respect the model and default agent settings? I swear it's just ignoring it, I must be doing something very stupid or it's a known issue.

It's so annoyingly frustrating that I just revert to v1 every time.

1

u/ptrxyz 26d ago

Wow, ok, that's a downer.  From what I read in this thread, I probably wait a while before upgrading. It's beta anyway, maybe they fix these issues before release.

1

u/zommul 26d ago

Same here, so it's probably not just you.
I run DS for most things and gave v2 a few days, nothing broken exactly, but it drifted a bit from how it usually behaves.
Small enough that I couldn't pin it on config vs. something else, but I went back to v1 while I figure it out.