Skip to content

feat: Group a session's model calls into user prompts, in the recording and the timeline #1922

Open

Description

@michaljacovi

Part of #1920.

Problem

The timeline's unit is one model call (Turn,
core/session/timeline/timeline.go:78). A user prompt usually causes many
calls: tool loops, subagents, retries. Some calls are not the user's at all:
the agent's own title, suggestion and away-summary calls show up as main.
Replay and analysis need "what did the person ask, and what did it cost",
plus the user's think time between prompts. Nothing in the archive or the
timeline groups calls that way today.

Proposal

We have the heuristic measured on real sessions: derived think time matched
the agent's own telemetry within 0.4 s on 13 of 13 gaps.

Open questions

  • The name. "Turn" is taken. We use "prompt" here.
  • Is the grouping computed on demand, like the timeline, or stored with the
    session?
  • Agents other than Claude Code: the same rules per agent, or Claude Code
    first?

Out of scope

  • Changing what Turn means.
  • Agents whose request bodies we have not checked.

Assisted-By: Claude (Anthropic AI) noreply@anthropic.com

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions