GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs: OPENCODE_SERVER_USERNAME is promised but never read — basic-auth username is hardcoded to 'opencode' · Issue #103 · developing-today-forks/opencode

docs: OPENCODE_SERVER_USERNAME is promised but never read — basic-auth username is hardcoded to 'opencode' #103

New issue
Copy link
New issue
Copy link
Closed
#313
Closed
docs: OPENCODE_SERVER_USERNAME is promised but never read — basic-auth username is hardcoded to 'opencode'#103
#313
Copy link
Labels
documentationImprovements or additions to documentationkind/docsDocumentation improvement or addition

Description

@dezren39
dezren39
opened on Oct 19, 2026
Issue body actions

Summary

The docs promise that the basic-auth username for serve/web can be overridden with OPENCODE_SERVER_USERNAME (default opencode). In this v2 codebase nothing reads that variable: the username is hardcoded to opencode on both the server and client sides, so setting the variable silently does nothing. A test even sets it, which makes the dead variable look supported.

Evidence (all on main 2d302d6718)

Docs promising the override:

  • packages/web/src/content/docs/server.mdx:39 — "The username defaults to opencode, or set OPENCODE_SERVER_USERNAME to override it. This applies to both opencode serve and opencode web."
  • packages/web/src/content/docs/web.mdx:89 — "The username defaults to opencode but can be changed with OPENCODE_SERVER_USERNAME."
  • packages/web/src/content/docs/cli.mdx:702 — env table: "OPENCODE_SERVER_USERNAME | Override basic auth username (default opencode)".
  • packages/web/src/content/docs/cli.mdx:126 and :378 — --username/-u flag rows: "Basic auth username (defaults to OPENCODE_SERVER_USERNAME or opencode)" (no such flag exists in packages/cli/src/commands/commands.ts).

Code hardcoding opencode and never reading the variable:

  • packages/server/src/auth.ts:19-21 — Config.configLayer accepts only a password and forces username: "opencode"; authorized() (line ~31) rejects any other username.
  • packages/server/src/process.ts:233 — ServerAuth.Config.of({ password: ..., username: "opencode" }).
  • packages/cli/src/env.ts:3-13 — the module that declares itself "Every environment variable the CLI reads, in one place" defines password (OPENCODE_PASSWORD / OPENCODE_SERVER_PASSWORD) and no username.
  • packages/cli/src/services/server-connection.ts:28 — client auth for an explicit --server hardcodes username: "opencode", so this CLI also cannot authenticate to a server that expects a different username.
  • packages/cli/src/services/standalone.ts:53 — standalone server auth hardcodes username: "opencode".
  • Repo-wide grep: OPENCODE_SERVER_USERNAME appears only in docs/translations and in packages/cli/test/standalone.test.ts:11, which sets it to "custom" and then asserts only HTTP 200 — the variable has no effect on the run, so the test gives false confidence that it is honored.

Corroboration that the fixed username is the deliberate v2 behavior: developing-today/openchamber packages/vscode/src/opencode.ts:95 comments "OpenCode 2 accepts only the opencode username; OPENCODE_SERVER_USERNAME is ignored." (The variable was a v1 feature; the docs are v1 leftovers.)

Why it matters

A user who follows the docs and sets OPENCODE_SERVER_USERNAME gets no error and no effect — the exact silent-failure shape that erodes trust in a security setting. Either the setting should work, or the docs and the misleading test should stop claiming it does.

Acceptance criteria

Pick one direction and apply it consistently:

  1. Implement it: read OPENCODE_SERVER_USERNAME in packages/cli/src/env.ts, thread it through the server auth config (packages/server/src/auth.ts / process.ts), the standalone service, and the --server client auth; add a test that a non-default username actually authenticates and the default one fails (and vice versa). Or:
  2. Align docs and test with the deliberate v2 behavior: remove the override claims from server.mdx, web.mdx, and cli.mdx (env table and the --username rows), state plainly that the username is always opencode, and drop the unused OPENCODE_SERVER_USERNAME from packages/cli/test/standalone.test.ts.

Either way, a grep for OPENCODE_SERVER_USERNAME afterwards should find it only where it is genuinely honored (direction 1) or nowhere outside a "v1 removed" note (direction 2).

Activity

  1. dezren39
    added a commit that references this issue on Oct 23, 2026

    docs: stop promising OPENCODE_SERVER_USERNAME — the v2 username is al…

    27e067f
  2. dezren39
    closed this as completedin #313on Oct 23, 2026
  3. dezren39
    added a commit that references this issue on Oct 23, 2026

    docs(roadmap): record the #103 completion in Done (#317) (#318)

    790e86b
  4. dezren39 commented on Nov 24, 2026

    @dezren39
    dezren39
    on Nov 24, 2026
    Author
    More actions

    AUDIT-7 Lane 2 slice 3 — closing evidence. Verified against the issue body and merged implementation PR(s):

    • PR #313 — docs: stop promising OPENCODE_SERVER_USERNAME — the v2 username is always opencode (merged 2026-10-23)

    The issue had zero comments in the fresh pre-action read; this comment records the missing close evidence.

  5. dezren39
    added
    kind/docsDocumentation improvement or addition
    documentationImprovements or additions to documentation
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationkind/docsDocumentation improvement or addition

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.