Repository navigation
docs: stop promising OPENCODE_SERVER_USERNAME — the v2 username is always opencode - #313
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 137dd9d775
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ### Authentication | ||
|
|
||
| Set `OPENCODE_SERVER_PASSWORD` to protect the server with HTTP basic auth. The username defaults to `opencode`, or set `OPENCODE_SERVER_USERNAME` to override it. This applies to both `opencode serve` and `opencode web`. | ||
| Set `OPENCODE_SERVER_PASSWORD` to protect the server with HTTP basic auth. The username is always `opencode`; it cannot be changed. This applies to both `opencode serve` and `opencode web`. |
There was a problem hiding this comment.
Update localized pages with the authentication correction
Users routed to any of the 17 localized versions still see OPENCODE_SERVER_USERNAME and --username documented as supported in the corresponding cli.mdx, server.mdx, and web.mdx files (for example, French server.mdx:39). The deferred locale-sync will not correct them because .github/workflows/docs-locale-sync.yml:22 disables the job, so this fix leaves non-English users following credentials that the server rejects; update the localized counterparts as part of this change.
Useful? React with 👍 / 👎.
|
Merging per the standing sweep directive, with the infrastructure caveat recorded here:
|
Fixes #103
Problem
The docs promise that the basic-auth username for
serve/webcan be overridden withOPENCODE_SERVER_USERNAME, but nothing in this v2 codebase reads that variable: the username is hardcoded toopencodein the server auth config (packages/server/src/auth.ts), the server process (packages/server/src/process.ts), the--serverclient auth (packages/cli/src/services/server-connection.ts) and the standalone service (packages/cli/src/services/standalone.ts). The v2 command spec inpackages/cli/src/commands/commands.tsdefines no--usernameflag either. A CLI test even set the variable, making the dead setting look supported.As the issue's own evidence notes, the fixed username is the deliberate v2 behaviour — developing-today/openchamber's vscode integration already documents that "OpenCode 2 accepts only the
opencodeusername; OPENCODE_SERVER_USERNAME is ignored."Solution (direction 2 from the issue: align docs and test with v2)
packages/web/src/content/docs/server.mdx— the Authentication section now states the username is alwaysopencodeand cannot be changed.packages/web/src/content/docs/web.mdx— same correction.packages/web/src/content/docs/cli.mdx— removed theOPENCODE_SERVER_USERNAMErow from the environment-variable table and both--usernameflag rows (attach and run tables); the three affected tables were re-padded by prettier, which is the only other change in that file. Translations are left to the usual docs locale-sync flow, matching how earlier docs fixes in this repo handled them.packages/cli/test/standalone.test.ts— dropped the unusedOPENCODE_SERVER_USERNAME: "custom"env entry; the test asserted only HTTP 200, which the variable never influenced.After this change, a grep for
OPENCODE_SERVER_USERNAMEin the English docs andpackages/clifinds nothing — the variable is no longer promised anywhere it is not honoured.Verification
git grep OPENCODE_SERVER_USERNAMEover the English docs andpackages/cli: no matches (remaining hits are translations only).bun test test/standalone.test.tsinpackages/cli: 1 pass — the test passes unchanged without the dead variable.prettier --checkon all four changed files: clean.bun typecheckinpackages/cli: (see PR checks; run locally before merge where the sandbox allows).Need help on this PR? Tag
@codesmith-botwith what you need.