Tree sync d6a22a1aed70 → 5163763e703c on xai-org/grok-build: safer worktree GC, session title refresh, parallel media-gen caps, and consent/session metadata updates (still product 1.0.4).
Changelog
[new] grok worktree gc now safety-checks before removing expired worktrees: uncommitted/untracked/ignored work, commits only reachable from that worktree, and git-dir-only state keep the tree; unreachable commits are named under refs/grok/reclaimed/ for recovery, and stale reclaim names are collected on later passes.
[new] GC judges as many worktrees as it can in about a minute per run (including the timed background pass); anything not reached is reported as Not judged this pass so you can re-run until that count is zero.
[new] Session titles generate automatically after the first prompt, refresh on a couple of early turns, then freeze; manual /rename wins until /rename --auto hands control back.
[new] Optional caps on parallel media generation in a single model step via [tools.media_gen] (max_parallel_image_gen_calls, max_parallel_video_gen_calls) or GROK_MAX_PARALLEL_IMAGE_GEN_CALLS / GROK_MAX_PARALLEL_VIDEO_GEN_CALLS (defaults 8 image / 4 video), with a one-time retry on a first 2× burst.
[new] Welcome-flow consent gating before a session proceeds.
[new] Session index/summary.json carries last_turn_summary, last_recap, and title_is_manual for listing and dashboard surfaces.
[changed] Default model entries for Grok 4.6 and Grok 4.5 include a model_family of xai.
[changed] Tool commands and related session plumbing can honor GROK_TITLE_REFRESH and GROK_FORCE_LOGIN_TEAM_ID.
Agent & tools
[new] Media-generation batch limiting (media_gen_limits) enforces the parallel image/video caps above during a model step.
[new] Session title refresh path keeps dashboard//resume/prompt-border titles in sync with the auto-title policy.
[changed] Fast worktree GC/safety stack gains reachability, git-dir, working-tree, and reclaim-ref handling used by grok worktree gc and du.
Docs
[changed] Configuration guide documents [tools.media_gen] parallel caps and the overriding env vars.
[changed] Sessions guide documents automatic title generation//rename behavior, richer summary.json fields, and the worktree GC safety/refs/grok/reclaimed/ recovery model.
Under the hood
Fast-worktree crate expands GC, process scan, safety gating, and reclaim-ref maintenance; related child safety source/worktree env knobs landed for that path.
Config registry types, memory observation hooks, consent config/views, and session queue-mutation helpers were added; pager build.rs and the old session search-gate/consumed-sentinel modules were removed.
Dependency lockfile and version.json point at commit 5163763e703c; TOS host https://x.ai/legal/tos is referenced from the tree.
Upgrade notes
Building from this tree: no new mandatory config. If you rely on heavy parallel image/video tool use, review [tools.media_gen] or the GROK_MAX_PARALLEL_*_GEN_CALLS env vars.
When reclaiming disk with grok worktree gc, prefer --dry-run first; --force does not skip the new safety checks. Recover reclaimed commits with git log refs/grok/reclaimed/ as described in the sessions guide.