Repository navigation
Show who asked on tool-approval cards - #66
Draft
sohanmaheshwar wants to merge 2 commits into
Draft
sohanmaheshwar wants to merge 2 commits into
sohanmaheshwar wants to merge 2 commits into
Conversation
The tool-approval card told an approver why the agent wanted a call, what it does and which permission it needs, but not who asked. The runner already resolves the requester (the app-tool widget viewer, or the session's started-by identity) and puts it on the ask payload; buildToolCallPending never read it. The card now leads with a "Requested by" row. The requester travels as a structured identity in InteractionField.Mentions, with Value as the plain fallback (email, else the channel-native id). The runner composes no mention markup: Slack's existing resolveFieldMentions turns a slack identity into a live <@U...> mention, and the cached request carries it through to the Approved/Denied card. Local, browser and fake render Value as plain text. When no requester is known (a kubectl-started session, a cron run) the row is omitted and the card is unchanged. No Slack, relay or interaction-model change was needed; the Mentions seam channelsd's permission_request "From" row already uses fits.
…l cards The "Requested by" row named whoever STARTED the session. On the LLM path the runner fell back to the started-by annotation every time, because internal/cmd/runner never assigns LastInboundExternalID. One runner serves a whole multiplayer thread, though (advanceRequester's doc): when Alice starts a thread and Bob asks for a call, the owner's card read "Requested by @alice" -- lending Bob Alice's credibility on a security decision. The requester is now the author of the turn the agent is answering (lastInboundAuthor, the designated "who is speaking right now" field, set on turn 0, on cold start and on every drained inbox turn). It is deliberately not authSubject: under startedBy mode that stays frozen at the starter, which is exactly when Bob's call runs on Alice's grants and the approver most needs to see that Bob asked. When several messages are drained into one turn, the last one's author is named, the same last-wins rule advanceRequester documents. The speaker rides as a Subject passthrough plus the session's human channel Kind, the shape info_leakage's recipient rows already use, so Slack resolves the mention from the speaker's own canonical: by address for an email canonical, directly and with no API call for a synthetic slack:<team>:<id> one. Only a user subject that the platform encoded qualifies. A recorded speaker that does not (an agent-authored turn, a raw passthrough) gets no row at all: the starter did not ask, so naming them would be a guess. Only a session with no recorded speaker falls back to the started-by identity. The row's plain fallback is now the person's email when one is known (decoded from the speaker's canonical, or the started-by email annotation, stamped as a pair with the external id), so non-Slack surfaces stop showing a raw Slack user id. Approvers on those surfaces therefore see the requester's email address.
|
Deployment failed for project openagentprimitives with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
Author
This branch has not been 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.

Motivation
A tool-approval card tells the approver why the agent wants a call, what the call does and which permission it needs. It does not say who asked. The runner already resolves a requester and puts it on the ask payload, and
pipeline_wiring.gosays the approver must see it ("alice's widget wants to delete X").buildToolCallPendingnever read it, so no card showed it.Found while running a Slack demo where Alice's request needed Bob's approval: Bob's card gave no sign that Alice was the one asking.
Wiring the field up exposed a second problem. On the LLM path, the value names the person who started the session, not the person asking.
internal/cmd/runnernever assignsLastInboundExternalID, so the runner always fell back to the started-by annotations. One runner serves a whole multiplayer thread. When Alice starts a thread and Bob asks for a call, the card would read "Requested by @alice", lending Bob Alice's credibility on a security decision.Summary of changes
InteractionField.Mentions, the seam thatpermission_request's "From" row already uses. Slack's existingresolveFieldMentionsturns it into a live mention, andValueis the plain fallback for local, browser and fake. The resolved Approved/Denied card keeps the row.lastInboundAuthor), not the session starter.Two behaviors for reviewers to weigh:
advanceRequesterdocuments for the authorization subject.Not in this PR: the admin console's "requested by" column stays empty.
pkg/web/admind/aggregator.gonotes that the generic interaction list carries no requester.Alternatives considered
authSubject. UnderstartedByauthorization mode it stays frozen at the starter. That is exactly the case where Bob's call runs on Alice's grants, and the approver most needs to see that Bob asked.Provenance
claude-opus-5-5), directed by Sohan MaheshwarShip gate
mage test:unitmage test:integrationmage test:e2eResults (branch head
96d17da):Regeneration
+kubebuilder:rbacmarker or a CRD-shaping field: n/aconfig/**: n/amage fmt:checkcovers only Markdown and TypeScript, and this PR changes neither.gofmt -lon the changed Go files is clean.Coverage
assert.approvalPrompts) but cannot read a card's fields. Adding that to the bundle format is a separate change. Coverage here comes from:pkg/agent/runner/tool_approval_requester_test.go: who the row names, for each speaker shapepkg/agent/runner/apptool_viewer_authz_test.go: the LLM path ignores the viewer argumentpkg/agent/runner/host_approval_tool_leakage_test.gopkg/channels/channelkinds/slack/interaction_requested_by_test.go: live mention, resolved cardpkg/channels/channelkinds/local/interaction_test.gomage test:integration+mage test:e2eare green.Before requesting review