Skip to content

feat(grok): add fail-closed tool activity compatibility#3903

Merged
CompleteDotTech merged 20 commits into
mainfrom
agent/issue-3845-grok-tool-activity
Jul 26, 2026
Merged

feat(grok): add fail-closed tool activity compatibility#3903
CompleteDotTech merged 20 commits into
mainfrom
agent/issue-3845-grok-tool-activity

Conversation

@CompleteDotTech

@CompleteDotTech CompleteDotTech commented Jul 26, 2026

Copy link
Copy Markdown
Member

Fixes #3845. Beads: cave-trt.5.

Compatibility behavior

  • Built-in Grok Build support is restricted to the source-verified streaming-json frames: text, thought, end, and error; it claims no tool lifecycle aliases.
  • Tool activity is enabled only by a selected Ed25519-signed schema with exact locally probed Grok Build version declarations, stable IDs, and a launcher-proven value-bearing --output-format streaming-json capability. Probing uses the exact preflight-approved launcher and familiar-scoped environment. No tool envelope names were inferred or captured.
  • Registry refresh is bounded and fail-closed: canonical signature payload, key IDs/rotation, strict schema/key/URL validation, immutable checkpoint/high-water journal, cache integrity/expiry/rollback protection, lock ownership, and in-process schema quarantine.
  • Production accepts only release-packaged Grok registry trust material; mutable COVEN_GROK_SCHEMA_REGISTRY_* overrides are development-only. The five-second refresh deadline covers response headers and a stalled body.
  • A client that previously accepted a newer remote contract never revives the older compiled parser when that cache expires or its high-water anchor is missing/corrupt; it remains in plain chat until a verified refresh. The compiled baseline also expires into an accessible plain-chat fallback.
  • Unsupported, malformed, or unverified structured output falls back to safe plain chat with redacted accessible diagnostics. Parseable object/array payloads are dropped while actual prose beginning with [ or { is retained.
  • The real-route fixture creates an ephemeral signed test schema with fixture_tool_* aliases. Those aliases are not Grok protocol claims; it verifies selected-schema routing, persistence, terminal errors, duplicate frames, and reordered progress/results.

Evidence

Verified 2026-07-26 against the xAI Grok Build overview and upstream headless-mode documentation at revision 47348d13ec4508dcfe440e34c6d511bb02998fb2. These document headless --output-format streaming-json and only text/thought/end/error frames, not tool lifecycle events. No local Grok installation, credentials, paid run, fabricated capture, or undocumented Grok event name was used.

Latest remediation and validation

  • Rebased onto current origin/main at 76d74e66 and force-pushed 605596c8cf4e063366cd9a76fce88d0d7b70419a; no Grok protocol behavior changed during rebase.
  • Passed focused Grok build/compatibility/real-route/harness-routing/release-guard tests, pnpm check:tests-wired, pnpm typecheck, pnpm lint, and git diff --check after the rebase.
  • The prior head's CI and CodeQL were fully green. Fresh CI/CodeQL is pending on the rebased head.

Release prerequisite

A maintainer-owned release environment must provide GROK_SCHEMA_REGISTRY_URL, GROK_SCHEMA_REGISTRY_PUBLIC_KEY or GROK_SCHEMA_REGISTRY_PUBLIC_KEYS, and GROK_SCHEMA_REGISTRY_CHECKPOINT. They are public verification material; never add a private signing key.

@CompleteDotTech
CompleteDotTech force-pushed the agent/issue-3845-grok-tool-activity branch from f76922f to 78e9236 Compare July 26, 2026 16:05
@CompleteDotTech CompleteDotTech self-assigned this Jul 26, 2026
@CompleteDotTech CompleteDotTech linked an issue Jul 26, 2026 that may be closed by this pull request
@CompleteDotTech
CompleteDotTech marked this pull request as ready for review July 26, 2026 17:13
@CompleteDotTech
CompleteDotTech force-pushed the agent/issue-3845-grok-tool-activity branch 5 times, most recently from eff47b6 to b167dd2 Compare July 26, 2026 19:50
@CompleteDotTech
CompleteDotTech force-pushed the agent/issue-3845-grok-tool-activity branch from b167dd2 to 605596c Compare July 26, 2026 20:21
@CompleteDotTech
CompleteDotTech merged commit a7c2029 into main Jul 26, 2026
15 checks passed
@CompleteDotTech
CompleteDotTech deleted the agent/issue-3845-grok-tool-activity branch July 26, 2026 21:07
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.

Add full Grok Build tool-activity compatibility

1 participant