Skip to content

audit(token_audit): one submission carrying two slash commands is one message - #510

Open
EdbertChan wants to merge 1 commit into
stack/EdbertChan/reflect/ui-input-guard-hook-freshness-20260908/branch-taken-per-operating-system-needs-test--0ebec990from
stack/EdbertChan/reflect/ui-input-guard-hook-freshness-20260908/one-submission-carrying-two-slash-cmds-one-msg--0f516b8f
Open

audit(token_audit): one submission carrying two slash commands is one message#510
EdbertChan wants to merge 1 commit into
stack/EdbertChan/reflect/ui-input-guard-hook-freshness-20260908/branch-taken-per-operating-system-needs-test--0ebec990from
stack/EdbertChan/reflect/ui-input-guard-hook-freshness-20260908/one-submission-carrying-two-slash-cmds-one-msg--0f516b8f

Conversation

@EdbertChan

@EdbertChan EdbertChan commented Sep 12, 2026

Copy link
Copy Markdown
Owner

/reflect /cat-mode on a single line injects the same user text twice, tens
of milliseconds apart. The verbatim-repeat rule read that as a re-send, the
strongest single frustration signal, and escalated a pass to FAIL on it.

A repeat now needs at least five seconds between the two rows. A genuine
re-send minutes later still counts, asserted both ways.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01KU2pPKob4MJ1NqjsfTNyYJ

Depends-On: #509


Note

Low Risk
Narrow heuristic tweak in offline transcript auditing with unit tests; may slightly reduce verbatim-repeat detection for duplicates sent 1–4 seconds apart.

Overview
Fixes a false positive in reflect’s verbatim-repeat frustration signal when one user submission produces two identical transcript rows milliseconds apart (e.g. /reflect /cat-mode on one line).

frustration_signals in token_audit.py now requires at least MIN_RESEND_GAP_SECS (5) between matching normalized user texts before counting a verbatim-repeat (still capped at 10 minutes). Sub-second duplicates are ignored; a real re-send minutes later still flags and can still drive intervention-must-automate.

Two Codex unit tests lock in the near-duplicate vs. minutes-later behavior.

Reviewed by Cursor Bugbot for commit 8c65d80. Bugbot is set up for automated code reviews on this repo. Configure here.

… message

`/reflect /cat-mode` on a single line injects the same user text twice, tens
of milliseconds apart. The verbatim-repeat rule read that as a re-send, the
strongest single frustration signal, and escalated a pass to FAIL on it.

A repeat now needs at least five seconds between the two rows. A genuine
re-send minutes later still counts, asserted both ways.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KU2pPKob4MJ1NqjsfTNyYJ
Change-Id: I0f516b8f1e8856df6ae98bf63c2389cdae97e2f9
@EdbertChan

Copy link
Copy Markdown
Owner Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 hook: a script handed to the user is a claim that it runs #506
2 audit(token_audit): count "bogus" and "it didn't run" as the same class #507
3 hook: refuse a quoted command string passed through a login shell #508
4 gate: a branch taken per operating system needs a test that injects one #509
5 audit(token_audit): one submission carrying two slash commands is one message #510 👈
6 audit: use the transcript's own markers for what the human actually sent #511

@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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_d9473ccb-6cba-4d85-af59-5cfaf02e0463)

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.

1 participant