Repository navigation
feat(guardian): Put Guardian asks on the review desk - #2490
Closed
sentry-junior[bot] wants to merge 4 commits into
Closed
sentry-junior[bot] wants to merge 4 commits into
sentry-junior[bot] wants to merge 4 commits into
Conversation
When Guardian returns `ask`, core now adds an Approve/Reject action Review item for the exact proposal, linked to the current Conversation. The card shows in the thread, and the Conversation shows as waiting on the assignee. The agent no longer writes its own confirmation question. The assignee is the Actor, or the Automation creator in an Automation run. An Automation run now keeps `ask` instead of turning it into `deny`, adds the item, and finishes the run. A child agent gets no item and still reports the missing approval. An Approve answer clears one later `ask` for that exact action once. The gate checks the newest item for the action, its unchanged content, the approver, and that the approval is unused, then marks it used. Part of #2488 Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 16a1f0b. Configure here.
Guardian can allow the retry after an approval, because the resume message names the action. The gate then left the approval unused, and a later identical ask could run the action again without a new approval. Use the approval on any non-deny decision.
…wner An approval could cover input that the approver did not see, because the item body cut the input at 2,000 characters. Core now adds no item when the exact input does not fit, and the agent asks in text. An agent could also move an item to another person, whose answer then resumed the Conversation as the Actor and approved the action. The dedupe key now includes the owner: the Actor's User, or the Automation for an item that an Automation run added. The gate reads only the item of the current Actor or of an Automation run.
…ation An agent could link other Conversations to a Guardian confirmation item. The approver's answer then went to those Conversations as a message from the approver. Core now links only the Conversation that asked. The update tool rejects new links on these items, and the add tool rejects a Guardian dedupe key.
Member
|
im not sure we want this tbqh |
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.

Part of #2488 (track 2: A2 and A4).
Today, when Guardian returns
ask, the agent writes its own "confirm?" question in free text, and nothing structured records it. With this change, core adds an Approve/Reject action Review item for the exact blocked call. The agent ends the Turn and lets the card be the question.Design decision: the confirmation stays in the same Conversation. Core does not start a new Conversation, thread, or child agent. The item links the current Conversation, so
review-item-card-sync.tsposts the card in the originating thread. The existing "Waiting on you" marker (listWaitingConversationIds) shows that the Conversation needs input. There is no second status system. The answer comes back to that Conversation as the person's message, and the agent retries the exact call there.What core does on
ask(chat/guardian/confirmation.ts, wired fromagent/tools.ts):actionitem with onechoicefield: Approve first, then Reject. The title, body, and question come only from the proposal: the action (describeProposal), the tool, what the tool does, and the exact input.askinstead of turning it intodeny. It adds the item, then finishes withfinishAutomationRunand says that the action waits for approval. A child agent whose root is an Automation run still getsdeny.reportBlocked.review-items/access.ts. A private Conversation gives a private item.How an approval is scoped to one action. When Guardian returns
askagain, the gate callsconsumeActionApproval. It reads the newest item with that action's dedupe key and turns theaskintoallowonly when all of these are true:updateReviewItem, the approval no longer counts.The gate marks the approval as used with a conditional update of the item's close reason ("The approved action ran."). A second attempt then needs a new approval. A
denystays adeny, and Reject approves nothing. Agents cannot submit answers, so neither a trigger nor agent text can approve.Other changes:
reviewItemId. With it,actionConfirmationRetryMessagesdoes not force one more continuation to get a visible question. The marker staysversion: 1because old markers still parse. The README rule now says that an added optional field keeps the version. During a rolling deploy, an older worker ignores the new marker, so it may make one extra retry.canonicalJsonmoved fromgate.tstoproposal.tsso the dedupe key can use it.deny. Thatdenycame from the old ask→deny rewrite, so they now acceptaskordeny. Theaction-reviewbehavioral rubric now accepts the review item as the question and fails on a duplicate text question.Open questions:
reasonis not on the card, because the content must stay the same for the same action so an edit can be detected. Should the card also show a reason that is checked separately?denydecisions that say authorization is missing still ask in free text. This PR does not change them.This PR does not touch track 1 files (
request-user-input.ts,slack/user-input-state.ts,system-prompt-rules.ts) or track 3 files (junior-plugin-api,junior-github).via David Cramer.
--
View Session [Sentry]