opencode-qwen-cli-auth 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +7 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -166,8 +166,13 @@ export const QwenAuthPlugin = async (_input) => {
166
166
  * CLI goc gui header nay de server nhan biet auth method
167
167
  */
168
168
  "chat.headers": async (input, output) => {
169
- if (input.provider?.info?.id === PROVIDER_ID) {
170
- output.headers["X-DashScope-AuthType"] = "qwen-oauth";
169
+ try {
170
+ if (input?.provider?.info?.id === PROVIDER_ID && output?.headers) {
171
+ output.headers["X-DashScope-AuthType"] = "qwen-oauth";
172
+ }
173
+ }
174
+ catch (_) {
175
+ // Khong de loi hook lam treo request
171
176
  }
172
177
  },
173
178
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-qwen-cli-auth",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Alibaba Qwen OAuth authentication plugin for opencode - use your Qwen account instead of API keys",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",