Skip to content

Fix noisy Grok tool notifications - #6306

Merged
nwparker merged 1 commit into
stablyai:mainfrom
nwparker:nwparker/grok-bells
Jun 26, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
nwparker:nwparker/grok-bells

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

  • suppress Grok's routine Notification(permission_prompt) / Tool permission requested info hook before tool use
  • keep actionable Grok feedback/permission notifications mapped to attention states
  • add shared, renderer notification, and Electron e2e coverage for the Grok hook sequence

Repro / Diagnosis

Using installed grok 0.2.64, Grok emits routine notification hooks before tool use:

{
  "hookEventName": "notification",
  "notificationType": "permission_prompt",
  "message": "Tool permission requested",
  "level": "info"
}

Orca previously treated that broad permission-looking notification as waiting, which could drive non-actionable "Using Shell" / "Using Glob" notifications. The fix ignores only this routine info notification; PreToolUse still reports progress and Grok stop / real feedback notifications still flow normally.

Evidence

  • grok --version -> grok 0.2.64 (9a9ac25b10f) [stable]
  • pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-hook-listener.test.ts src/renderer/src/hooks/agent-hook-completion-notifications.test.ts -> 2 files passed, 60 tests passed
  • pnpm exec oxlint src/shared/agent-hook-listener.ts src/shared/agent-hook-listener.test.ts src/renderer/src/hooks/agent-hook-completion-notifications.test.ts tests/e2e/helpers/agent-hook-endpoint.ts tests/e2e/droid-notification.spec.ts -> passed
  • pnpm exec oxfmt --check src/shared/agent-hook-listener.ts src/shared/agent-hook-listener.test.ts src/renderer/src/hooks/agent-hook-completion-notifications.test.ts tests/e2e/helpers/agent-hook-endpoint.ts tests/e2e/droid-notification.spec.ts -> passed
  • pnpm run typecheck -> passed
  • pnpm exec playwright test tests/e2e/droid-notification.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 -> 4 passed

The new Electron e2e case verifies Grok reaches working, the routine permission prompt does not set waiting or dispatch a task-complete notification, and Grok stop still reaches done.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds Grok-specific routine permission prompt handling in shared hook normalization, returning null for that notification type. It also adds unit tests in shared and renderer hook notifications, a Grok hook POST helper, and an e2e scenario covering Grok hook status transitions and terminal completion dispatch timing.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the summary, reproduction, and evidence, but it omits required template sections like Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections, including Screenshots/No visual change, Testing checklist, AI Review Report, Security Audit, and Notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: suppressing noisy Grok tool notifications.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/renderer/src/hooks/agent-hook-completion-notifications.test.ts (1)

444-493: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

This test does not actually guard the suppression logic.

dispatchTerminalNotification only fires when the coordinator observes a done state after the quiet period; working/waiting statuses never trigger it. So the not.toHaveBeenCalled() check at Line 471 and the final single-dispatch assertion would still pass even if normalizeGrokEvent returned a waiting payload for the routine permission prompt instead of null. The test therefore doesn't distinguish "suppressed" from "routed as waiting" and won't catch a regression in isGrokRoutinePermissionPromptNotification.

Consider asserting the normalization contract directly inside the simulator, e.g. capture/return the event and assert it is null for the permission-prompt payloads.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: dee497a2-8be8-406d-bfe2-2c44de144431

📥 Commits

Reviewing files that changed from the base of the PR and between a828590 and 97c8ddd.

📒 Files selected for processing (5)
  • src/renderer/src/hooks/agent-hook-completion-notifications.test.ts
  • src/shared/agent-hook-listener.test.ts
  • src/shared/agent-hook-listener.ts
  • tests/e2e/droid-notification.spec.ts
  • tests/e2e/helpers/agent-hook-endpoint.ts

@nwparker

Copy link
Copy Markdown
Contributor Author

cc @JudouM
This should fix some grok issues! I will test and merge and try to get release out tomorrow.

@nwparker
nwparker merged commit fa00464 into stablyai:main Jun 26, 2026
4 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
nwparker added a commit that referenced this pull request Nov 8, 2026
…res (#39715)

Cap merged atlas pages at FORCED_MAX_TEXTURE_SIZE instead of the device
MAX_TEXTURE_SIZE (16384 on Apple Silicon), stop the link render layer
from acquiring the shared atlas with a mismatched 2048 texture size, and
reset GL texture slots of removed atlas pages to the 1x1 placeholder.
Mirrors xtermjs/xterm.js#6187, #6156 and #6306 in the addon-webgl source
patch and regenerates the runtime patch and lock hash.

Co-authored-by: FlamingoPg <1106310035@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant