Skip to content

fix(detect): update Grok agent detection rules for Grok Build 1.0.x - #2764

Closed
jasonchen36 wants to merge 1 commit into
herdrdev:masterfrom
jasonchen36:fix-grok-agent-detection
Closed

fix(detect): update Grok agent detection rules for Grok Build 1.0.x#2764
jasonchen36 wants to merge 1 commit into
herdrdev:masterfrom
jasonchen36:fix-grok-agent-detection

Conversation

@jasonchen36

Copy link
Copy Markdown

Problem

Idle Grok Build 1.0.x agents were incorrectly classified as working (yellow filled status indicator in Herdr) when idle at the prompt for two main reasons:

  1. prompt_hints_idle only matched ctrl+.:shortcuts, but Grok Build 1.0.x renders Ctrl+x:shortcuts or Shift+Tab:mode in the prompt footer.
  2. esc_cancel_hints_working erroneously contained ctrl+.:shortcuts, marking idle prompts as working.
  3. osc_progress_working (priority 1150) outranked title/prompt idle rules, but Grok Build 1.0.x emits OSC 9;4;1;-1 during turn execution without sending OSC 9;4;0;0 to clear progress upon yielding.
  4. Historical subagent/tool transcript lines (┃ ◆) in scrollback buffer outranked title/prompt idle rules.

Solution

  • Added ctrl+x:shortcuts and shift+tab:mode to prompt_hints_idle matcher and boosted its priority to 1160 so idle prompt footers outrank scrollback transcript history.
  • Increased osc_title_idle priority to 1140 and made regex case-insensitive and flexible across title variations.
  • Removed ctrl+.:shortcuts from esc_cancel_hints_working.
  • Deprioritized osc_progress_working to priority 900 below prompt/title idle rules.
  • Synchronized src/detect/manifests/grok.toml and website/agent-detection/grok.toml.

Verification

  • Verified against live Herdr agent list and pane snapshot outputs.
  • Passed python3 scripts/agent_detection_manifest_check.py --require-website.
  • Passed python3 scripts/test_agent_detection_manifest_check.py.

- Add 'ctrl+x:shortcuts' and 'shift+tab:mode' to prompt_hints_idle matcher to recognize modern Grok Build idle prompt footers.
- Increase prompt_hints_idle priority to 1160 and osc_title_idle to 1140 so idle prompt/title state outranks historical subagent/tool lines in scrollback.
- Remove 'ctrl+.:shortcuts' from esc_cancel_hints_working to prevent false-positive working status on idle prompts.
- Deprioritize osc_progress_working to priority 900 because Grok 1.0.x does not emit OSC 9;4;0;0 when yielding to prompt.
- Synchronize bundled src/detect/manifests/grok.toml and website/agent-detection/grok.toml.
@kangal-bot

Copy link
Copy Markdown
Collaborator

Hi @jasonchen36, thanks for your interest in contributing.

Herdr does not accept unsolicited implementation pull requests from contributors who are not listed in .github/APPROVED_CONTRIBUTORS.

The pull request author is not an approved contributor.

If you encountered a reproducible bug, report the observed behavior through the bug issue template. A report does not reserve the work or authorize a pull request; accepted fixes are normally implemented by Herdr’s maintainer-controlled agents.

Feature requests, behavior changes, and other proposals belong in GitHub Discussions. Do not open an issue merely to justify an implementation that was already written.

If a maintainer explicitly wants this implementation, they can reopen the pull request. Reopening by anyone else will be closed again automatically.

See https://github.com/herdrdev/herdr/blob/master/CONTRIBUTING.md for the contribution policy.

@kangal-bot kangal-bot closed this Aug 13, 2026
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ai-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 519d5895-7323-4488-8730-c1737dee894d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

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.

2 participants