Skip to content

Conversation

@Soph
Copy link
Collaborator

@Soph Soph commented Jan 16, 2026

If multiple commits are made by one agent session we are including the session log in each commit as it grows. This means if you only look at one of the commit you would need to look at prior commits to figure out which parts of the session belong to this commit.

To make this easier we track now the position and last uuid of any user message in the log at the beginning of a prompt. This is then written to metadata.json so we can easily figure out which parts of the log actually belong to the session.

Quick visualization:

  TRANSCRIPT FILE (grows over time)
  ═══════════════════════════════════════════════════════════════════════════════

  Line │ UUID    │ Type      │ Content
  ─────┼─────────┼───────────┼──────────────────────────────────────────────────
     0 │ u-001   │ user      │ "Add a login form"
     1 │ a-001   │ assistant │ {usage: {input: 1000, output: 200}} "I'll create..."
     2 │ a-002   │ assistant │ [tool_use: Write login.tsx]
     3 │ u-002   │ user      │ [tool_result: success]
     4 │ a-003   │ assistant │ {usage: {input: 1200, output: 150}} "Done!"
  ─────┴─────────┴───────────┴──────────────────────────────────────────────────
                             ▲
                             │  CHECKPOINT 1 saved here
                             │  metadata.json: {
                             │    "transcript_lines_at_start": 0,
                             │    "transcript_uuid_at_start": ""
                             │  }
  ─────┬─────────┬───────────┬──────────────────────────────────────────────────
     5 │ u-003   │ user      │ "Now add password validation"
     6 │ a-004   │ assistant │ {usage: {input: 2500, output: 300}} "I'll add..."
     7 │ a-005   │ assistant │ [tool_use: Edit login.tsx]
     8 │ u-004   │ user      │ [tool_result: success]
     9 │ a-006   │ assistant │ [tool_use: Task → spawns agent-abc123]
    10 │ u-005   │ user      │ [tool_result: agentId: abc123]
    11 │ a-007   │ assistant │ {usage: {input: 3000, output: 400}} "Validation added!"
  ─────┴─────────┴───────────┴──────────────────────────────────────────────────
                             ▲
                             │  CHECKPOINT 2 saved here
                             │  metadata.json: {
                             │    "transcript_lines_at_start": 5,      ◄── knew to start here
                             │    "transcript_uuid_at_start": "a-003" ◄── last UUID at checkpoint 1
                             │  }
  ─────┬─────────┬───────────┬──────────────────────────────────────────────────
    12 │ u-006   │ user      │ "Add remember me checkbox"
    13 │ a-008   │ assistant │ {usage: {input: 4000, output: 250}} "Adding..."
    14 │ a-009   │ assistant │ [tool_use: Edit login.tsx]
    15 │ u-007   │ user      │ [tool_result: success]
    16 │ a-010   │ assistant │ {usage: {input: 4200, output: 100}} "Done!"
  ─────┴─────────┴───────────┴──────────────────────────────────────────────────
                             ▲
                             │  CHECKPOINT 3 saved here
                             │  metadata.json: {
                             │    "transcript_lines_at_start": 12,
                             │    "transcript_uuid_at_start": "a-007"
                             │  }

Soph and others added 4 commits January 16, 2026 20:06
Entire-Checkpoint: d656108cfae9
Session position / token tracking for manual commits
Calculate token usage and store in metadata.json
Copilot AI review requested due to automatic review settings January 20, 2026 03:08
@gtrrz-victor gtrrz-victor requested a review from a team as a code owner January 20, 2026 03:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@gtrrz-victor gtrrz-victor merged commit d9bb972 into main Jan 20, 2026
3 checks passed
@gtrrz-victor gtrrz-victor deleted the soph/track-session-position branch January 20, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants