Skip to content

Default Windows bash sandbox to off / Windows Bash 沙箱默认关闭#6106

Merged
SivanCola merged 4 commits into
esengine:main-v2from
SivanCola:fix/windows-bash-sandbox-default-off
Jul 6, 2026
Merged

Default Windows bash sandbox to off / Windows Bash 沙箱默认关闭#6106
SivanCola merged 4 commits into
esengine:main-v2from
SivanCola:fix/windows-bash-sandbox-default-off

Conversation

@SivanCola

@SivanCola SivanCola commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Default empty Bash sandbox mode to off on Windows while keeping macOS/Linux defaults enforced.
  • Add a one-time Windows v3-to-v4 startup migration that rewrites old template bash = "enforce" to off, then preserves any later manual enforce choice.
  • Surface the effective Bash sandbox mode in desktop settings and update config-version/rendering tests.
  • Run the same one-time upgrade from CLI startup (migrateLegacyConfigForCLI), so Windows CLI-only users get the enforce-to-off migration without ever launching the desktop app. The upgrade is config_version-gated, so desktop and CLI never double-apply it; metadata commands (version/help) still leave the config untouched. Note: this also extends the pre-v3 DeepSeek official-pricing reset to CLI startup (previously desktop-only).
  • Review cleanups: drop the dead BashMode comparison in the project delta render, drop the unused bool return of the migration helper, and add a setRuntimeGOOS test helper whose t.Setenv guard panics under t.Parallel, keeping the package-global GOOS override race-free.

Known tradeoff

The old config template always wrote bash = "enforce" explicitly, so the migration cannot distinguish the template default from a deliberate pre-v4 enforce choice on Windows; both are rewritten to off once. Any enforce set after the migration is preserved.

Validation

  • go test ./internal/config ./internal/cli
  • cd desktop && go test ./...
  • go vet ./internal/config ./internal/cli and GOOS=windows go build ./... (root and desktop modules)

Cache-impact: low - config default/version and desktop/CLI startup migration only; no provider-visible prompt text, tool schema, or tool ordering changes.
Cache-guard: scripts/check-cache-impact.sh plus focused config/CLI/desktop tests listed above.
System-prompt-review: reviewed internal/config/config.go changes; DefaultSystemPrompt and LanguagePolicy text are unchanged.

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) tui Terminal UI / CLI (internal/cli, internal/control) config Configuration & setup (internal/config) labels Jul 6, 2026
SivanCola added 3 commits July 6, 2026 21:31
Drop the dead BashMode comparison in the project delta condition (an
empty raw value always resolves to the platform default on both sides)
and replace per-test runtimeGOOS save/restore boilerplate with a
setRuntimeGOOS helper whose t.Setenv call panics under t.Parallel,
keeping the package-global override race-free.
Run ApplyUserConfigUpgradesOnStartup from migrateLegacyConfigForCLI so
Windows CLI-only users also get the one-time bash = "enforce" to off
migration instead of waiting for a desktop launch. The upgrade is
config_version-gated, so desktop and CLI never double-apply it, and
metadata commands (version/help) still leave the config untouched.
Also drop the unused bool return of the migration helper.
@SivanCola SivanCola marked this pull request as ready for review July 6, 2026 13:59
@SivanCola SivanCola requested a review from esengine as a code owner July 6, 2026 13:59
@SivanCola SivanCola merged commit 221a764 into esengine:main-v2 Jul 6, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant