@magpie-community/opencode-workbuddy-auth 0.2.7 → 0.2.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.
- package/README.md +11 -10
- package/index.mjs +14 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -286,16 +286,17 @@ client sends it: WorkBuddy doesn't think when a chat names none, so
|
|
|
286
286
|
OpenCode's default variant got answers without thinking. An effort the
|
|
287
287
|
client names, `none` too, goes as it came.
|
|
288
288
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
289
|
+
One value differs from the config, measured with real requests:
|
|
290
|
+
DeepSeek-V4.1-Flash (and its paid `-sg` id) lists `none`, though the
|
|
291
|
+
config says it only reasons: WorkBuddy answers `reasoning_effort: "none"`
|
|
292
|
+
on it with no thinking at all (since 0.2.7, #563).
|
|
293
|
+
|
|
294
|
+
A model's context is the config's `maxInputTokens` on both sites. 0.2.7
|
|
295
|
+
capped DeepSeek-V4.1-Flash at 100000 on `workbuddy` (copilot.tencent.com)
|
|
296
|
+
from one report's error; China accounts took prompts up to 992,389 tokens
|
|
297
|
+
on it, so 0.2.8 lifted the cap (#561). A prompt WorkBuddy does find too
|
|
298
|
+
long ("prompt is too long: … > … maximum") is answered with its own 400,
|
|
299
|
+
passed on as it came, which magpie takes as the context overflowing.
|
|
299
300
|
|
|
300
301
|
A chat goes gzipped (`Content-Encoding: gzip`), as WorkBuddy's own client
|
|
301
302
|
sends its model requests (`RequestBodyGzip` in both builds' product.json).
|
package/index.mjs
CHANGED
|
@@ -81,9 +81,6 @@ const SITES = {
|
|
|
81
81
|
// where this build's API keys are made (see keyAccount)
|
|
82
82
|
keys: "https://www.workbuddy.cn/profile/keys",
|
|
83
83
|
models: CN_MODELS,
|
|
84
|
-
// the prompt a model takes here, where it is less than the config's
|
|
85
|
-
// maxInputTokens (see contextOf)
|
|
86
|
-
contextCap: { "deepseek-v4.1-flash": 100000 },
|
|
87
84
|
// it serves the Claude models on Anthropic's Messages API too (see
|
|
88
85
|
// nativeOf)
|
|
89
86
|
messages: true,
|
|
@@ -112,22 +109,17 @@ const SITES = {
|
|
|
112
109
|
},
|
|
113
110
|
}
|
|
114
111
|
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
function contextOf(site, model, said) {
|
|
127
|
-
const cap = site.contextCap?.[model]
|
|
128
|
-
if (!cap) return said
|
|
129
|
-
return typeof said === "number" && said > 0 ? Math.min(said, cap) : cap
|
|
130
|
-
}
|
|
112
|
+
// A model's context is its config's maxInputTokens, on both sites. 0.2.7
|
|
113
|
+
// capped deepseek-v4.1-flash at 100000 on copilot.tencent.com from one
|
|
114
|
+
// report's error ("prompt is too long: 100001 tokens > 100000 maximum"),
|
|
115
|
+
// and it was wrong: on 2026-10-31 China Free-plan accounts of three other
|
|
116
|
+
// users took 110,041 to 992,389-token prompts on it there, the whole prompt
|
|
117
|
+
// read (needles recalled), and the vendor's own refusal of 1,157,831 named
|
|
118
|
+
// 1048576 as the maximum (plugins#561). The cap made every client compact at
|
|
119
|
+
// 100k. Where a prompt really is too long, WorkBuddy's 400 says "prompt is
|
|
120
|
+
// too long" and goes to the client as it came (explained), which magpie
|
|
121
|
+
// reads as the context overflowing (context_length_exceeded): the agent is
|
|
122
|
+
// told to compact, and the account isn't rested for it.
|
|
131
123
|
|
|
132
124
|
// OFF_TAKEN are models that turn thinking off for reasoning_effort "none"
|
|
133
125
|
// though the config says onlyReasoning (so WorkBuddy's own client offers no
|
|
@@ -2960,7 +2952,7 @@ function variants(efforts) {
|
|
|
2960
2952
|
function configModels(site) {
|
|
2961
2953
|
return Object.fromEntries(site.models.map(([id, name, context, efforts]) => [id, {
|
|
2962
2954
|
name,
|
|
2963
|
-
limit: { context
|
|
2955
|
+
limit: { context, output: 0 },
|
|
2964
2956
|
tool_call: true,
|
|
2965
2957
|
// OpenCode (and magpie's host) read a config model's package and URL
|
|
2966
2958
|
// from provider: { npm, api }, not api
|
|
@@ -3155,7 +3147,7 @@ async function liveModels(site, a) {
|
|
|
3155
3147
|
const d = (cfg.models ?? []).find((x) => x.id === id)
|
|
3156
3148
|
const m = { id, name: d?.name || id }
|
|
3157
3149
|
if (d) {
|
|
3158
|
-
m.context =
|
|
3150
|
+
m.context = d.maxInputTokens
|
|
3159
3151
|
m.output = d.maxOutputTokens
|
|
3160
3152
|
m.images = d.supportsImages === true && !textOnly(site, id)
|
|
3161
3153
|
Object.assign(m, priceOf(d, cfg.modelPromotions))
|
|
@@ -3790,4 +3782,4 @@ export const WorkBuddyAuthPlugin = makePlugin(SITES.workbuddy)
|
|
|
3790
3782
|
export const WorkBuddyAIAuthPlugin = makePlugin(SITES["workbuddy-ai"])
|
|
3791
3783
|
|
|
3792
3784
|
// for tests
|
|
3793
|
-
export const _internal = { idFor,
|
|
3785
|
+
export const _internal = { idFor, OFF_TAKEN, replyAfterToolsOn, withDefaultEffort, defaultEffortOf, gzipped, FREE_ONLY, PRICE_TTL, keyAccount, remoteConfig, cycleOf, typeUnions, systemAsUser, systemKey, DEFAULT_SYSTEM, EDGE_READS, fitShape, replyAfterTools, AFTER_TOOLS_REFUSED, enterpriseUsageOf, accountName, notDesktop, textOnly, runsOutOf, packagesOf, endOf, enterpriseHeaders, enterpriseOf, liveModels, browserSignIn, withSystem, asReasoning, normalizeToolChoice, fitTools, fitted, renamed, unsaid, FILTER_SAYS, unflagged, usageOf, desktopHeld, explained, REFUSED_HINT, RESTRICTED_HINT, EXHAUSTED_HINT, REFUSED_DOC, commaPaused, commaPausedOn, opened, freeCredits, creditsOf, priceOf, fresh, SITES, renewing, renewed, SESSION, attend, scopeOf, turnKey, conversationKey, signatureOf, isMessages, withoutUnsigned, withoutSignedThinking, prepared, answeredBefore, nativeOf, modelOf, configModels, freeWindowOf, tokensShort, freeWindowRows, freeWindowLedger, readLedgerTail, pinned, rowTime, rowAccount, ofAccount, windowOffset, windowReset, FREE_WINDOW_MODELS, FREE_WINDOW_SPAN, FREE_WINDOW_GAP, FREE_WINDOW_LEAD, checkinOf, API_MESSAGES: NPM_MESSAGES, API_CHAT: NPM }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magpie-community/opencode-workbuddy-auth",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "OpenCode provider plugins for WorkBuddy's plans: WorkBuddy (CodeBuddy, copilot.tencent.com) and WorkBuddy AI (www.workbuddy.ai)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|