From 2c6dd272769db190ecb6e8b31fc5547a52764cb8 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 27 Oct 2026 00:30:13 -0700 Subject: [PATCH] refactor: group shared native chat shell environment policy (#34301) --- config/scripts/ci-shard-timings.json | 2 +- .../loading-store/normalize-loaded-global-settings.ts | 2 +- src/main/runtime/claude-structured-session-integration.test.ts | 2 +- src/main/runtime/structured-agent-session-integration.test.ts | 2 +- src/main/runtime/structured-agent-session-runtime.ts | 2 +- src/main/runtime/structured-agent-shell-environment.ts | 2 +- src/main/runtime/workspaces/workspace-process-listing.ts | 2 +- .../components/settings/NativeChatShellEnvironmentSetting.tsx | 2 +- .../{ => native-chat}/native-chat-shell-environment.test.ts | 0 src/shared/{ => native-chat}/native-chat-shell-environment.ts | 2 +- 10 files changed, 9 insertions(+), 9 deletions(-) rename src/shared/{ => native-chat}/native-chat-shell-environment.test.ts (100%) rename src/shared/{ => native-chat}/native-chat-shell-environment.ts (95%) diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index 8d1d2c38556..f4a26b957da 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -12618,7 +12618,7 @@ "src/shared/native-chat-session-option-defaults.test.ts": 61, "src/shared/native-chat-session-option-snapshot.test.ts": 100, "src/shared/native-chat-session-option-state.test.ts": 52, - "src/shared/native-chat-shell-environment.test.ts": 30, + "src/shared/native-chat/native-chat-shell-environment.test.ts": 30, "src/shared/native-chat-slash-commands.omp.test.ts": 54, "src/shared/native-chat-slash-commands.test.ts": 52, "src/shared/native-chat-stopped-send-turn.test.ts": 278, diff --git a/src/main/persistence/loading-store/normalize-loaded-global-settings.ts b/src/main/persistence/loading-store/normalize-loaded-global-settings.ts index aa3a5ce27ff..cf1012a5f06 100644 --- a/src/main/persistence/loading-store/normalize-loaded-global-settings.ts +++ b/src/main/persistence/loading-store/normalize-loaded-global-settings.ts @@ -8,7 +8,7 @@ import { normalizeAppIconId } from '../../../shared/app-icon' import { normalizeTerminalCustomThemes } from '../../../shared/terminal-custom-themes' import { normalizeTerminalDefaultShell } from '../../../shared/terminal-default-shell' import { projectSourceControlAiToLegacyCommitMessageAi } from '../../../shared/source-control-ai' -import { normalizeNativeChatShellEnvironmentVariables } from '../../../shared/native-chat-shell-environment' +import { normalizeNativeChatShellEnvironmentVariables } from '../../../shared/native-chat/native-chat-shell-environment' import { publishedLegacyChatPermissionMode } from '../../../shared/agent-chat-permission-mode' import { savedChatUiWithTerminalDefaultView, diff --git a/src/main/runtime/claude-structured-session-integration.test.ts b/src/main/runtime/claude-structured-session-integration.test.ts index 4ec66bc3d30..1a6969dcd95 100644 --- a/src/main/runtime/claude-structured-session-integration.test.ts +++ b/src/main/runtime/claude-structured-session-integration.test.ts @@ -21,7 +21,7 @@ import type { OrcaRuntimeService } from './orca-runtime' import type { RpcRequest, RpcResponse } from './rpc/core' import type { ClaudeStructuredAuthPolicy } from '../claude-accounts/claude-structured-auth-policy' import { RpcDispatcher } from './rpc/dispatcher' -import type { NativeChatShellEnvironmentPolicy } from '../../shared/native-chat-shell-environment' +import type { NativeChatShellEnvironmentPolicy } from '../../shared/native-chat/native-chat-shell-environment' import { STRUCTURED_AGENT_SESSION_METHODS } from './rpc/methods/structured-agent-session' import { ensureStructuredAgentSessionHost, diff --git a/src/main/runtime/structured-agent-session-integration.test.ts b/src/main/runtime/structured-agent-session-integration.test.ts index d30a357d657..a94af301b8e 100644 --- a/src/main/runtime/structured-agent-session-integration.test.ts +++ b/src/main/runtime/structured-agent-session-integration.test.ts @@ -31,7 +31,7 @@ import type { OrcaRuntimeService } from './orca-runtime' import { readPersistedTestAgentSessionStoreText } from './agent-session-record-store-test-harness' import type { RpcRequest, RpcResponse } from './rpc/core' import { RpcDispatcher } from './rpc/dispatcher' -import type { NativeChatShellEnvironmentPolicy } from '../../shared/native-chat-shell-environment' +import type { NativeChatShellEnvironmentPolicy } from '../../shared/native-chat/native-chat-shell-environment' import { STRUCTURED_AGENT_SESSION_METHODS } from './rpc/methods/structured-agent-session' import { ensureStructuredAgentSessionHost, diff --git a/src/main/runtime/structured-agent-session-runtime.ts b/src/main/runtime/structured-agent-session-runtime.ts index 57b4a548be8..62318961870 100644 --- a/src/main/runtime/structured-agent-session-runtime.ts +++ b/src/main/runtime/structured-agent-session-runtime.ts @@ -33,7 +33,7 @@ import { createStructuredAgentSessionOwnerProbe, createStructuredAgentSessionOwnerProbes } from './structured-agent-session-owner-probe' -import type { NativeChatShellEnvironmentPolicy } from '../../shared/native-chat-shell-environment' +import type { NativeChatShellEnvironmentPolicy } from '../../shared/native-chat/native-chat-shell-environment' import { createStructuredAgentEnvironmentResolvers } from './structured-agent-shell-environment' import type { ClaudeStructuredAuthPolicy } from '../claude-accounts/claude-structured-auth-policy' import type { StructuredAgentAdapterContext } from './structured-agent-runtime-registration-types' diff --git a/src/main/runtime/structured-agent-shell-environment.ts b/src/main/runtime/structured-agent-shell-environment.ts index 18d009c7ead..0cdbcbd4ea0 100644 --- a/src/main/runtime/structured-agent-shell-environment.ts +++ b/src/main/runtime/structured-agent-shell-environment.ts @@ -8,7 +8,7 @@ import type { GlobalSettings } from '../../shared/global-settings-types' import { nativeChatShellEnvironmentPolicy, type NativeChatShellEnvironmentPolicy -} from '../../shared/native-chat-shell-environment' +} from '../../shared/native-chat/native-chat-shell-environment' // Even with shell inheritance off, preserve CLI lookup, locale and agent socket. const BASELINE_SHELL_VARIABLES = ['PATH', 'LANG', 'LC_ALL', 'LC_CTYPE', 'SSH_AUTH_SOCK'] diff --git a/src/main/runtime/workspaces/workspace-process-listing.ts b/src/main/runtime/workspaces/workspace-process-listing.ts index b7b009a876d..37f23fa4660 100644 --- a/src/main/runtime/workspaces/workspace-process-listing.ts +++ b/src/main/runtime/workspaces/workspace-process-listing.ts @@ -48,7 +48,7 @@ import { import { resolveTuiAgentLaunchEnv } from '../../../shared/tui-agent-launch-defaults' import { preModeChatGetsFullAccess } from '../../../shared/agent-chat-permission-mode' import { isTuiAgent } from '../../../shared/tui-agent-config' -import { nativeChatShellEnvironmentPolicy } from '../../../shared/native-chat-shell-environment' +import { nativeChatShellEnvironmentPolicy } from '../../../shared/native-chat/native-chat-shell-environment' import { claudeStructuredAuthPolicyForSettings } from '../../claude-accounts/claude-structured-auth-policy' import { resolveStructuredAgentCommand } from '../../native-chat/structured-agent-command-resolution' import { structuredAgentConfiguredArgs } from '../../native-chat/structured-agent-configured-args' diff --git a/src/renderer/src/components/settings/NativeChatShellEnvironmentSetting.tsx b/src/renderer/src/components/settings/NativeChatShellEnvironmentSetting.tsx index 7c1d7f182d8..1bdb3fd2be1 100644 --- a/src/renderer/src/components/settings/NativeChatShellEnvironmentSetting.tsx +++ b/src/renderer/src/components/settings/NativeChatShellEnvironmentSetting.tsx @@ -1,7 +1,7 @@ import { useRef, useState } from 'react' import { Plus, X } from 'lucide-react' import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { isNativeChatShellEnvironmentName } from '../../../../shared/native-chat-shell-environment' +import { isNativeChatShellEnvironmentName } from '../../../../shared/native-chat/native-chat-shell-environment' import { translate } from '@/i18n/i18n' import { Button } from '../ui/button' import { Input } from '../ui/input' diff --git a/src/shared/native-chat-shell-environment.test.ts b/src/shared/native-chat/native-chat-shell-environment.test.ts similarity index 100% rename from src/shared/native-chat-shell-environment.test.ts rename to src/shared/native-chat/native-chat-shell-environment.test.ts diff --git a/src/shared/native-chat-shell-environment.ts b/src/shared/native-chat/native-chat-shell-environment.ts similarity index 95% rename from src/shared/native-chat-shell-environment.ts rename to src/shared/native-chat/native-chat-shell-environment.ts index f49c5a49606..438c9ab2c53 100644 --- a/src/shared/native-chat-shell-environment.ts +++ b/src/shared/native-chat/native-chat-shell-environment.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from './global-settings-types' +import type { GlobalSettings } from '../global-settings-types' /** Which login-shell variables a structured native chat child inherits. */ export type NativeChatShellEnvironmentPolicy = {