7b42e404f5f656d7bfb4aa5c7ddbcd1031264a86
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f4d48ac3ee |
workbuddy 0.1.43: a chat names the model's default effort as WorkBuddy's client does, and goes gzipped
troilus1011 on X: WorkBuddy's DeepSeek in OpenCode through magpie thought at low and high, never at the default. OpenCode's default variant names no reasoning_effort, and WorkBuddy doesn't think without one: measured on www.workbuddy.ai with 0.1.42, deepseek-v4.1-flash gave 0 reasoning tokens with no effort (2 of 2), 0 at none, 16/37 at low, 34/56 at high. WorkBuddy's own client (CLI 2.165.0 in WorkBuddy 5.9.3, configureThinkingSettings) sends the session's effort, else the reasoningEffort setting, else the model's reasoning.defaultEffort from /v3/config, which is "high" for this model on both builds. A chat that names no effort now gets the model's own defaultEffort when its listed levels hold it, read from the same cached /v3/config list (one read per minute; a failed read leaves the chat as it came and is not retried on every chat). An effort the client names, none included, is untouched and the list isn't read for it. Models with no reasoning config get nothing. runmiNeverstop on X: 2.89 GB up to copilot.tencent.com through magpie. WorkBuddy's client gzips a model request's body (GzipRequestProcessor, on with productFeatures.RequestBodyGzip, true in both builds' product.json and not turned off by the remote config); the plugin sent it as plain JSON. Agent chat JSON (the whole history each turn, tool schemas) compresses several-fold, so the upload was several times what the official client sends for the same turns. A chat-completions body now goes gzipped with Content-Encoding: gzip on both builds; unanswered() weighs the gzipped size against the front door's 2 MiB. Claude's Messages route goes as it came (not tried gzipped live). Run (on mote, HOME=$(mktemp -d) bun test in packages/workbuddy): 197 pass, 0 fail. bun scripts/check.mjs: exit 0. Fakes that parse the sent body gunzip it (testdata/unz.mjs); reset.test.mjs's 2 MiB bodies are random base64 so they stay over 2 MiB on the wire. Live (www.workbuddy.ai, a real account in a sandbox HOME): with 0.1.43 the default sent reasoning_effort high gzipped and thought (34 and 51 reasoning tokens), none stayed 0, low and high as before, all 200. A gzipped chat answered 200 the same as a plain one. Broken by hand: origin/main's index.mjs with the new default-effort.test.mjs: 5 of 8 red (default effort, failed-read reuse, both gzip tests, defaultEffortOf); the 3 that pass guard what must not change (named efforts, models without a default, Messages). Not tried: a live chat on the China build (copilot.tencent.com answered 401 to every token available here, its /v3/config read fine); Messages gzipped; the reporters' own OpenCode sessions end to end. |
||
|
|
f658842089 |
workbuddy 0.1.31: a 401 is renewed once and sent again; a refused sign-in says to sign in again
wenchen855443 on X: with WorkBuddy as the provider, requests return 401.
Until now a chat 401 was passed on as WorkBuddy's HTML APISIX page with
X-Magpie-Sign-In: kept. A token is renewed only near its end, and a
browser sign-in's token lasts about 340 days. So a token WorkBuddy
refused before then was sent again on every request, for months.
Nothing renewed it and nothing told the user what to do.
What changed (packages/workbuddy/index.mjs):
- A chat or usage summary answered 401 is renewed once, whatever the
token's time, then sent once more. The request body is sent as it
was, and only a body that can be resent is retried. The first 401's
body is cancelled. A second 401 is never renewed.
- Before spending the refresh token, a newer token another process saved
(getAuth) is taken first. This is also checked after a refused refresh,
for the case where another process spent the refresh token at the same
moment (part of plugins#332).
- A desktop sign-in never spends the app's refresh token here. The plugin
drops the token it held, reads the app's file again, and retries only
if the token there changed.
- When there is no new token, or the retry is refused too, the plugin
answers 401 with authentication_error. The message names why ("it
refused the refresh token too (…)", "there is no refresh token to renew
it with", "it refused the token renewed for it too") and says where to
sign in again: Providers → WorkBuddy [AI] → this account's Sign in again,
or WorkBuddy desktop for a desktop sign-in. The >2 MiB ECONNRESET note
stays in that message.
- readDesktop marks its result source: "desktop". Before this,
unanswered's desktop wording could never show.
Marking the account expired:
- The plugin sends X-Magpie-Sign-In: expired (usage: signIn) only when
WorkBuddy itself says the sign-in is gone:
- the refresh token was refused (HTTP 401 / invalid_grant);
- the access token was refused with WWW-Authenticate error=
"invalid_token" and no refresh token was left, or one had ended;
- a just-renewed token was refused with invalid_token.
- Why mark it at all: a marked account leaves routing, so the user's
other accounts serve; the row says to sign in again; and a dead
account stops spending a refresh on every request.
- Why not on every 401: WorkBuddy answers some paths with a bare 401
even for a good sign-in (magpie's workbuddy_checkin_test). A refresh
that fails for another reason (5xx, network) also leaves the account
as it is.
- A desktop sign-in is never marked: the app's file is read on every
request, so signing in to the app again fixes it.
- A success after a renewal sends "renewed", which clears a mark.
- auth.refresh (refreshed()) still never marks the account, because a
refresh token spent by another process there could read as refused.
What WorkBuddy does (www.workbuddy.ai, 2026-10-23, the owner's real
workbuddy-ai sign-in copied into a sandbox HOME):
- Chat with a wrong or garbage token: 401, HTML APISIX page,
WWW-Authenticate: Bearer realm="copilot", error="invalid_token".
- Chat with an empty token: 401, no WWW-Authenticate.
- The meter: the same 401. /v3/config: 200 to a bad token.
- Refresh with a wrong refresh token: HTTP 401 {"code":12153,"msg":"12153:
refresh token failed:400 Bad Request: invalid_grant: Invalid refresh
token"}. With garbage: 401, code 12153 "token format error".
- A real refresh: 200; both tokens rotate, and both expiries are about
340 days out.
- The old access token still answered 200 after the refresh.
- The rotated tokens were written back to the live plugin-auth.json under
its lock (temp + rename, only workbuddy-ai's entry changed). The live
gateway answered workbuddy-ai/deepseek-v4.1-flash with 200 afterwards.
Run at this tree (
|
||
|
|
9a4ec8600c |
workbuddy 0.1.24: a refused sign-in on a request over 2 MiB says the 401 and to sign in again, not ECONNRESET (wyp on Discord)
wyp's WorkBuddy AI requests worked for a while, then every turn failed as "502 WorkBuddy AI: ECONNRESET: The socket connection was closed unexpectedly". Measured on www.workbuddy.ai and copilot.tencent.com: the front door answers a token it refuses with 401 only for a body up to 2097152 bytes. At 2097153 bytes and above it resets the connection with no reply. With an accepted token, 20 MB bodies go through, and app errors (400 11128) still come back on big bodies. So once a long Claude Code session is past 2 MiB and the account's sign-in is refused, every turn is a reset, and nothing about it is temporary. Keep-alive reuse was ruled out: the server closes an idle connection with a FIN at 60s, and Bun opens a new connection for requests at 59.99s and 59.995s. When a chat over 2 MiB fails before any reply, the loader now asks the meter (POST /billing/meter/get-user-resource-summary, 401 for a refused token) once. On a 401 it returns that 401 with the reason and the remedy (sign in again, in magpie or in the desktop app), marked kept like the plugin's other 401s. Any other answer, a failed meter read, or an abort leaves the original error. The chat is never sent again. Run: HOME=<temp> bun test in packages/workbuddy: 97 pass (reset.test.mjs is a socket fake of the front door that resets past 2 MiB). Broke it by hand (unanswered rethrows at once): 3 of the 5 new tests go red. bun scripts/check.mjs workbuddy: ok. Against the real endpoint in a sandbox HOME: refused token + 2.2 MB body gives 401 with the message (0.1.23: ECONNRESET); refused short chat gives the front door's HTML 401; good token + 2.2 MB body gives 200. Not run: magpie's gateway end to end with this version. Why wyp's token was refused is not yet confirmed. |