opencode icon indicating copy to clipboard operation
opencode copied to clipboard

`[object Object]` error output when running opencode over SSH

Open nicehiro opened this issue 1 month ago • 17 comments

Description

Hi,

When running opencode via SSH on a remote server, the application outputs [object Object] instead of a proper error message or UI. Additionally, terminal escape sequences are not handled correctly, resulting in garbled output.

OpenCode version

1.0.134

Steps to reproduce

  1. On Ubuntu 20 docker image, install opencode using: curl -fsSL https://opencode.ai/install | bash
  2. Run opencode --print-logs --log-level DEBUG

Screenshot and/or share link

root@subgoalvla-111010-task1-0:~/openpi# opencode --print-logs --log-level DEBUG
INFO  2025-12-07T15:09:43 +169ms service=default version=1.0.134 args=["--print-logs","--log-level","DEBUG"] opencode
[object Object]
root@subgoalvla-111010-task1-0:~/openpi# :>|ghostty 1.2.3^[\^[[?0u^[[4;1720;3000t

Operating System

Ubuntu 22.04

Terminal

Using ghostty on MacOS to connect remote by ssh

nicehiro avatar Dec 07 '25 15:12 nicehiro

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

  • #4430: Phantom input on startup when running over SSH (Windows Terminal -> Remote SSH)
  • #3769: SSH session with iTerm2 auto-writes 'iTerm2 3.6.5Gi-1;invalid payload' in agent panel
  • #2773: Clipboard copy issues in remote SSH console (opentui-related)
  • #3320: Bash commands not working in SSH session
  • #4517: Theme and terminal output issues on macOS

These issues also report SSH connection problems with terminal escape sequences and output corruption. The [object Object] error and garbled escape sequences you're seeing may be related to how opentui handles terminal detection and output formatting over SSH.

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

github-actions[bot] avatar Dec 07 '25 15:12 github-actions[bot]

I encountered this error even though I wasn't using SSH.

➜  ~ opencode --print-logs --log-level DEBUG
INFO  2025-12-10T11:38:03 +222ms service=default version=1.0.141 args=["--print-logs","--log-level","DEBUG"] opencode
[object Object]
➜  ~

Operating System

Linux archhostname 6.17.9-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Mon, 24 Nov 2025 15:21:16 +0000 x86_64 GNU/Linux

Terminal

Ghostty

junjieit avatar Dec 10 '25 11:12 junjieit

The error on my end occurred because I had a network proxy enabled. The error likely originates from this location: https://github.com/sst/opencode/blob/dev/packages/sdk/js/src/v2/gen/client/client.gen.ts#L196

junjieit avatar Dec 11 '25 04:12 junjieit

The error on my end occurred because I had a network proxy enabled.

Same here. I also have a local proxy set.

nicehiro avatar Dec 11 '25 05:12 nicehiro

You can bypass the local address first.

export NO_PROXY=localhost,127.0.0.1,::1

junjieit avatar Dec 11 '25 05:12 junjieit

You can bypass the local address first.

export NO_PROXY=localhost,127.0.0.1,::1

Thanks for the suggestion. However, my situation is a bit different — I actually need the proxy to access the full network (e.g., npm registries and other external resources). If I set NO_PROXY, the opencode CLI itself seems to work, but it still fails to launch properly because some dependencies can't be downloaded without the proxy.

nicehiro avatar Dec 11 '25 06:12 nicehiro