zen-useragent
A DeepSeek Harness (DSH) plugin that patches pi-ai request headers and openai-completions request bodies for OpenCode ZEN free models, using opencode identity headers, a real account-known session ID, and an OAuth token read from the local opencode client database. It targets reported 429 FreeUsageLimitError, 400 MissingSessionID, 401 api_key_expired, and 403 FreeTierError responses, and documents a restart after install or upgrade to confirm patch activation.
Installation
dsh plugin --profile web add github:jiujiezongheti/zen-useragentOverview
A DeepSeek Harness (DSH) plugin that patches pi-ai request headers and openai-completions request bodies for OpenCode ZEN free models, using opencode identity headers, a real account-known session ID, and an OAuth token read from the local opencode client database. It targets reported 429 FreeUsageLimitError, 400 MissingSessionID, 401 api_key_expired, and 403 FreeTierError responses, and documents a restart after install or upgrade to confirm patch activation.
- Allows provider-configured headers such as User-Agent to override attribution headers for pi-ai API requests.
- Adds opencode identity headers for requests whose merged User-Agent contains opencode, including x-opencode-client and x-opencode-session.
- Reads a real account-known session ID from the local opencode client database and re-resolves it at runtime every 60s.
- Uses the opencode client OAuth access token when valid; omits Authorization when the token is expired or unavailable.
- Patches pi-ai buildParams to add a read shell tool when missing for provider opencodezen or baseUrl containing opencode.
- Leaves explicit provider headers untouched; auto-completion or overrides do not change same-named headers you configure.
- Patches are idempotent, use atomic writes, and skip with log messages when target files are unrecognized or not writable.
- Requires a restart after install or upgrade to confirm the patch; startup logs show patched, upgraded, or already patched.