Repository navigation
Official CLI header alignment
The proxy's upstream request headers are now shaped like the real DevEco Code CLI's, verified by capturing both sides against a local TLS capture proxy.
Captured from the official CLI
User-Agent: deveco/<version> ...instead of a Chrome UAx-deveco-project: a 40-hex project id (previously absent)Session-Id/x-deveco-session:ses_...(previously 32-hex)x-deveco-task:msg_...(previously 32-hex)exitSessionQueuecarries thedeveco/<version>UAChat-Id,Authorization,Content-Typeandlangalready matched
Proxy changes
- New
defaultProjectId(): a 40-hex SHA1 of the working directory, overridable withDEVECO_PROJECT_ID upstreamSessionId()andnewUpstreamTaskId()produce official-shaped ids- Inference and exit queue now send
deveco/<PLUGIN_VERSION>as the UA - Removed the explicit
accept-language: zh-CN - Applied to both the proxy path and the forward-compat plugin path
Documentation
- The README now states that the built-in DevEco models require HUAWEI ID OAuth and do not accept API keys; API-key auth remains available for third-party providers only.
Remaining differences
x-deveco-clientcarries this project's version, not the official CLI build versionX-DevEco-Improvement-Enableddefaults tofalse; setDEVECO_TOOL_IMPROVEMENT=1to match an account that has opted in- undici adds
accept-language: *andsec-fetch-mode: cors; the official Bun CLI does not
Verification
- 184 tests passing across 16 files;
typecheck/lint/buildclean - Real official CLI requests for GLM-5.1 and GLM-5.3 were captured and compared
- Proxy smoke tests: OpenAI and Anthropic against both models, 4/4 HTTP 200