You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
opencode attach constructs the Basic auth header by hardcoding the username as "opencode", regardless of the OPENCODE_SERVER_USERNAME environment variable.
In packages/opencode/src/cli/cmd/tui/attach.ts, the auth header is built as:
This means opencode attach always authenticates as opencode even when the server requires a different username (e.g. when OPENCODE_SERVER_USERNAME is set). Authentication fails silently or produces an unhelpful error.
Plugins
No response
OpenCode version
1.2.27
Steps to reproduce
Run opencode serve (or connect to a remote server) with a non-default username configured via OPENCODE_SERVER_PASSWORD/OPENCODE_SERVER_USERNAME.
Set OPENCODE_SERVER_USERNAME=myuser and OPENCODE_SERVER_PASSWORD=mypassword in the client environment.
Run opencode attach.
Authentication fails — the wrong username (opencode) is sent instead of myuser.
Activity
fix(cli): read OPENCODE_SERVER_USERNAME in attach command
github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.