Synced from monorepo
Synced from monorepo Changes: - grok-shell: send an expired external-provider credential to the sign-in flow, not a 401 loop - pager: clickable ▲ jumps to the top of the response being read - grok-shell: keep a large task log from making the completion message too long - Plan viewer scrollbar: widen grab zone to the border column; fix striped thumb in Terminal.app - pager: poll the tmux probe teardown grace instead of sleeping it - security: vendor-compat MCP kill switch is now actually enforced when reported as on - grok-shell: restore session eviction when a leader client disconnects - Bump rust-toolchain to 1.93.0 - workspace: lexical-normalize permission path patterns before glob matching - pager: reject garbage Enter in the /resume picker - pager: show Mermaid affordances in plan mode preview - pager: drop manage-account link from /session-info - workspace: auto-approve read-only git queries; defer write floor to auto classifier - Add free-form pattern editor to the "Always allow" command prompt - grok-shell: fix /btw caching - pager: Tab walks answers in the ask_user_question card - External-provider auth refresh: single 7s attempt instead of 3×5s - pager: don't resurrect finished background tasks as Running when completion arrives first - pager: report tmux truecolor clamping in Doctor - Fix plan viewer scrollbar click+drag hijacked by comment gutter - pager/shell: stop double Recap after the same last turn - sampler: preserve x-should-retry through stream collection - pager: clear plan-mode indicator immediately when the user approves a plan - pager: tmux does not re-read its config on reattach Source-Revision: 64c4de99cc822b25ce9c54ab5a4f372093d0885d
This commit is contained in:
parent
a422116582
commit
780d1388ff
323 changed files with 12258 additions and 7226 deletions
|
|
@ -199,6 +199,15 @@ fi
|
|||
echo "{\"access_token\": \"$TOKEN\", \"expires_in\": 3600}"
|
||||
```
|
||||
|
||||
The refresh run is headless: stdin is closed and the binary is given a few
|
||||
seconds, so it cannot prompt you. If it can't produce a token there — because
|
||||
your SSO session lapsed and it needs you to sign in again — Grok stops treating
|
||||
the stored credential as usable and starts the interactive flow instead, the
|
||||
same one you get on a machine that has never signed in. That run has a long
|
||||
timeout and shows your binary's stderr, so a device-code URL or a browser prompt
|
||||
reaches you. Mid-session, the turn fails with a re-auth prompt and `/login`
|
||||
re-runs the binary interactively.
|
||||
|
||||
### Environment Variables
|
||||
|
||||
| Variable | Description |
|
||||
|
|
|
|||
|
|
@ -93,10 +93,32 @@ Switch between the prompt input and scrollback pane.
|
|||
|-----|---------|---------|--------|
|
||||
| `Tab` | `Space` (and `i` in vim mode) | Scrollback focused | Focus the prompt input |
|
||||
| `Tab` | | Prompt focused | Focus the scrollback (both simple and vim scrollback modes) |
|
||||
| `Tab` | `Shift+Tab` (backwards) | Question card focused | Walk the card's answers, wrapping round at the ends. Focus stays in the card |
|
||||
| `Enter` | | Prompt focused | Send the current prompt |
|
||||
|
||||
**Esc is not a focus key.** It follows the cancel / clear / rewind semantics below. The mid-turn cancel is the only branch gated on `[ui].vim_mode` (scrollback nav); nothing depends on `[ui].simple_mode` (prompt editor). Overlays, modals, slash/file dropdowns, voice, search, and selection still steal Esc first.
|
||||
|
||||
## Question card (`ask_user_question`)
|
||||
|
||||
While the agent is waiting on an answer, the card owns the keyboard.
|
||||
|
||||
| Key | Action |
|
||||
|-----|--------|
|
||||
| `↑` / `↓`, `j` / `k` | Move between answers (clamped at the ends) |
|
||||
| `Tab` / `Shift+Tab` | Walk the answers in a loop: every answer of this question, then the next question's, and off the last answer back to the first |
|
||||
| `←` / `→`, `h` / `l`, `[` / `]` | Previous / next question |
|
||||
| `1`–`9`, `a`–`f` | Pick that answer directly |
|
||||
| `z` | Jump to the free-text row and start typing |
|
||||
| `Space` | Toggle the focused answer (multi-select), or start typing on the free-text row |
|
||||
| `Enter` | Select and advance, submit on the last question, or edit the free-text row |
|
||||
| `Esc` | Unselect this question's answer. It does not move focus |
|
||||
| `y` | Copy the focused answer |
|
||||
| `Shift+X` | Dismiss the question (the agent continues without an answer) |
|
||||
| `Ctrl+F` | Fullscreen the card |
|
||||
|
||||
While typing a free-text answer, `Enter` submits and `Esc` returns to the
|
||||
answer rows; every other key goes to the text field.
|
||||
|
||||
## Escape
|
||||
|
||||
| State | Gesture | Effect |
|
||||
|
|
|
|||
|
|
@ -630,7 +630,7 @@ gap_right = 0 # gap between scrollbar and screen edge
|
|||
[scrollback.scroll]
|
||||
margin = 0 # minimum context lines above/below selection
|
||||
min_page_fraction = 0 # minimum scroll as % of viewport (0-100)
|
||||
follow_indicator = "center" # follow indicator: "center" or "none"
|
||||
follow_indicator = "center" # ▼/▲ scroll indicators: "center" or "none"
|
||||
follow_auto_select = true # auto-select latest entry in follow mode
|
||||
follow_by_overscroll = true # scrolling past bottom engages follow mode
|
||||
anchor_on_fold = true # keep block position when folding
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ gap_right = 0 # Gap between scrollbar and screen edge (0 = at edge)
|
|||
[scrollback.scroll]
|
||||
margin = 0 # Context lines above/below selected entry (0 = edge)
|
||||
min_page_fraction = 0 # Minimum scroll as % of viewport (0-100)
|
||||
follow_indicator = "center" # "center" = show down-arrow, "none" = hidden
|
||||
follow_indicator = "center" # "center" = show the ▼/▲ scroll arrows, "none" = hidden
|
||||
follow_auto_select = true # Auto-select latest entry when following
|
||||
follow_by_overscroll = true # Scrolling past bottom engages follow mode
|
||||
anchor_on_fold = true # Keep block header at same screen position when folding
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ This shows:
|
|||
|
||||
- Session title (when set)
|
||||
- Shell version
|
||||
- Auth method (OAuth vs API key) and where to manage account and credits (https://grok.com/?_s=billing for OAuth, console.x.ai for API key; API-key sessions also suggest `grok login` for SuperGrok)
|
||||
- Auth method (OAuth vs API key; API-key sessions also suggest `grok login` for SuperGrok)
|
||||
- Session ID
|
||||
- Working directory
|
||||
- Model (with a model hash for coding models)
|
||||
|
|
|
|||
|
|
@ -26,11 +26,12 @@ that appear only as silence during capture.
|
|||
When Doctor finds an explicit unhealthy tmux setting, `/doctor fix` lists the
|
||||
available automatic fixes. Apply one named fix at a time, for example
|
||||
`/doctor fix tmux-clipboard` or `grok doctor fix dcs-passthrough --yes`.
|
||||
Doctor can persist these three tmux options:
|
||||
Doctor can persist these four tmux options:
|
||||
|
||||
- `terminal.tmux-clipboard` — `set -g set-clipboard on`
|
||||
- `terminal.dcs-passthrough` — `set -wg allow-passthrough on`
|
||||
- `terminal.tmux-extended-keys` — `set -g extended-keys on`
|
||||
- `terminal.tmux-truecolor` — `set -as terminal-features ",*:RGB"`
|
||||
|
||||
A tmux fix edits only the persistent config on the computer hosting the affected
|
||||
tmux server, including remote sessions. Plain tmux uses the real
|
||||
|
|
@ -82,6 +83,16 @@ Detection has these limitations:
|
|||
Run `/doctor`. A fully supported setup shows `color truecolor` and `themes all`.
|
||||
If it does not, Doctor shows the detected limitation and the relevant fix.
|
||||
|
||||
Inside tmux there are two separate questions: what color Grok emits, and what
|
||||
color survives the multiplexer. The `color` line answers the first. For the
|
||||
second, when the attached client is not marked `RGB`, tmux rewrites every
|
||||
24-bit color to the nearest color the outer terminal's terminfo advertises,
|
||||
which can be as few as eight. Themes then look washed out even though `color`
|
||||
reads `truecolor`. Doctor reports this as `terminal.tmux-truecolor`. Reload
|
||||
your tmux config and then detach and reattach: the server reads the new option
|
||||
only on reload, and a client fixes its color depth only at attach, so neither
|
||||
step alone changes anything.
|
||||
|
||||
### Clipboard problems
|
||||
|
||||
Grok writes through up to three routes, shown in `/doctor` under **Clipboard**:
|
||||
|
|
|
|||
|
|
@ -161,6 +161,8 @@ After splitting chained commands (on `&&`, `||`, `;`, and pipes), the following
|
|||
|
||||
**Git (read-only):**
|
||||
- `git status`, `git branch`, `git log`, `git diff`, `git ls-files`, `git show`, `git rev-parse`
|
||||
- `git blame`, `git describe`, `git merge-base`, `git shortlog`
|
||||
- `git check-ignore`, `git check-attr`, `git cat-file`, `git ls-tree`, `git show-ref`, `git for-each-ref`, `git rev-list`, `git name-rev`, `git count-objects`
|
||||
|
||||
**Search and inspection:**
|
||||
- `grep`, `rg` (not `rg --pre` / `rg --pre=…`, which spawn a preprocessor per file)
|
||||
|
|
@ -337,15 +339,15 @@ A built-in list (`rm`, `chmod`, `chown`, `chgrp`, `chattr`, `pkill`, `kill`, `ki
|
|||
|
||||
### Read, Edit, and Grep Rules
|
||||
|
||||
Path patterns are globs matched against the path string the tool was called with:
|
||||
Path patterns are globs matched against the tool path after lexical normalization (`.`/`..` collapsed; relative paths joined with the session working directory). A `~`-prefixed tool path is matched literally — never joined with the working directory — because tools expand `~` to the home directory only after the permission check:
|
||||
|
||||
- `*` and `?` do not cross `/`; `**` does. `Read(src/*)` matches `src/main.rs` but not `src/nested/mod.rs`; use `Read(src/**)` for the whole tree.
|
||||
- A bare filename matches only that exact string. Use `**/.env` to match `.env` at any depth.
|
||||
- There are no anchor prefixes: a leading `//` or `~/` in a pattern is treated as literal glob text. Write absolute-path patterns or `**/` patterns instead.
|
||||
- Paths are matched as given, without canonicalization. Whether a path is absolute or relative depends on how the tool was invoked, so patterns intended as boundaries should cover both forms (for example both `/repo/secrets/**` and `secrets/**`).
|
||||
- Because `.`/`..` are collapsed before matching, rooted patterns cannot be escaped by traversal: `Read(./**)` scopes to the working directory (bare relatives like `src/main.rs` match; `./../../etc/passwd` does not), and `Read(src/**)` stays under `src/`. Unrooted patterns (`*`, or a leading `**` as in `**/*.rs`) intentionally match at any depth, anywhere.
|
||||
- `Read` rules also govern `grep` searches; `Grep(...)` rules match only grep.
|
||||
|
||||
`Read` and `Edit` deny rules additionally apply to file paths that shell commands touch (for example `cat` or `sed` on a denied path), including literal inline scripts passed to `bash`, `sh`, `dash`, `zsh`, or `ksh` with `-c`; that shell-level check also resolves symlinks. The direct `read_file`/`search_replace` tool checks do not resolve symlinks. For OS-level enforcement that covers every process, combine deny rules with the sandbox ([18-sandbox.md](18-sandbox.md)).
|
||||
`Read` and `Edit` deny rules additionally apply to file paths that shell commands touch (for example `cat` or `sed` on a denied path), including literal inline scripts passed to `bash`, `sh`, `dash`, `zsh`, or `ksh` with `-c`; that shell-level check uses the same working-directory-aware normalization (an absolute operand under the working directory also matches rooted rules like `Read(src/**)`) and also resolves symlinks. The direct `read_file`/`search_replace` tool checks do not resolve symlinks. For OS-level enforcement that covers every process, combine deny rules with the sandbox ([18-sandbox.md](18-sandbox.md)).
|
||||
|
||||
### MCP Rules
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ without the master switch.
|
|||
| `OTEL_EXPORTER_OTLP_ENDPOINT` | `http://localhost:4318` for HTTP, `http://localhost:4317` for gRPC | Base endpoint. For `http/protobuf`, `/v1/logs` and `/v1/metrics` are appended per the OTLP spec; for `grpc`, the collector endpoint is used as-is. |
|
||||
| `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` / `..._METRICS_ENDPOINT` | — | Signal-specific overrides, used verbatim. For gRPC these should normally be collector endpoints without `/v1/...` paths. |
|
||||
| `OTEL_EXPORTER_OTLP_HEADERS` (+ signal-specific variants) | — | Collector auth (`k=v,k2=v2`). The **only** headers the external exporters send, and the only supported collector-auth mechanism (no config-file headers key — tokens never live on disk). |
|
||||
| `OTEL_EXPORTER_OTLP_CERTIFICATE` (+ signal-specific variants) | — | Path to a PEM bundle with additional trusted CA certificate(s) for verifying the collector — for collectors behind a private/corporate CA. Additive to the default trust roots (system store and embedded Mozilla roots). |
|
||||
| `OTEL_EXPORTER_OTLP_TIMEOUT` | `10000` (ms) | Export timeout. |
|
||||
| `OTEL_METRIC_EXPORT_INTERVAL` | `60000` (ms) | Metric export interval. |
|
||||
| `OTEL_BLRP_SCHEDULE_DELAY` (or alias `OTEL_LOGS_EXPORT_INTERVAL`) | `5000` (ms) | Log batch interval. |
|
||||
|
|
@ -115,6 +116,30 @@ the `[telemetry]` `otel_*` keys through `grok setup` managed config /
|
|||
requirements pins, or force-disable it fleet-wide with the same local config
|
||||
layers (`external_otel_disabled`, content-gate locks).
|
||||
|
||||
## Startup suppression (why nothing arrives for the first few seconds)
|
||||
|
||||
Because xAI can force-disable this stream fleet-wide, the CLI holds emission
|
||||
closed at startup until it knows whether that switch is set — it fetches the
|
||||
fleet policy from `/v1/settings` and only then starts exporting. In a healthy
|
||||
setup that is well under a second and invisible.
|
||||
|
||||
**The wait is bounded**, so a deployment that cannot reach xAI still exports:
|
||||
|
||||
- If no fleet policy can apply at all — `[features] remote_fetch = false`, or
|
||||
`[endpoints] cli_chat_proxy_base_url` points somewhere other than xAI — the
|
||||
stream starts immediately, governed by your local configuration.
|
||||
- If the policy fetch fails or never completes (firewalled host, offline
|
||||
laptop), emission starts anyway once the attempt is exhausted, and in all
|
||||
cases no later than 30 seconds after startup.
|
||||
|
||||
A fleet policy that arrives afterwards still applies; it can only ever
|
||||
*tighten* (disable the stream or force the content gates off), never enable
|
||||
something your local configuration did not.
|
||||
|
||||
If your collector receives nothing at all, check the debug log
|
||||
(`grok --debug`) for `external otel:` lines — they record whether the stream
|
||||
resolved its configuration, and whether it is exporting or suppressed.
|
||||
|
||||
## Resource attributes
|
||||
|
||||
| Attribute | Value |
|
||||
|
|
|
|||
Loading…
Reference in a new issue