Repository navigation
Detect Grok Bot - #21
Merged
Merged
Conversation
Grok Bot sets CURSOR_AGENT alongside SAND_BOX_BOOT_ID and SAND_BOX_STORE_ID, so it is matched before Cursor. Session ids still come from CURSOR_CONVERSATION_ID. Co-authored-by: David Mokos <davidmokos@users.noreply.github.com>
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.
Grok Bot's shell sets
CURSOR_AGENT=1andCURSOR_CONVERSATION_ID, which also match Cursor, plusSAND_BOX_BOOT_IDandSAND_BOX_STORE_ID. Each agent's env signals are OR'd, andselectBestAgentreturns the first match indefaultAgentsorder, sogrok-botis listed beforecursor. EitherSAND_BOX_*variable detects it; the session id still comes fromCURSOR_CONVERSATION_ID.This is separate from the existing
grokagent (GROK_AGENT/GROK_SESSION_ID).Test plan
npm test(build and full suite, 21 passed)