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
{{ message }}
Repository navigation
M2 decision: OpenCodeClientOptions.Password semantics — unset vs empty vs whitespace (C16) #20
Source: multi-agent review of PR #16, UNVERIFIED-FINDER (verify while fixing). 2026-08-13. M-anchor: M2 (decide before breadth multiplies public options). Maintainer decision required — public API semantics.
Pipeline resolves the explicit option through string.IsNullOrEmpty(password) and suppresses auth through the same predicate (src/OpenCode.Sdk/Internal/Pipeline.cs:33-38). Consequences: whitespace-only " " bypasses the OPENCODE_SERVER_PASSWORD env fallback and is sent as a real Basic password; Password = "" is indistinguishable from unset, so an explicitly empty password cannot be represented. OpenCodeClientOptions.Password docs say only "When unset" (OpenCodeClientOptions.cs:13-18).
Recommendation:null = unset (env fallback); "" and whitespace-only = ArgumentException (fail loudly — the server always generates a password, pair always prints one; an "explicitly empty password" mode does not exist upstream, so we should not invent semantics for it). Document the property accordingly. Alternative if upstream ever supports passwordless serve: "" = explicit no-auth; that door stays open as an additive change.
Sealed and landed on feature/m2-first-breadth-batch @ 2be2d0f: null = unset (OPENCODE_SERVER_PASSWORD fallback); empty or whitespace-only refused with ArgumentException at construction — the server always generates a password, so an explicitly blank credential has no upstream meaning to model. The "" = explicit no-auth door stays available as an additive change if upstream ever ships passwordless serve. Covered by PipelineTests (blank variants refused before any request; null keeps the once-at-construction env resolution).
Follow-up (2026-08-14, research log Session 22 / Q89–Q90): the environment-fallback half of this decision is revised on new upstream evidence — the v2 client library reads no environment (the CLI consumer resolves OPENCODE_PASSWORD → OPENCODE_SERVER_PASSWORD and passes the value in), so the SDK's OPENCODE_SERVER_PASSWORD fallback was removed in a0c83a9; consumers resolve the environment themselves (or bind it via configuration in the Extensions package). The blank-refusal half of this decision stands unchanged; Password = null now plainly means anonymous requests, matching v2's optional auth.
Activity
fix(sdk): refuse a blank explicit password (#20)
Blind-Striker commentedon Aug 14, 2026
Sealed and landed on feature/m2-first-breadth-batch @ 2be2d0f: null = unset (OPENCODE_SERVER_PASSWORD fallback); empty or whitespace-only refused with ArgumentException at construction — the server always generates a password, so an explicitly blank credential has no upstream meaning to model. The "" = explicit no-auth door stays available as an additive change if upstream ever ships passwordless serve. Covered by PipelineTests (blank variants refused before any request; null keeps the once-at-construction env resolution).
docs: seal the alignment batch and hand it to the next session
feat(sdk): reshape construction, options, and DI onto .NET conventions
Blind-Striker commentedon Aug 14, 2026
Follow-up (2026-08-14, research log Session 22 / Q89–Q90): the environment-fallback half of this decision is revised on new upstream evidence — the v2 client library reads no environment (the CLI consumer resolves
OPENCODE_PASSWORD→OPENCODE_SERVER_PASSWORDand passes the value in), so the SDK'sOPENCODE_SERVER_PASSWORDfallback was removed ina0c83a9; consumers resolve the environment themselves (or bind it via configuration in the Extensions package). The blank-refusal half of this decision stands unchanged;Password = nullnow plainly means anonymous requests, matching v2's optional auth.fix(sdk): land the small confirmed review fold-ins