Skip to content

fix(grokcli): stop adding permission_mode and write headersHelper as headers_helper - #3933

Merged
dyoshikawa merged 3 commits into
mainfrom
resolve-issue-2498-grok-mode-headers-helper
Nov 22, 2026
Merged

dyoshikawa merged 3 commits into
mainfrom
resolve-issue-2498-grok-mode-headers-helper

Conversation

@dyoshikawa

@dyoshikawa dyoshikawa commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two follow-ups from the 2026-11-19 upstream re-check in #2498, verified against the user guide embedded in the @xai-official/grok-linux-x64 1.0.90 binary (26-config-reference.md, 22-permissions-and-safety.md, 07-mcp-servers.md).

permissions (global): stop pinning users out of Grok's new default mode

Since Grok 1.0.80, ui.permission_mode defaults to auto in the TUI (ask for grok -p / grok agent) when no flag or config sets it. rulesync wrote permission_mode = "ask" on every generate --global that had a deny or ask rule, which silently moved TUI users from auto-review to ask.

  • The key is now only kept in sync when ~/.grok/config.toml already sets it to ask or always-approve (the two values rulesync derives). A missing key is never added, so Grok's own default applies.
  • auto and the new default value are left alone, as auto already was.
  • always-approve is now derived only from the all-tools catch-all allow "*": { "*": "allow" } with no deny/ask rule. Before, narrow allows such as bash: { "git *": "allow" } turned an existing ask into always-approve, so every tool ran without a prompt. (This bug was already there before this PR; it surfaced in review.)
  • Docs: an unset mode still imports as the narrower ask, and "*": { "*": "ask" } is the canonical way to be prompted for every tool under Grok's default auto mode.
  • Nothing gets wider: deny rules and the fine-grained [permission] arrays are written as before, and Grok applies deny (and ask) rules in auto-review mode too.
  • Docs note that earlier Rulesync versions added the key, and that you delete it to go back to Grok's default.

mcp: write headersHelper as headers_helper

Grok 1.0.88 added a header-minting command for HTTP/SSE MCP servers. In config.toml the key is headers_helper. The camelCase headersHelper is documented for .mcp.json only, and rulesync passed it through unchanged.

  • Generate renames canonical headersHelper to headers_helper.
  • Import reads headers_helper back as headersHelper. When an entry has both, headers_helper wins on generate and on import, whatever the key order, which matches Grok (it ignores headersHelper in that case).

Still open in #2498

Refs #2498

Test plan

  • Unit tests for both changes (grokcli-permissions.test.ts, grokcli-mcp.test.ts), with the global e2e permissions test updated
  • pnpm cicheck

🤖 Generated with Claude Code

https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4

dyoshikawa and others added 3 commits November 22, 2026 17:33
…r config.toml

- permissions (global): `[ui] permission_mode` is now only kept in sync when
  the config already sets it to `ask` or `always-approve`. A missing key is no
  longer added, since Grok 1.0.80 starts TUI sessions in `auto` when it is
  unset and writing `ask` pinned users out of that default.
- mcp: canonical `headersHelper` is written as `headers_helper`, the spelling
  Grok 1.0.88+ reads in `config.toml`, and read back on import (preferring
  `headers_helper` when both are present, as Grok does).

Refs #2498

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
… allow

- `[ui] permission_mode` becomes `always-approve` only when the config has
  `"*": { "*": "allow" }` and no deny/ask rule. Narrow allows such as
  `bash: { "git *": "allow" }` no longer upgrade an existing `ask`, which
  let every tool run without a prompt.
- Generate prefers an explicit `headers_helper` over `headersHelper` in the
  same MCP entry, so the result no longer depends on key order.
- Docs: note that an unset mode imports as the narrower `ask`, and that
  `"*": { "*": "ask" }` prompts for every tool under Grok's default auto mode.

Refs #2498

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…ok-mode-headers-helper

# Conflicts:
#	src/generated/docs-content.ts
@dyoshikawa
dyoshikawa merged commit b134e27 into main Nov 22, 2026
10 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-2498-grok-mode-headers-helper branch November 22, 2026 09:03
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