feat: relay Grok approval notices and explicit one-time responses - #80
Conversation
🦋 Changeset detectedLatest commit: 2512e55 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
5a1ae78 to
eaf0074
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a1ae78816
ℹ️ 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".
| const incoming = page.slice(index + 1); | ||
| for (const entry of incoming) { | ||
| if (entry.kind !== "send-message" || own.has(entry.requestId)) continue; | ||
| const approvalNotice = grokApprovalNotice(entry, targetId); |
There was a problem hiding this comment.
Classify approval cards before suppressing return echoes
When Grok raises an approval while processing an automatically returned Codex answer, the card's outer requestId matches a grok-return ID in own, so the preceding guard skips the entry before grokApprovalNotice runs. The poll then advances its cursor, permanently hiding that pending approval from Codex. Approval cards need to be classified before applying the normal own-response suppression.
Useful? React with 👍 / 👎.
Grok auto-review and local-tool approval cards have no text body, so the relay currently pauses on them as empty messages. Forward new pending cards as approval notices without returning Codex's chat answer as authorization.
Add
gbot approvals list/respondand MCPgbot_grok_approvals/gbot_grok_respond. Responses re-read the latest 200 entries and require exact current bot/card/request IDs. Accept grants once, decline denies, and truncated action details require the owning UI for acceptance. Notices include the actual local target and machine. Existing Codex-origin interaction handling is unchanged.Validation: independent review PASS; 33 focused relay/approval tests and 15 MCP route tests; source/artifact validation, build and typecheck. Native API methods/resolutions checked against the Grok host contract. Live Grok approval round-trip is not yet proven. Older cards and unsupported cookie/payment requests require the owning Grok UI.
Host-aware tool inventory is a separate follow-up; this PR does not claim to implement it.