mirror of
https://github.com/Ryder-Sun/Meldwork.git
synced 2026-11-07 06:56:03 -10:00
Preserve Gemini native workspace trust settings
Forward explicit trusted or restricted workspace settings to Gemini so its native configuration is interpreted consistently. Checks: 146 environment and readiness tests; desktop packaging; git diff --check.
This commit is contained in:
1 parent
589b9d6142
commit
7cdc88c4d1
2 files changed
+14
-1
No files matched your search
@@ -105,7 +105,7 @@ const RUNTIME_ENV_KEYS = Object.freeze({
|
||||
'GEMINI_API_KEY', 'GOOGLE_API_KEY', 'GEMINI_MODEL', 'GEMINI_CLI_HOME',
|
||||
'GEMINI_DEFAULT_AUTH_TYPE', 'GEMINI_CLI_AUTH_OVERRIDE', 'GEMINI_CLI_USE_COMPUTE_ADC',
|
||||
'GEMINI_CLI_SYSTEM_SETTINGS_PATH', 'GEMINI_CLI_SYSTEM_DEFAULTS_PATH',
|
||||
'GEMINI_CLI_TRUSTED_FOLDERS_PATH',
|
||||
'GEMINI_CLI_TRUSTED_FOLDERS_PATH', 'GEMINI_CLI_TRUST_WORKSPACE', 'GEMINI_RESTRICTED_MODE',
|
||||
'GOOGLE_GEMINI_BASE_URL', 'GOOGLE_VERTEX_BASE_URL', 'GOOGLE_GENAI_API_VERSION',
|
||||
'GOOGLE_GENAI_USE_VERTEXAI', 'GOOGLE_GENAI_USE_GCA', 'GOOGLE_CLOUD_ACCESS_TOKEN',
|
||||
'GOOGLE_CLOUD_PROJECT_ID', 'GOOGLE_CLOUD_UNIVERSE_DOMAIN', ...GOOGLE_CLOUD_ENV_KEYS,
|
||||
|
||||
@@ -15,6 +15,19 @@ test('declared native credentials work for a future agent without passing unsafe
|
||||
assert.equal(redactChildSecrets('token=synthetic-future-secret', child), 'token=[redacted]')
|
||||
})
|
||||
|
||||
test('Gemini native workspace trust settings reach only its child process', () => {
|
||||
for (const env of [{ GEMINI_CLI_TRUST_WORKSPACE: 'true' },
|
||||
{ GEMINI_CLI_TRUST_WORKSPACE: 'false', GEMINI_RESTRICTED_MODE: 'true' }]) {
|
||||
const native = nativeCredentialEnvironment('gemini', env)
|
||||
const gemini = childEnvironment({ kind: 'gemini' }, '/workspace', { env: native }, 'darwin')
|
||||
assert.equal(gemini.GEMINI_CLI_TRUST_WORKSPACE, env.GEMINI_CLI_TRUST_WORKSPACE)
|
||||
assert.equal(gemini.GEMINI_RESTRICTED_MODE, env.GEMINI_RESTRICTED_MODE)
|
||||
const other = childEnvironment({ kind: 'codex' }, '/workspace', { env }, 'darwin')
|
||||
assert.equal(other.GEMINI_CLI_TRUST_WORKSPACE, undefined)
|
||||
assert.equal(other.GEMINI_RESTRICTED_MODE, undefined)
|
||||
}
|
||||
})
|
||||
|
||||
test('short native credentials are redacted without hiding unrelated configuration', () => {
|
||||
const env = { OPENAI_API_KEY: 'abc', AWS_SECRET_ACCESS_KEY: 'xy', AWS_SESSION_TOKEN: 'def', AWS_BEARER_TOKEN_BEDROCK: 'zz',
|
||||
AZURE_CLIENT_SECRET: 'gh', OPENAI_MODEL: 'model-name' }
|
||||
|
||||
Reference in new issue
Block a user