anomalyco / anomalyco/opencode

api.ui.dialog.replace() resets size to medium

Open
#44,754 0 comments 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Aug 24, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

api.ui.dialog.setSize("large") and setSize("xlarge") do not survive the next replace().

Host replace() always writes size back to "medium" before swapping the stack. Plugins that size first, then replace, always get the medium width (60) instead of large (88) or xlarge (116).

@tarquinen/opencode-dcp does exactly that for /dcp: setSize("xlarge") then replace(). The xlarge request is discarded.

setSize should persist across replace(), or replace should take the size so callers do not have to win a race against the reset.

Related: #44755 (host Dialog pins tall panels at height / 4 instead of vertical center).

Plugins

@tarquinen/opencode-dcp (repro via /dcp). Any plugin that calls setSize then replace.

OpenCode version

1.18.22

Steps to reproduce
  1. In a TUI plugin:
    api.ui.dialog.setSize("xlarge")
    api.ui.dialog.replace(() => /* any panel */)
    
  2. Measure the panel width.
  3. It is 60 (medium), not 116 (xlarge).
Screenshot and/or share link
Operating System

Linux

Terminal

Not terminal-specific. Confirmed in 1.18.22 replace(): it always setStore("size", "medium").

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.