dsh-plugin-subscription-oauth 0.12.7 → 0.12.8

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.
@@ -167,10 +167,13 @@ export class WorkBuddyAdapter extends LlmAdapter {
167
167
  'Content-Type': 'application/json',
168
168
  'Accept': 'text/event-stream',
169
169
  ...workbuddyHeaders(token),
170
- // Name the chat the way WorkBuddy's own client does: without these the gateway
171
- // counts the request under no client and can cut the stream.
170
+ // Name the chat the way WorkBuddy's own client does: the conversation, the
171
+ // turn, and the message. Without these the gateway counts the request under no
172
+ // client and cuts the stream, which is why the reply stopped after a few seconds.
172
173
  'X-Conversation-Message-ID': randomHex(),
173
174
  'X-Request-ID': randomHex(),
175
+ 'X-Conversation-Request-ID': randomHex(),
176
+ 'X-Conversation-ID': randomHex(),
174
177
  },
175
178
  body: JSON.stringify(body),
176
179
  signal: watchdog.signal,
@@ -299,6 +302,20 @@ export class WorkBuddyAdapter extends LlmAdapter {
299
302
  catch {
300
303
  continue;
301
304
  }
305
+ // WorkBuddy names a refusal mid-stream (an error frame, or a body with a non-zero
306
+ // code): surface it instead of reading the rest as silence, so the turn fails with
307
+ // the reason rather than stopping after a few empty seconds.
308
+ const wireError = chunk.error ?? chunk.choices?.[0]?.delta;
309
+ if (wireError !== undefined && wireError !== null && typeof wireError === 'object') {
310
+ const message = wireError.message;
311
+ if (typeof message === 'string' && message !== '')
312
+ throw new Error(`WorkBuddy: ${message}`);
313
+ }
314
+ const wireCode = chunk.code;
315
+ if (typeof wireCode === 'number' && wireCode !== 0) {
316
+ const msg = chunk.msg;
317
+ throw new Error(`WorkBuddy: ${typeof msg === 'string' ? msg : `error ${wireCode}`}`);
318
+ }
302
319
  const delta = chunk.choices?.[0]?.delta?.content;
303
320
  if (typeof delta === 'string' && delta !== '') {
304
321
  if (!started) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-subscription-oauth",
3
- "version": "0.12.7",
3
+ "version": "0.12.8",
4
4
  "description": "Use subscription accounts as DeepSeek Harness LLM providers — Kimi Code (OAuth device flow), Grok / X Premium (OIDC + PKCE), Google Antigravity (Google OAuth + Cloud Code Assist) and GLM / BigModel (ZCode's browser sign-in) — with per-model visibility, drag-to-reorder Auto fallback and plan quotas from the web Settings page",
5
5
  "license": "MIT",
6
6
  "author": "EricFL1998",