fix(auth): opencode desktop server unauthorized bugfix on subagent spawn (#1399)

* fix(auth): opencode desktop server unauthorized bugfix on subagent spawn

* refactor(auth): add runtime guard and throw on SDK mismatch

- Add JSDoc with SDK API documentation reference
- Replace silent failure with explicit Error throw when OPENCODE_SERVER_PASSWORD is set but client structure is incompatible
- Add runtime type guard for SDK client structure
- Add tests for error cases (missing _client, missing setConfig)
- Remove unrelated bun.lock changes

Co-authored-by: dan-myles <dan-myles@users.noreply.github.com>

---------

Co-authored-by: YeonGyu-Kim <code.yeon.gyu@gmail.com>
Co-authored-by: dan-myles <dan-myles@users.noreply.github.com>
This commit is contained in:
dan
2026-02-03 20:07:02 -06:00
committed by GitHub
parent 2dc241cbbe
commit a7262000ff
4 changed files with 163 additions and 0 deletions
+1
View File
@@ -39,3 +39,4 @@ export * from "./connected-providers-cache"
export * from "./session-utils"
export * from "./tmux"
export * from "./model-suggestion-retry"
export * from "./opencode-server-auth"