Files
yetone 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.
2026-11-15 16:15:09 +08:00
..