Repository navigation
fix(agent): surface review limits as tool rejections - #1529
Merged
Merged
Conversation
ToolActionReviewLimitError is expected control flow after Guardian rejects three consecutive tool attempts. Return an execution_failure outcome without logException, and finalize that stop with a warn plus user-visible text instead of opening a Sentry issue. Evidence: https://sentry.sentry.io/issues/7649537952/ Co-Authored-By: David Cramer <[email protected]>
Keep one agent failure return path, detect the limit by stable message, and emit guardian.action_review.exhausted without extra helpers. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Keep Sentry capture for consecutive action-review denials, but stop aborting the agent run. The third rejection stays a normal tool failure with explicit stop-retrying instructions instead of an internal error. Co-Authored-By: David Cramer <[email protected]>
dcramer
marked this pull request as ready for review
August 13, 2026 19:27
Keep the existing pi-tool-adapter component scenario as the single owner for consecutive rejection behavior. Do not assert telemetry as product behavior. Co-Authored-By: David Cramer <[email protected]>
dcramer
approved these changes
Aug 13, 2026
This was referenced Oct 1, 2026
dcramer
added a commit
that referenced
this pull request
Oct 2, 2026
The chat README invariant said three consecutive Guardian rejections interrupt the execution slice. That has not been true since #1529: the third rejection is a normal `ToolActionRejectedError` that tells the agent to stop retrying and explain the risk to the user, and the run continues. This updates the invariant to match `tool-support/action-review.ts`, so a later change does not restore the old abort behavior because the README says so. Fixes #2003 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch was successfully deployed
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.
Summary
After three consecutive action-review denials, Junior used to abort the whole run with
ToolActionReviewLimitError. That showed up to the agent as an internal error instead of a normal tool failure.This keeps Sentry capture for the limit, but the third denial stays on the normal tool-rejection path with explicit stop-retrying instructions.
Changes
ToolActionRejectedErrorwith stop-retrying instructionsToolActionReviewLimitErrorat the tool boundary asguardian.action_review.exhaustedonFatal/ abort the agent run for the limit caseVerification
pnpm --filter @sentry/junior exec vitest run tests/unit/tool-support/action-review.test.ts tests/component/tool-support/pi-tool-adapter.test.tsCoverage lives in the existing
pi-tool-adaptercomponent scenario only.Requested by David Cramer.
--
View Junior Session [Sentry]