Skip to content

resolveSystemPromptNoteGates

resolveSystemPromptNoteGates(config, command): object

Defined in: packages/core/src/config/shell-policy.ts:1784

EXT-195 — which of the three path/shell/commit notes the resolved toolset earns.

The three do not share one predicate. The cwd note is about the path namespace, and its own text says both the filesystem tools and run_shell_command operate on those same real paths, so it is earned by the shell OR by any filesystem capability other than 'none'. The OS/shell note and the commit note describe run_shell_command (git commit rides on that tool), so both are earned only when that tool is registered.

Shell enablement is the SAME pair resolveShellApprovalGate uses (getEffectiveDevToolsConfig + isShellToolEnabled), so the prompt stays in lockstep with where the shell tool is actually emitted. filesystem is read off the config the caller already merged — the agent passes this.config, the command-merged effective config the tool resolver sees. One function, so a second backend cannot inherit half of the rule.

Pick<GthConfig, "commands" | "builtInTools" | "filesystem" | "askWriteMode"> | undefined

GthCommand | undefined

object

commit: boolean

cwd: boolean

osShell: boolean