Skip to content

appendOsShellNote

appendOsShellNote(systemPrompt): string

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/utils/systemPromptNotes.d.ts:45

EXT-26: append an OS + shell-dialect note to the composed code-mode system prompt.

The model was never told its host OS or which shell run_shell_command uses, so on non-POSIX hosts it defaulted to POSIX idioms that fail (ran ls where cmd.exe has dir, a multi-line echo-redirect that wrote 0 bytes, a PowerShell here-string, python -c multi-line). This is ORTHOGONAL to the EXT-13/16/22 path-namespace notes: those say WHERE the model is (path form); this says WHAT shell it speaks (dialect). Backend-agnostic — the lean backend also exposes run_shell_command, so GS2-27 composes it in the shared path.

The shell is derived from the SAME rule Node’s spawn(command, { shell: true }) uses — exactly how run_shell_command spawns (GthDevToolkit spawn) — so on win32 it is cmd.exe (via %ComSpec%) and on POSIX it is /bin/sh (POSIX sh, NOT guaranteed bash). Computed from process.platform at call time so the text is correct per host. Returns the note alone when there is no base prompt. A single injection is authoritative (nothing in the base prompt contradicts shell dialect), so unlike EXT-22 no correction middleware is needed.

string | undefined

string