@magpie-community/opencode-qoder-auth 0.2.18 → 0.2.19

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 (3) hide show
  1. package/README.md +33 -0
  2. package/index.mjs +2 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -247,6 +247,39 @@ International campaign discovery was checked with a real account on
247
247
  omitting either header hid them. This verification only queried the
248
248
  activity; a live claim was not performed.
249
249
 
250
+ ## Credits available, but a request is refused
251
+
252
+ A positive credit balance does not guarantee a queue slot or access to
253
+ every model. Use the model ids listed for that particular account and
254
+ region. Do not infer another account's permission from its balance.
255
+
256
+ Qoder code **10605**, including `RESOURCE_LIMIT`, `serviceAvailable` or
257
+ `isQueued` details, is a resource/queue answer. Keep its suggested retry
258
+ delay; repeatedly signing in does not free that queue. Since **0.2.18**
259
+ ([#185](https://github.com/magpie-community/plugins/pull/185)), a 10605 led
260
+ by a BOM or wrapped in an outer message is read as busy too; see
261
+ [#167](https://github.com/magpie-community/plugins/issues/167) for the broader report.
262
+ That parser fix does not remove the provider's limit or prove that every
263
+ live 401 had the same cause. A timeout likewise does not establish an
264
+ empty wallet or an expired login.
265
+
266
+ For a bounded offline reproduction, run `packages/qoder/busy.test.mjs`
267
+ from #185 in an isolated temporary HOME. It compares plain queue JSON,
268
+ BOM-prefixed JSON and known message wrappers, keeping explicit login and
269
+ credit failures distinct. Extracting a JSON body from a translated log
270
+ cannot recover the original wire bytes; synthetic wrappers demonstrate
271
+ parser behavior, not which wrapper a historical request actually used.
272
+ After selecting a local fix with magpie's `plugin use`, confirm which spec
273
+ serves `qoder` in `plugin list`; a patched checkout alone does not change
274
+ the running provider.
275
+
276
+
277
+ For native check-in, an existing `CLAIMED` result is not a new credit grant.
278
+ The host's recheck/cache behavior is tracked in
279
+ [magpie#2696](https://github.com/yetone/magpie/issues/2696). Verify a new
280
+ claim against the vendor record; a successful activity query alone is not
281
+ proof that credits arrived.
282
+
250
283
  ## Not here
251
284
 
252
285
  - Qoder's usage and quota display.
package/index.mjs CHANGED
@@ -1708,9 +1708,8 @@ const makePlugin = (site) => async ({ client }) => {
1708
1708
  try {
1709
1709
  m = (await models(cred)).find((x) => x.key === chat.model) ?? (await models(cred, true)).find((x) => x.key === chat.model)
1710
1710
  } catch (e) {
1711
- // the built-in answered any failure to read the list 400
1712
- // (QoderModelOf), a refused one included, marking nothing
1713
- return errorResponse({ status: 400, message: e.message })
1711
+ if (e instanceof SignInGone || e?.expired) return signedInError(e)
1712
+ return errorResponse({ status: 502, message: e?.message ?? String(e) })
1714
1713
  }
1715
1714
  if (!m) return errorResponse({ status: 400, message: `unknown or disabled model "${chat.model}"` })
1716
1715
  const CHAT_URL = siteOf(site, cred).api + CHAT_PATH
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-qoder-auth",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "description": "Qoder subscriptions in OpenCode and magpie: Qoder (qoder.com) and Qoder CN (qoder.cn)",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",