Skip to content

feat(coding-agent): add grok-4.6 prompt preset - #904

Merged
code-yeongyu merged 3 commits into
mainfrom
feat/grok-4-6-prompt-preset
Aug 16, 2026
Merged

feat(coding-agent): add grok-4.6 prompt preset#904
code-yeongyu merged 3 commits into
mainfrom
feat/grok-4-6-prompt-preset

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

Grok 4.6 shipped in four built-in catalogs (xai, opencode, openrouter, vercel-ai-gateway) with no prompt preset — the grok-4.5 matcher deliberately excludes it, so it fell back to the untuned dynamic prompt. This adds a grok-4.6 preset as a full-core rewrite tuned per the Grok 4.6 launch field guide (Eric Zakariasson, 2026-08-12). It is a direct-implementer core, deliberately NOT a clone of the grok-4.5 CEO/orchestrator preset, which is a fork experiment specific to that model.

Field-guide findings encoded in the core: exhortation phrasing ("work very hard") measurably changes nothing on this model while an explicit definition of "done" changes everything, so the routing line carries the binding declared-stop-condition contract and no intensity language; the single highest-leverage instruction is a real-surface verification loop (walk the user paths the change touches; for hard-to-inspect output: capture current state, list what is wrong, fix only those); its observed failure of repeating near-identical blocks across components gets one positive shared-piece rule; reporting is tuned information-dense (never restate the task, quiet through small changes, one short update at meaningful phase changes).

Changes

  • prompt-preset/grok-4.6.ts — new corePrompt preset (precedent: kimi-k3.ts / gpt-5.6.ts). Reuses buildTestDisciplineSection(); no buildFileOperationsTuning() because apply_patch is gated to gpt-* ids and never activates on Grok.
  • prompt-preset/presets.tshasGrok46Signal matcher (the 4.5 regex shape with a 4.6 minor version), checked before the 4.5 matcher; resolvePresetName branch + buildPreset case.
  • prompt-preset/settings.ts"grok-4.6" joins PromptPresetName / VALID_PRESETS.
  • docs/settings.md — preset value list gains grok-4.6 and the previously missing grok-4.5; fork trackers (prompt-preset/changes.md) and [Unreleased] changelog updated.
  • test/suite/prompt-presets-grok-4-6.test.ts — id-shape resolution (12 shapes incl. x-ai/, colon-separated, grok-4p6, grok46, trailing tags), non-routing of 4.5/4.3/4.20/3/build-0.1/4.60, 4.5-vs-4.6 distinctness, settings force, and a catalog sweep asserting every built-in Grok 4.6 entry resolves.

QA & Evidence

  • What was tested: senpi-qa mock-loop channel — the REAL CLI driven from source in an isolated sandbox against a local fake model server, asserting on the recorded provider request bytes for model ids grok-4.6, grok-4.5, and grok-4.3.
  • Observed result: 13/13 checks PASS — grok-4.6 turns carry the new implementer core ("running on Grok 4.6", declared stop condition, no CEO posture, no apply_patch reference); grok-4.5 keeps its CEO preset unchanged; grok-4.3 keeps the dynamic fallback; real ~/.senpi/agent/auth.json untouched.
  • Artifact: local-ignore/qa-evidence/20260817-grok-4-6-preset/ (qa-run.log + per-model captured system prompts; local evidence dir, gitignored by design).
  • Automated: new suite green (17 tests); prompt-presets-grok-4-5 and prompt-presets-extension suites green; root npm run check green. Full coding-agent suite: 7798 passed; 6 unrelated subprocess/timing tests failed under full-suite load and all pass in isolation.

Risks & Residuals

  • Matcher collisions: the 4.6 regex requires a terminator after the 6 (grok-4.60 does not match) and the 4.5/4.3/4.20 families are covered by negative tests — mitigated.
  • Prompt-content drift: coverage asserts structural sentinels and routing only (per the repo's prose-pinning prohibition), so wording can evolve without test churn — accepted.

Made with Cursor


Summary by cubic

Routes Grok 4.6 models to a new grok-4.6 system-prompt preset instead of the untuned dynamic prompt. Grok 4.6 now uses a direct-implementer core; Grok 4.5 stays on its CEO/orchestrator preset.

  • Adds grok-4.6.ts: full-core override via buildDynamicSystemPrompt with a binding declared stop condition, real-surface verification loop, shared-piece rule to avoid repeated blocks, and dense reporting; reuses buildTestDisciplineSection; no apply_patch references.
  • Introduces hasGrok46Signal and routes it before 4.5; excludes 4.60 and other families; updates resolvePresetName/buildPreset.
  • Extends PromptPresetName/VALID_PRESETS with "grok-4.6"; documents grok-4.5 and grok-4.6 in docs/settings.md; CHANGELOG and extension change log updated.
  • Adds tests for id-shape resolution, non-routing of other Grok versions, 4.5 vs 4.6 distinctness, settings override, and a built-in catalog sweep across xai, opencode, openrouter, and vercel-ai-gateway.

Written for commit c2646d9. Summary will update on new commits.

Review in cubic

code-yeongyu and others added 2 commits August 17, 2026 00:59
Co-authored-by: Cursor <cursoragent@cursor.com>
…t value list

Co-authored-by: Cursor <cursoragent@cursor.com>
@code-yeongyu
code-yeongyu enabled auto-merge August 16, 2026 16:00
…preset

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	packages/coding-agent/CHANGELOG.md
#	packages/coding-agent/src/core/extensions/builtin/prompt-preset/changes.md
@code-yeongyu
code-yeongyu merged commit 8cd19f7 into main Aug 16, 2026
15 checks passed
@code-yeongyu
code-yeongyu deleted the feat/grok-4-6-prompt-preset branch August 16, 2026 16:16
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