Skip to content

client state clobbered w/ multiple instances of opencode #19436

@elijahmorg

Description

@elijahmorg

Description

When you have multiple instances of opencode open (very normal) any client state can get clobbered.

If you have instance 1 and instance 2 open and you change the theme in instance 1 and then show sidebar in instance 2 the theme change saved by instance 1 will be clobbered by instance 2.

This applies to all of the current pattern client state json files (kv.json, prompt-history.jsonl for sure and I assume frecency.jsonl and models.json etc.

Plugins

None

OpenCode version

latest release and on dev branch.

Steps to reproduce

  1. Open two instances of opencode
  2. in instance one change the theme
  3. in instance two show sidebar (or any other value that gets saved to kv.json)
  4. close both instances and re-open and there is no theme change

You can do the same thing for prompt-history.

Screenshot and/or share link

Demo of bug
https://github.com/user-attachments/assets/a9fe26e4-9a3c-4a09-a395-5f260e71b353

Operating System

macOS

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions