Skip to content

auth login stores empty token in auth.json #15057

Closed

Description

@Ayushlm10

Description

When running opencode auth login <url>, the token stored in ~/.local/share/opencode/auth.json is an empty string. The wellknown auth flow spawns a child process and reads the token from stdout. However, `proc.exited` is awaited before `text(proc.stdout)` starts consuming the stream. By the time stdout is read, the process has exited and the pipe is closed, so the token data is lost.

  1. The token field is ""

Expected: The token field should contain the actual token from the child process stdout.

Plugins

No response

OpenCode version

1.2.13

Steps to reproduce

  1. Run opencode auth login <url>
  2. Check ~/.local/share/opencode/auth.json
  3. The token field is ""

Screenshot and/or share link

No response

Operating System

macOS 26.0.1

Terminal

Ghostty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions