Description
The collector.sh script makes requests to the OpenCode GO Zen API without the required x-opencode-session header. Starting 09/06, requests missing this header may error.
Affected endpoints
GET /zen/go/v1/models
GET /zen/go/v1/usage
Error message from OpenCode GO
Some of your requests to OpenCode Go are missing an x-opencode-session header. If we don't have this we cannot properly optimize our service. Starting 09/06 requests missing this header may error.
Suggested fix
Generate a stable UUID per installation and include it as x-opencode-session header in all curl requests. Example:
SESSION_ID_FILE="${HOME}/.local/share/opencode/go-usage-session-id"
if [[ -f "$SESSION_ID_FILE" ]]; then
SESSION_ID=$(<"$SESSION_ID_FILE")
else
SESSION_ID=$(cat /proc/sys/kernel/random/uuid)
mkdir -p "$(dirname "$SESSION_ID_FILE")"
printf '%s' "$SESSION_ID" > "$SESSION_ID_FILE"
fi
# Add to curl calls:
curl -H "x-opencode-session: $SESSION_ID" ...
Environment
- Plugin version: 1.0.0
- OS: Linux (Arch/Omarchy)
Description
The collector.sh script makes requests to the OpenCode GO Zen API without the required
x-opencode-sessionheader. Starting 09/06, requests missing this header may error.Affected endpoints
GET /zen/go/v1/modelsGET /zen/go/v1/usageError message from OpenCode GO
Suggested fix
Generate a stable UUID per installation and include it as
x-opencode-sessionheader in all curl requests. Example:Environment