Skip to content

Commit b664511

Browse files
docs: clarify OpenCode auth state precedence in deployments (#284)
1 parent cbaaa14 commit b664511

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ opencode models
4949
opencode serve --hostname 127.0.0.1 --port 4096
5050
```
5151

52+
Treat the deployed OpenCode user's HOME/XDG config directories as part of the
53+
runtime state. If a packaged or service-managed deployment appears to ignore
54+
fresh provider env vars, inspect that user's persisted OpenCode auth/config
55+
files before assuming the A2A adapter layer is overriding credentials.
56+
5257
Then start `opencode-a2a` against that upstream:
5358

5459
```bash
@@ -132,6 +137,9 @@ This repository improves the service boundary around OpenCode, but it does not
132137
turn OpenCode into a hardened multi-tenant platform.
133138

134139
- `A2A_BEARER_TOKEN` protects the A2A surface.
140+
- Provider auth and default model configuration remain on the OpenCode side; deployment-time
141+
precedence details and HOME/XDG state impact are documented in
142+
[docs/guide.md](docs/guide.md#troubleshooting-provider-auth-state).
135143
- `A2A_CLIENT_BEARER_TOKEN` is used for outbound peer calls initiated by the
136144
server-side `a2a_call` tool.
137145
- Provider auth and default model configuration remain on the OpenCode side.

docs/guide.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ starting that upstream process:
139139
If your provider uses environment variables for auth, export them before
140140
starting `opencode serve`.
141141

142+
Do not assume startup-script env vars always erase previously persisted
143+
OpenCode auth state for the deployed user. When debugging provider-auth
144+
surprises, inspect the deployed user's HOME/XDG config directories and the
145+
OpenCode files stored there before concluding that `opencode-a2a` changed the
146+
credential selection.
147+
142148
Then start `opencode-a2a` against that explicit upstream URL:
143149

144150
```bash
@@ -151,6 +157,23 @@ OPENCODE_WORKSPACE_ROOT=/abs/path/to/workspace \
151157
opencode-a2a serve
152158
```
153159

160+
## Troubleshooting Provider Auth State
161+
162+
If one deployment works while another fails against the same upstream provider,
163+
check the deployed OpenCode user's local state before assuming the difference
164+
comes from the `opencode-a2a` package itself.
165+
166+
- Provider auth and service-level model defaults belong to `opencode serve`.
167+
- The deployed user's HOME/XDG config directories are operational input.
168+
- Existing OpenCode auth/config files may still influence runtime behavior even
169+
when you also inject provider env vars from a process manager or shell
170+
wrapper.
171+
- Compare the deployed user's OpenCode auth/config files, HOME/XDG values, and
172+
effective workspace directory before blaming the A2A adapter layer.
173+
- For OpenCode-specific auth/config troubleshooting, inspect files such as
174+
`~/.local/share/opencode/auth.json` and `~/.config/opencode/opencode.json`
175+
(or the equivalent XDG-resolved paths for that service user).
176+
154177
## Core Behavior
155178

156179
- The service forwards A2A `message:send` to OpenCode session/message calls.

0 commit comments

Comments
 (0)