fix(server): Grok no longer offers Auto-accept edits - #13719
Conversation
`grok agent` launches only in ask, its auto classifier, or always-approve. `acceptEdits` exists only as a settings-file default mode, and the agent treats it as ask. T3 imitated Auto-accept edits for Grok by approving edit prompts itself. Grok's provider snapshot now lists its supported runtime modes, so the web and mobile pickers stop offering Auto-accept edits. The server enforces the same list when it resolves a turn's runtime policy: a stored mode the provider does not offer (an older thread, or a stale client) runs in Supervised. Grok launches a mode it does not offer asking. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
| import * as Schema from "effect/Schema"; | ||
|
|
||
| import * as ProjectionProjects from "../persistence/Services/ProjectionProjects.ts"; | ||
| import { ProviderInstanceRegistry } from "../provider/Services/ProviderInstanceRegistry.ts"; |
There was a problem hiding this comment.
Import this service module as a namespace at the new service boundary, then use ProviderInstanceRegistry.ProviderInstanceRegistry in the layer requirement and yield* acquisition. This preserves the module's public service shape.
Posted via Macroscope — Effect Service Conventions
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
fe565ae
into
t3code/codex-turn-mapping
Grok offered Auto-accept edits, but
grok agentcan't run it. At launch it takes only ask/default, its auto classifier, or always-approve.acceptEditsexists only as a settings-filepermissions.defaultMode, andGROK_DEFAULT_PERMISSION_MODEaccepts only auto/ask/default. Since #13616, T3 imitated the mode by launching Grok asking and approving edit prompts itself. The rule is that a provider doesn't offer a mode it can't run natively, and T3 doesn't imitate it.What changed
GrokProvider's presentation setssupportedRuntimeModes: ["approval-required", "auto", "full-access"], asPiProviderdoes. Web (ChatComposer) and mobile (thread-settings-options) already filter their pickers on this list.RuntimePolicyV2.resolve(the productionlayerFromProjectRepository) reads the thread's provider snapshot. A stored runtime mode the provider doesn't list runs in Supervised (approval-required). Without this, an older thread or a stale client would still send Auto-accept edits. Every turn start, restart, and session open resolves its policy here, so the fallback holds on all of those paths. Providers that list no modes are unchanged.grokAcpSpawnArgshas no Auto-accept edits branch anymore. Any mode Grok doesn't offer launches asking (--permission-mode default).runtimeLayer.test.ts,DelegatedCompletionDelivery.test.ts) had aProviderInstancewith an emptysnapshot. They now get agetSnapshotthat lists no modes, since the resolver reads it.Decisions (override if you disagree)
auto, and Pi already mapsautotoapproval-requiredin its launch env (piT3McpInjection.ts), so its behavior doesn't change. A per-mode ladder would only matter for a provider that offers Auto but not Auto-accept edits, and none does.AcpClientPolicykeeps its auto-accept-edits rule (approve edit/delete/move, ask for the rest). Grok no longer reaches it, but generic ACP Registry agents run Auto-accept edits through this rule. Without it they'd auto-approve commands in that mode, as they did before fix(server): V2 Grok launches in the thread's permission mode #13616. Only the Grok-specific wording in its comment changed.Verification
In
apps/server, withTMPDIRunder /home:GrokAdapterV2.test.ts > Grok launch permission mode > launches a thread stored as Auto-accept edits asking: builds Grok's real initial provider snapshot and resolves a thread stored asauto-accept-editsthrough the productionRuntimePolicyV2layer. It getsapproval-required, and opening a session through the real GrokmakeRuntimespawns--permission-mode default agent stdio.RuntimePolicy.test.ts > runs a mode the provider does not offer in Supervised: Grok's list maps auto-accept-edits to approval-required and keeps auto and full-access. A provider with no list keeps auto-accept-edits.supportedRuntimeModesand the spawn args mapping auto-accept-edits to always-approve, both tests fail.vp test runonRuntimePolicy,GrokAdapterV2,GrokAcpSupport,GrokProvider,AcpClientPolicy,runtimeLayer,DelegatedCompletionDelivery,AcpAdapterV2,AntigravityAdapterV2,AcpRegistryAdapterV2: 268 passed.OrchestratorReplayFixtures.integration.test.ts -t "grok|antigravity|acpRegistry": 21 passed. Every Grok fixture runs in Full access or with an explicit override, so none changed.vp exec tsc --noEmit -p .: noerror TSorwarning TS.vp run knip:check: clean.vp linton the touched files: clean.Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code