Add Grok Build support (context, setup, native hooks)#1647
Open
xormania wants to merge 2 commits into
Open
Conversation
a2cc3ba to
ecf7e77
Compare
Contributor
Author
|
I understand this is a lot - but Grok is a Player - 4.5 just released - its good. |
Adds first-class support for xAI's Grok Build CLI, following the
existing client-integration pattern (Claude Code, CodeBuddy, Codex):
- grok context: single-project, shaped like claude-code.yml, with the
file-tool exclusions appropriate for a CLI agent that has its own
read/edit/shell tools. structured_tool_output is left at the auto
default (as in the codex and codebuddy contexts); claude-code's
explicit false is a Claude-Code-specific bug workaround that is not
carried over.
- serena setup grok: registers Serena as a user-scoped MCP server via
"grok mcp add" after detecting a compatible grok CLI.
- serena-hooks --client=grok: Grok-native PreToolUse output
({decision, reason}) instead of the Claude-style hookSpecificOutput
envelope; grep/read detection extended to Grok's tool names and
shell payloads (target_file/targetFile path keys, non-string command
values handled defensively). The payload-parsing refinements live in
the remind hook's client-agnostic parsing and apply to all hook
clients: a non-string command value previously raised, and
target_file/targetFile paths were not recognized.
- Docs (030_clients.md #grok), unit tests for setup/hooks/context, and
scripts/live_test_grok.py - a zero-inference, state-preserving live
smoke test against a real grok installation (documented in
CONTRIBUTING.md). Its M5 check verifies the structured-output wire
shape: the grok context (auto default) serves an output schema and
structuredContent for string-returning tools, while the claude-code
context (explicit false workaround) serves plain text only.
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.
Adds dedicated support for using Serena with xAI's Grok Build CLI.
Changes
grokcontext (single-project, optimized for Grok Build; shaped like the existingclaude-codecontext — exceptstructured_tool_output, which is left at the auto default as in thecodex/codebuddycontexts, sinceclaude-code's explicitfalseis a Claude-Code-specific bug workaround)serena setup grokcommand to register Serena as a user-scoped MCP server (with CLI compatibility detection)serena-hooks --client=grok), including PreToolUse allow/deny output in Grok's{decision, reason}formatcommandvalues no longer raise, andtarget_file/targetFilefile-path keys are recognized (CHANGELOG entry added under Hooks)docs/02-usage/030_clients.md), unit tests for setup/hooks/context, andscripts/live_test_grok.py— a zero-inference, state-preserving live smoke test against a realgrokinstallation (documented inCONTRIBUTING.md)This lets agents using the
grokCLI get proper Serena integration with--project-from-cwdand correct context behavior.Note: the
other-langs (macos-latest)failure is unrelated to this PR — it is a pre-existing break onmain(shader-sense 1.4.0 broke the HLSL server build from source), fixed in #1652. I will refresh this branch once that lands.Checklist
CONTRIBUTING.mdregarding the scope of PRs.CHANGELOG.md, which concisely describes the change.