chore(agent-core): classify turn_interrupted telemetry cause - #1431
Merged
Conversation
Add an `interrupt_reason` field to the `turn_interrupted` telemetry event so the data can tell a deliberate user cancel (`user_cancelled`) apart from a programmatic abort (`aborted`), max-steps exhaustion (`max_steps`), an error (`error`), or a hook-filtered turn (`filtered`). The user-cancel signal comes from the existing UserCancellationError carried as the abort signal's reason, reused here without changing any loop control or external protocol semantics.
|
commit: |
Collaborator
Author
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.
Related Issue
No linked issue; this builds on internal telemetry review.
Problem
The
turn_interruptedtelemetry event only carriedmodeandat_step, so the data could not tell a deliberate user interrupt apart from a timeout, a programmatic abort, max-step exhaustion, an error, or a hook-filtered turn. Downstream analysis had to lump every interrupted turn into one bucket.What changed
interrupt_reasonfield to theturn_interruptedevent with valuesuser_cancelled | aborted | max_steps | error | filtered.abortedexits,runTurnreads the existingUserCancellationErrorcarried on the abort signal's reason and reportsuser_cancelled; any other abort stays asaborted. Loop control and the externalturn.step.interruptedsemantics are unchanged —LoopInterruptReasonstill carries onlyaborted | max_steps | error, anduser_cancelledlives only on the telemetry-facinginterruptReasonfield.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.