Skip to content

[Bug] opencodeProvider fails with password-protected OpenCode server #174

Description

@catan271

What's wrong? Maybe some steps to reproduce.

The opencodeProvider auto-capture path fails with an unauthorized error when the OpenCode server is started with a password. This is how I run OpenCode through OpenChamber.

Steps to reproduce

  1. Start the OpenCode server with password authentication enabled through OpenChamber.

  2. Install and enable opencode-mem.

  3. Configure the OpenCode-backed provider, for example:

    {
      "opencodeProvider": "provider-name",
      "opencodeModel": "model-name"
    }
  4. Use OpenCode normally and wait for the idle auto-capture operation.

Actual behavior

The auto-capture request fails with unauthorized when it calls the OpenCode session API. The OpenCode-backed memory capture therefore does not work with a password-protected server.

Expected behavior

The plugin should reuse the authenticated OpenCode transport, or provide a documented way to pass the server authentication to its session API requests, so opencodeProvider works when the server requires a password.

Where does it happen?

OpenCode-backed AI provider requests used by auto-capture, specifically the temporary session create/prompt/delete requests.

The current source appears to:

  • derive the server URL and an optional host fetch in src/index.ts;
  • create a separate SDK client with only { baseUrl } in src/services/ai/opencode-sdk-client.ts;
  • send the raw session requests in src/services/ai/opencode-provider.ts with only Content-Type headers.

This appears to omit or lose the password-based server authentication when the host fetch is unavailable or does not forward it.

Version (if known)

  • opencode-mem: Not known
  • OpenCode: Not known
  • OpenChamber: Not known

Screenshots / recordings (optional)

N/A

Logs (optional)

unauthorized

No credentials or authorization headers are included here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions