Repository navigation
Show each Agent inbox card's tool-call count (#471) - #669
Merged
Merged
Conversation
The v1 count board of #471 asks for one `N tool calls` line per card, for that card's own place. turns.js already folds `tool/call` events, so the count rides the existing work snapshot: the running turn carries it in work.bots / work.rooms, and an ended turn keeps its own. The inbox reads it for the card's place only, shows nothing for 0 or unknown, and never adds places together. No new polling, no new event source. Part of #471 (v1 scope of record; the three-column board stays v2).
Collaborator
Author
|
Verdict: PASS at 1958157 Reviewed this tip only. Nine checks What I checked
Non-blocking
Nothing else; the read-only guarantee holds (same single Open action on a counted card), and no new polling. |
This was referenced Oct 22, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #471 — the v1 count board from the spec of record (triage 2026-10-21): one
N tool callsline per card, for that card's own place. The three-column board with a List/Board toggle stays v2 and needs the owner, so this PR does not close the issue.Reproduce
On
mainc74e1207no inbox card can show a tool-call count:inboxModelbuilds its cards from approvals, running turns, tasks and ended turns, but neitherworkView()norendedView()incore/src/host/turns.jsrecords how many tools a turn ran, so there is nothing to render. (Failed turns and the Latest line from #491 stay exactly as they are.)What changed
core/src/host/turns.js: countstool/callevents per turn (entry.toolCalls, reset atturn/start). The running turn's count rideswork.bots[id].callsand itswork.rooms[roomId][]entry (only above 0); a turn that ended keeps its own count ascallson itsendedView()entry. One source — the events the activity feed already folds; no new endpoint, no new polling.core/src/client/inbox.js:toolCalls(card)reads the count for the card's own place — the turn running there now (the Bot's own chat, or that one group), else the newest ended turn there — never summed across places,0when unknown;InboxCarddraws one mutedN tool callsline (bt-inbox-calls) only when it is above 0. Grouping, the 7-day Done cap,needsCount, the latest-activity line and the read-only Open action are unchanged.core/src/client/i18n.js:{count} tool calls/{count} 次工具调用.docs/subsystems/core-client.mdandcore-host.md; the inbox model and host tests, plus the Group dock and member list show a Bot's work from another room #553 work-view expectation incore/test/group-work.test.js.core/client.js(npm run build) andpatches/ds-bot/(generatethencheck).What I ran
Tip SHA:
1958157a007ae2809bf7ea82426f985f39b52074(Node 22.23.3,TZ=UTC):node --import ./test/harness-resolve.mjs --test test/inbox.test.js→ 21/21.node --import ./test/harness-resolve.mjs --test test/approval-notices.test.js→ 12/12;test/group-work.test.js→ 15/15.node --import ./test/harness-resolve.mjs --test --test-concurrency=4 "test/*.test.js"(the CItestjob's suite) → 1204/1204, exit 0.--test-concurrency=4only because this box has a 512-pid cgroup: the default 192-way spawn hitsspawn EAGAINwith other benches running; it changes nothing about the tests.cd core && npm run lint→ oxlint 0 errors (43 pre-existing warnings),arch-docs: OK (13 changed file(s)).node scripts/build-client.mjs --check→ OK;node scripts/ds-bot-patches.mjs check→ds-bot/= pin (tree5834c00, v0.1.5), 10 patches apply cleanly,core/=ds-bot/+ patches.plugins/social317/317,plugins/timeline104/104,plugins/tree89/89.Red without the source change
With
core/src/client/inbox.js,core/src/client/i18n.jsandcore/src/host/turns.jsat mainc74e1207and the new tests kept:test/inbox.test.js→ 19/21: both new tests fail (Cannot read properties of undefined— nocallson the model, nobt-inbox-callsrow).test/approval-notices.test.js→ 11/12: the new host test fails — the running turn and the ended turn carry nocalls.Not run
CONTEXT_WINDOW=100000 CHECK_RATIO=0.45 dev/bench.sh smoke 3096 8796 reset): it stops atpnpm: not foundon this box (no pnpm installed), and the desktop/web profile it starts is not available here. The change is a count folded fromsession/eventand read by the client, with the host covered bycore/test/approval-notices.test.js; greentests-okat the tip is the gate.Risk
risk-rules.json(core/src/host/turns.js; client, tests and docs are T1/T0), so it needs your PASS at this tip plus greentests-ok. Nothing here touches authz, secrets, permissions or saved state.run_code) are not counted — the spec of record saystool/callevents.1 tool callsreads slightly off; the spec of record fixes the copy as{count} tool calls, so it stays that way unless you want a singular key.