audit: use the transcript's own markers for what the human actually sent - #511
Conversation
Two shapes were each counted as a second human message. A line carrying two slash commands writes the same command-args twice; the transcript marks the second row stackedExpansion, and both skill bodies are already marked isMeta. Typing while the agent is busy writes an enqueue row and, minutes later, a delivery row with identical text; the gap between them read as the user re-sending in frustration. Both are now dropped by those markers rather than by a timing guess. On the session that motivated this: 8 of 23 flagged with a verbatim-repeat becomes 7 of 22 with none. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KU2pPKob4MJ1NqjsfTNyYJ Change-Id: Ia2a6527cc6efe8311affd0d7e85c43f9884d8dd6
This was referenced Sep 12, 2026
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_95860b49-8e43-48a2-85cc-29f8bf842347) |
Owner
Author
|
This pull request is part of a Mergify stack:
|
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.
Two shapes were each counted as a second human message.
A line carrying two slash commands writes the same command-args twice; the
transcript marks the second row stackedExpansion, and both skill bodies are
already marked isMeta. Typing while the agent is busy writes an enqueue row
and, minutes later, a delivery row with identical text; the gap between them
read as the user re-sending in frustration.
Both are now dropped by those markers rather than by a timing guess. On the
session that motivated this: 8 of 23 flagged with a verbatim-repeat becomes
7 of 22 with none.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01KU2pPKob4MJ1NqjsfTNyYJ
Depends-On: #510
Note
Low Risk
Changes only how reflect scripts classify Claude transcript rows for counting direct human messages; no runtime auth, persistence, or user-facing API impact.
Overview
Reflect transcript provenance now treats certain Claude transcript rows as non–direct-human using native markers, so audit/intervention logic does not double-count a single user send.
_claude_utterancesskips user rows withstackedExpansion, so one submission like/reflect /cat-mode …is one human message (the duplicate command-args expansion is ignored; skill bodies stayisMeta/hook).New JSONL fixtures and tests cover stacked slash commands, queued enqueue + later delivery, and enqueue-only (undelivered) cases—asserting
direct_human_utterancesreturns a single utterance wheninclude_queue_operations=Truefor queue shapes (pairing with enqueue normalization already in this module).Reviewed by Cursor Bugbot for commit 9ffcdb1. Bugbot is set up for automated code reviews on this repo. Configure here.