Skip to content

V2 TUI: stale client duplicates tool calls until reopened #35639

Description

@opencode-agent

Summary

An already-open V2 TUI began rendering duplicate tool activity: repeated shell commands and repeated "Preparing patch" entries appeared while the agent edited files. Closing and reopening the TUI rebuilt the view and showed the actual tool calls and edits accurately.

This looks like stale/replayed client state rather than the model intentionally issuing every call twice. The report occurred around shared-service restart/reconnect activity and recovered after reopening the client.

Environment

  • OpenCode version: V2 development build; exact build unavailable from the report
  • OS: macOS (visible in screenshot)
  • Terminal: tmux; underlying terminal unavailable
  • Shell: Unavailable
  • Install/channel: opencode2 development channel
  • Active plugins: Unavailable
  • Model: Little Frank (anomaly / OpenAI), default variant

Reproduction

Observed once; the precise trigger is not yet known.

  1. Keep a V2 TUI open across a stale-client or shared-service restart/reconnect condition.
  2. Run an agent task that edits files and executes shell commands.
  3. Observe the TUI tool timeline.
  4. Close and reopen the TUI for the same session.

Expected Behavior

Each persisted tool call and file edit is rendered once, and reconnecting converges the current TUI view to authoritative session state.

Actual Behavior

The open TUI showed duplicated shell commands and repeated patch-preparation entries. Ryan reported that after closing and reopening opencode2, the same session displayed the real file calls and edits accurately.

Additional Context

Metadata

Metadata

Assignees

Labels

2.0bugSomething isn't workingtui

Type

No type

Fields

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