Skip to content

setShellExecutionConfig() drops sandbox/background shell config fields #25112

@jasonmatthewsuhari

Description

@jasonmatthewsuhari

What happened

While exercising current main, I found that updating shell UI dimensions through config.setShellExecutionConfig(...) removes existing shellExecutionConfig fields already present on the Config instance.

I reproduced this against built origin/main code in a clean worktree (5fc8fea8d762d67d3bff14d00307138faff0bca5) by instantiating Config with:

  • sandbox.enabled = true
  • sandbox.command = "windows-native"
  • sandbox.networkAccess = false
  • shellBackgroundCompletionBehavior = "notify"

Then I called config.setShellExecutionConfig(...) with only the fields the interactive UI currently sets (terminalWidth, terminalHeight, pager, showColor, sanitizationConfig, sandboxManager).

Observed output:

before {"sandboxConfig":{"enabled":true,"allowedPaths":[],"includeDirectories":["C:\\Users\\Jason\\.gemini\\tmp"],"networkAccess":false,"command":"windows-native"},"backgroundCompletionBehavior":"notify","terminalWidth":80,"terminalHeight":24}
after {"terminalWidth":123,"terminalHeight":45}

Expected

Calling setShellExecutionConfig(...) to update layout-related fields should preserve existing fields that are still part of ShellExecutionConfig, especially behavior/security-related ones such as:

  • sandboxConfig
  • backgroundCompletionBehavior

Actual

Those fields are dropped from the config object after setShellExecutionConfig(...) runs.

Why this matters

The interactive app calls config.setShellExecutionConfig(...) during normal UI operation, so this is not just an internal inconsistency. It means runtime shell behavior can drift away from the config established during startup.

Likely area

  • packages/core/src/config/config.ts
  • Config.setShellExecutionConfig()
  • packages/cli/src/ui/AppContainer.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreIssues related to User Interface, OS Support, Core Functionalitypriority/p1Important and should be addressed in the near term.

    Type

    No fields configured for Bug.

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions