Repository navigation
matrix: add exec approval reaction shortcuts - #60931
Conversation
Greptile SummaryThis PR adds Matrix-native emoji reaction shortcuts ( Two minor docs cleanups are worth addressing: the new Confidence Score: 5/5Safe to merge; all remaining findings are P2 docs style issues that do not affect runtime behavior. The implementation logic is sound, the regression test (approval reactions still fire when reactionNotifications is off) directly covers the stated bug, and the code changes are well-scoped to the Matrix extension. Only P2 documentation structure issues remain. docs/channels/matrix.md — section ordering and one stale sentence at line 686.
|
There was a problem hiding this comment.
Pull request overview
Adds Matrix-native emoji reaction shortcuts for exec approvals so approvers can tap/click reactions (✅/❌/♾️) instead of typing /approve ..., and routes inbound reaction events to resolve approvals even when generic reaction notifications are disabled.
Changes:
- Seed approval prompt messages with a “React here …” hint and add the corresponding emoji reactions on send.
- Handle inbound Matrix reactions by detecting approval reactions and resolving the underlying exec approval via the gateway.
- Add unit tests + docs covering the Matrix approval reaction flow and the
reactionNotifications: "off"regression.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/matrix/src/matrix/monitor/reaction-events.ts | Adds approval-reaction detection/resolution before generic reaction notification routing. |
| extensions/matrix/src/matrix/monitor/reaction-events.test.ts | New tests asserting approval reactions resolve and bypass generic reaction events (including notifications off). |
| extensions/matrix/src/exec-approvals-handler.ts | Appends reaction hint to pending approval text and seeds allowed decision reactions on the pending message. |
| extensions/matrix/src/exec-approvals-handler.test.ts | Verifies reaction hint text and that expected reactions are seeded (including allow-always omission). |
| extensions/matrix/src/exec-approval-resolver.ts | New helper to resolve exec approvals via the gateway approvals client (plus not-found detection). |
| extensions/matrix/src/exec-approval-resolver.test.ts | Tests gateway submission and structured “approval not found” error recognition. |
| extensions/matrix/src/approval-reactions.ts | New helper to build reaction hints/bindings and parse approval prompt text to resolve a reaction to a decision. |
| extensions/matrix/src/approval-reactions.test.ts | Tests binding order, hint formatting, and reaction-to-decision resolution. |
| docs/tools/exec-approvals.md | Documents that native chat clients can provide channel-specific approval affordances (Matrix reactions). |
| docs/channels/matrix.md | Documents Matrix exec approval reaction shortcuts and fallback /approve commands. |
Comments suppressed due to low confidence (1)
extensions/matrix/src/matrix/monitor/reaction-events.ts:129
- With
reactionNotifications: "off", this handler still callsclient.getEvent(...)for every inbound reaction before returning, even though ordinary reactions will ultimately be dropped. This can add avoidable homeserver traffic. Consider resolvingnotificationModeearlier and short-circuiting beforegetEventwhen notifications are off and the reaction key cannot be an approval shortcut (e.g., not one of the approval emojis).
const reaction = extractMatrixReactionAnnotation(params.event.content);
if (!reaction?.eventId) {
return;
}
if (params.senderId === params.selfUserId) {
return;
}
const targetEvent = await params.client.getEvent(params.roomId, reaction.eventId).catch((err) => {
params.logVerboseMessage(
`matrix: failed resolving reaction target room=${params.roomId} id=${reaction.eventId}: ${String(err)}`,
);
return null;
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0d038a33b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8d92561 to
3398394
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3398394f5d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
aa376fa to
bbbd409
Compare
bbbd409 to
a34e824
Compare
|
Merged via squash.
Thanks @gumadeiras! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a34e8248b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Merged via squash. Prepared head SHA: a34e824 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Merged via squash. Prepared head SHA: a34e824 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Merged via squash. Prepared head SHA: a34e824 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Merged via squash. Prepared head SHA: a34e824 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Merged via squash. Prepared head SHA: a34e824 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Merged via squash. Prepared head SHA: a34e824 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Summary
/approvecommands; no Matrix-native click/tap affordance.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
reactionNotifications: "off".Regression Test Plan (if applicable)
extensions/matrix/src/approval-reactions.test.ts,extensions/matrix/src/exec-approvals-handler.test.ts,extensions/matrix/src/matrix/monitor/reaction-events.test.tsUser-visible / Behavior Changes
✅allow once,❌deny, and♾️allow always when available./approve ....Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation:Repro + Verification
Environment
channels.matrix.execApprovals.enabled=truewith Matrix approvers configuredSteps
✅,❌, or♾️(when allowed).Expected
Actual
Evidence
Human Verification (required)
reactionNotificationsisoff;allow-alwaysomitted when effective ask mode disallows it.Review Conversations
Compatibility / Migration
Risks and Mitigations
/approvecommands remain as fallback.