Repository navigation
feat(j5): report who started each turn - #515
Merged
Merged
Conversation
Upstream's client.turn.requested fires only for a message a person sends from a client, so turns started by an agent's message, an Inbox reply, a spawn brief, a Crew notice, a playbook step or a scheduled task were invisible, and provider.turn.completed does not say who asked. J5 now records j5.turn.started for every run the orchestrator creates, read from the committed run.created event so a retried command counts once. Part of #510 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Jacksondr5
added a commit
that referenced
this pull request
Oct 10, 2026
This was referenced Oct 10, 2026
Jacksondr5
added a commit
that referenced
this pull request
Nov 23, 2026
This branch was successfully deployed
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.
Problem
Product analytics could not see fleet activity. Upstream's
client.turn.requestedfires only for a message a person sends from a client, so a turn started by an agent's message, an Inbox reply, a spawn brief, a Crew notice, a playbook step or a scheduled task produced no "requested" event, andprovider.turn.completeddoes not say who asked. Over the 14 days to 2026-10-10 the project recorded 4,066 completed turns against 1,219 requested ones. Part of #510 (the first of its events).What changed
J5 records
j5.turn.startedfor every run the orchestrator creates, with:createdBy(user, agent, system) andcreationSource(web, mobile, mcp, provider, server) of the message that asked for the turn;scheduled,wake,firstTurn;threadCreatedBy,threadCreationSource,crewSeatfor the thread it runs in.It reads the committed
run.createdevent from the stored-event stream, the same way J5's other daemons do. That one hook covers every way a turn starts, including upstream'sdelegate_taskand scheduled tasks, and a retried command counts once. Composer turns are included, so the share of turns a person did not start comes from one event.Not counted: a message that steers a turn already running (no new run), and turns that start while the server is down (the tail starts at the current position on boot, so a restart never counts old turns again). Crew notices, playbook steps and handoff nudges all report as system/server and are not told apart.
The event carries enums and booleans only: no message text, no thread or run IDs, no names.
Verified against PostHog's dev project with a tagged dev server (#514): a composer turn, two follow-ups, an agent's spawn brief and an agent-to-agent message produced five events with the expected properties, no duplicates, and nothing reached the real project. In the same run
client.turn.requestedfired three times. A Crew seat, a scheduled task, a platform notice and a wake-up are covered by the unit test only.UI changes
The privacy page's event list gains one item.
Checklist
FORK.md(case text and file-table row) in this PR. None edited: the recorder and its wiring are J5-owned files.docs/j5/product/upstream.md. Upstream's events are unchanged; J5 sending its own events was decided in J5 analytics, later: UI-only moments and health measures #510.AGENTS.md). Server only. Every turn-start path goes throughrun.created, on every provider; no client or contract change.docs/j5/product/and user docs rewritten where this changes them.docs/user/telemetry.mdand the privacy page.Claude Opus 5.5 (1M context), Claude Code in J5 Code. Live check by GPT-6-Astra, Codex.
🤖 Generated with Claude Code