Commit Graph
4 Commits
Author SHA1 Message Date
yetone c1f84f048c workbuddy 0.2.31: a WorkBuddy AI chat carries the client's chat_request_send growth event (#691)
WorkBuddy AI has no check-in; its daily credit follows a finished chat in
the official client. The reporters' capture shows the official chat body
carries extra_vars.growthEvent, a JSON string array holding one
chat_request_send event (conversation id, input length, model id and
name, mode "craft"), and initiator "user". The WorkBuddy AI CLI 5.6.2
builds the same event in reportChatRequestSendTelemetry/appendGrowthEvent.
The plugin now adds that event to every WorkBuddy AI chat (the CN site is
unchanged), keeps any events and initiator the caller already sent, gives
the event the retrying account's conversation on a retry, and inserts
extra_vars into the body as text so the rest of it goes as written
(#461). initiator comes from the 5.9.4 capture; the 5.6.2 CLI doesn't set
it.

Run (WSL, Bun 1.4.2, temp HOME):
- bun test packages: 366 pass, 0 fail (6 new in growth.test.mjs).
- bun scripts/check.mjs workbuddy: ok.
Broken by hand on a separate test Mac: dropping the event, the initiator,
the retry rewrite or the text insert: 6 fail, then restored.
Not tried: a real WorkBuddy AI account. Whether the next day's credit
lands is unproven, so #691 stays open for the reporters.

Reported-by: xxhhlk
Reported-by: dgqyushen
2026-11-12 21:24:51 +08:00
yetone d51bd50cf6 workbuddy 0.2.15: no default effort for a chat whose max_tokens is 1024 or less (#643, itspig)
itspig's change (the commit before) skips the default reasoning_effort at
max_tokens 256 or less. This raises the bound to 1024, as SMALL_BUDGET,
and reads max_completion_tokens too. Anthropic's API takes no thinking
under a 1024-token budget, so a /v1/messages request magpie translates with
max_tokens 1024 or less can't have asked for thinking, and the gateway
sends it with no effort, the same as OpenCode's default variant. 256 left
512 and 1024 asks thinking at the default.

Run, at this head, on mote:
- packages/workbuddy: bun test, 315 pass, 0 fail.
- bun scripts/check.mjs workbuddy: ok.
- Broken by hand (the SMALL_BUDGET line removed): the new test is red,
  8 pass, 1 fail.

Real, on the owner's workbuddy-ai account (www.workbuddy.ai, sandbox HOME,
no token renewal), deepseek-v4.1-flash-sg, default effort high:
- main, max_tokens 64, no effort: finish "length", 64 reasoning tokens,
  empty content (#643's pattern). This head: "stop", 0 reasoning, the
  title answered.
- main, max_tokens 1024: 76 reasoning tokens. This head: 0, answered.
- This head, max_tokens 2048: 65 reasoning tokens (the default still goes).
- An explicit "high" at 64 still ends "length"; "low" answers. An effort
  the client names goes as it came.

Not tried: the China site (copilot.tencent.com), deepseek-v4-pro (11102 on
the AI site), kimi-k3.1-pro (11158, not for free users).
2026-11-03 02:25:46 +08:00
itspig 8d8b108e67 fix(workbuddy): omit default reasoning effort when max_tokens <= 256
When a chat does not explicitly name reasoning_effort, withDefaultEffort
injects the model's default reasoning effort (e.g. 'high'). However, for
lightweight tasks specifying small output limits (e.g. max_tokens <= 256
like title generation or short classification), forcing a high reasoning
effort consumes the entire completion token budget on reasoning alone,
producing 0 text tokens before hitting finish_reason=length.

Skip default reasoning effort injection when max_tokens <= 256 while
preserving explicit client-specified efforts and normal-sized chats.

Issue #643, PR #644.
2026-11-03 02:25:33 +08:00
yetone 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.
2026-10-28 22:23:20 +08:00