[PR #11594] fix(plugin): pass server auth headers to plugin client #13854

Closed
opened 2026-02-16 18:18:41 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11594

State: closed
Merged: No


Summary

When the OpenCode server is protected with a password (OPENCODE_SERVER_PASSWORD), plugins lose the ability to create sub-sessions or interact with the server because the injected SDK client lacks authentication headers.

This PR fixes this by:

  1. Detecting the OPENCODE_SERVER_PASSWORD environment variable.
  2. Injecting the corresponding Authorization (Basic Auth) header into the createOpencodeClient configuration during plugin initialization.

Impact

  • Fixes Unauthorized errors in tools like look_at and other sub-agent calls when server password is set.
  • Aligns with the expected behavior where internal components automatically inherit server credentials.
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11594 **State:** closed **Merged:** No --- ## Summary When the OpenCode server is protected with a password (`OPENCODE_SERVER_PASSWORD`), plugins lose the ability to create sub-sessions or interact with the server because the injected SDK client lacks authentication headers. This PR fixes this by: 1. Detecting the `OPENCODE_SERVER_PASSWORD` environment variable. 2. Injecting the corresponding `Authorization` (Basic Auth) header into the `createOpencodeClient` configuration during plugin initialization. ## Impact - Fixes `Unauthorized` errors in tools like `look_at` and other sub-agent calls when server password is set. - Aligns with the expected behavior where internal components automatically inherit server credentials.
yindo added the pull-request label 2026-02-16 18:18:41 -05:00
yindo closed this issue 2026-02-16 18:18:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13854