175dfd25552d769905bbfd57ecd57036eaa37910
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a05a0ef85c |
workbuddy 0.2.35: a WorkBuddy AI chat is reported on /v2/report as its client reports one (#691)
xxhhlk found that the growth event alone (0.2.31+) didn't earn the daily
credit: the same day, the account that chatted in WorkBuddy AI's own client
got it and three accounts chatting through the plugin didn't. Their capture
of WorkBuddy AI 5.9.4 shows three POST /v2/report calls around one user
send (chat_message_send; chat_request_send, chat_message_response,
chat_message_status, chat_request_response; agent_task_completed,
chat_response_complete), each answered {"code":0,"msg":"OK"}.
The plugin now sends the same three reports for the user's own chats, built
from the redacted field list in the issue, once the reply has been read to
its end: token counts and finish reason come from the reply's last usage
chunk. A step ending in tool calls reports its message only; the request's
events go with the step that ends the turn; chat_request_send with the step
the user's message opened. Not for a reply cut off, a refusal, a key
account or the China build. Fire and forget: a failed report is dropped and
the answer never waits on it. No message of the plugin's own is sent.
Run (mote, HOME=$(mktemp -d)): bun test in packages/workbuddy, 383 pass;
bun scripts/check.mjs workbuddy ok. New report.test.mjs (5 tests): the
three bodies in order with ids, tokens and headers, tool-call steps, the
cases that send nothing, and the reply passing through byte for byte.
sent.test.mjs's recorder answers /v2/report itself, so 0.1.43's chat bytes
are still held.
Broken by hand: no send at the stream's end -> report.test.mjs 2 fail.
Not tried: a real WorkBuddy AI account (whether the credit follows needs a
day's comparison; asked the reporter). Not sent: the client's
POST /console/as/conversations/<id> activity update and /v1/traces; the
conversation may not exist on the console side for a plugin chat.
|
||
|
|
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 |
||
|
|
95fa76126d |
workbuddy 0.1.44: a huge chat's ids are hashed in pieces, and it is read once on every path (#461)
0.1.42 brought jihuayu's 45 MiB repro from 7 parses a request to 2, and
0.1.43 keeps that: one full parse and one full stringify a request. What
was left of the peak was attendChat: the conversation and turn ids were
made from template strings holding the whole user message (`first:${sig}`,
`u1:${sig}`, `${conv}|${turn}`, then `${SALT}|kind|${key}`), each a fresh
45 MB string, ~160 MiB of peak a request. The keys are now lists of
pieces fed to one sha256 each, whole (Bun hashes a one-byte string in
place; 1 MiB slices cost a copy and were worse), with a high surrogate
split between pieces held for the next one, so every id is the hash of
the same string as before.
Also read once on paths the repro doesn't take:
- "Free models only" parsed the body again for its model; it reads the
chat prepared already parsed.
- A model known to want a reply after tools (11153) had the body parsed
and stringified again on every request; the reply goes into the one
parsed chat before the one stringify.
- The prepared result no longer holds the parsed tree past the send.
Every byte WorkBuddy sees is unchanged: sent.test.mjs runs 12 chats
(OpenCode tools, default effort, developer turn, after-tools refusal and
known, system refusal and known, both, Messages, bytes, not JSON),
switch off and on, and holds the gunzipped body's sha256, url, encoding
and which requests share an id to testdata/sent-0.1.43.json, made by
running the same harness on npm's 0.1.43 index.mjs (sha 9213db6d...).
Run on mote (Bun 1.4.2), the issue's benchmark.mjs as written but for
the import, 45.3 MiB body, 4 requests, concurrency 1, /usr/bin/time -l,
3 runs each:
direct (no plugin) 336 MiB
0.1.41 981-1117 MiB, 28 parses (1087.5 MiB), 24 stringifies
0.1.43 717-760 MiB, 8 parses (181.3 MiB), 20 stringifies
0.1.44 583 MiB all 3 runs, same counts, ~370-420 ms wall
(0.1.43 ~400-530 ms)
One request: direct 134, 0.1.41 569, 0.1.43 390, 0.1.44 275 MiB (with
id derivation stubbed out entirely: 229).
- HOME=$(mktemp -d) bun test in packages/workbuddy at this head:
201 pass, 0 fail. bun scripts/check.mjs workbuddy: ok.
- Broken by hand, each red: free-only parsing again -> the free-only
parse-count test; reply after tools put in by re-parsing -> the
after-tools parse-count test; no surrogate hold -> the idFor pieces
test; the reply put in before the system move -> sent.test.mjs.
gzip was measured too: Buffer.from before gzipSync made no difference
to the peak, so it is unchanged.
Not tried: a live WorkBuddy request; the reporter's Linux and Bun
1.4.4 (mote has 1.4.2); concurrency 4; a huge body that isn't ASCII
(Bun keeps it two-byte, so hashing it may copy); a huge Messages body
(its own path, not changed here).
|