Skip to content

feat(convex): team sessions rows carry a transcript message count - #118

Merged
ashot merged 1 commit into
codecast-sh:mainfrom
triptu:feat/team-sessions-message-count
Nov 23, 2026
Merged

ashot merged 1 commit into
codecast-sh:mainfrom
triptu:feat/team-sessions-message-count

Conversation

@triptu

@triptu triptu commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

From Tushar's coding agent.

GET /cli/v1/team/sessions now returns transcript_messages on each row. It is the session's stored message count, so a team dashboard can show how much each person uses agents.

More detail from Coding agent

What the number counts

The value is conversations.message_count. It counts every message row in the transcript. The person's prompts, the agent's replies and tool results all add to it. Claude Code stores tool results as user-role rows, so the count is mostly agent traffic in a tool-heavy session.

A count of only the person's own messages would answer "how much does this person ask" more directly. The conversation row does not store one. Getting it would mean reading messages per request or adding a new counter, and this endpoint does neither because of Convex read limits. The field is named transcript_messages so nobody reads it as messages sent.

Who can already see it

The team feed (conversations.listConversations) returns message_count at every visibility mode, including minimal and summary. The MCP session card (lib/sessionCard.ts) and session search rows also return it at every level. So a summary share returns the count too, and the endpoint shows nothing a member cannot already see.

Changes

  • teamReadKeys.ts: TeamSessionRow.transcript_messages, set from message_count.
  • lib/teamReadKeyHttp.ts: the contract header says what the field counts.
  • teamReadKeys.test.ts: the exact-row assertion has transcript_messages: 1, and Mo's summary session asserts transcript_messages: 42. The test fails without the source change.

Checks

  • bun test convex/teamReadKeys.test.ts: 9 pass. With the source change reverted: 8 pass, 1 fail.
  • cast check convex: 0 errors.

Deploy

This adds a field to an HTTP response and no new Convex function, so web does not depend on it. Deploy Convex with deploy.sh for the field to appear.

GET /cli/v1/team/sessions returns transcript_messages on each row: the
conversation's stored message_count, which counts every message in the
transcript (the person's prompts, the agent's replies and tool results).
The team feed already shows that count at every sharing level, so a
summary share returns it too.

Codecast-Session: https://codecast.sh/conversation/jx73nbygqcgaehfp6bqkp1k6g98jr8gp
@ashot
ashot merged commit 17da023 into codecast-sh:main Nov 23, 2026
16 checks passed
@ashot

ashot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Merged, thanks. This is backend (Convex) code, so it goes live with the next Convex deploy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants