Files
orca/src/main/runtime/runtime-client-settings-shape.ts
T
Neil d3341196b8 feat(codex): history follows you into ~/.codex on system default, with a per-host opt-out (#24511) (#34981)
* fix(codex): link managed-account history into the user's own ~/.codex on system default

When system default launches Codex on the real ~/.codex, bridge every trusted
managed host account home into it so sessions started on a managed account
stay resumable after switching back (#25000).

Split from #33578 (host half). Needs an owner product decision (#10770 vs #24511).

* feat(codex): a per-host opt-out for sharing Codex history across accounts (#24511)

Adds codexShareHistoryAcrossAccounts (absent = on, today's #10770 behaviour).
Off, the host that launches Codex starts none of its history bridges: system
default into the shared runtime home, accounts and ~/.codex into a per-account
home, managed accounts into the real ~/.codex, and the WSL distro and sibling
accounts into a WSL account home. Turning it off removes nothing already linked.

The setting lives in each host's own store, since that host writes the links.
Settings → Agents shows it for the selected host: local writes update this app,
a paired SSH or WSL host is read and written over settings.get/settings.update.
New hosts always publish the key; a host that doesn't is shown as needing an
update and is never sent it, because older hosts' strict update schema would
reject the call. Strings are localized for all 11 locales.

The system-default lane moves into the launch class, keeping managed-home under
the line cap.

* fix(codex): ~/.codex gets hardlinks or nothing, and a WSL history source is left to the WSL lane

The system-default lane wrote into codexSessionSourceHome when set, which can be
a \\wsl.localhost path: the background scan would boot a stopped distro over 9P
and its cross-volume symlinks are ignored by codex resume. That lane now returns
early for a WSL UNC target; the WSL lane owns those homes.

Into the user's own ~/.codex the bridge now links with hardlinks only: a failed
hardlink (EXDEV across volumes) skips the rollout, counted as skippedFiles,
removes any folder it just created, and never falls back to a symlink that
codex resume ignores and that would dangle once an account is removed. Bridges
between Orca-managed homes keep the symlink fallback.

Also: the setting's JSDoc sits above its own field, and Settings search finds
the switch (codex, history, share, shared, account; existing localized keys).
2026-10-28 21:26:42 -07:00

84 lines
2.6 KiB
TypeScript

// What a paired client reads and may write of this host's settings.
import type { GlobalSettings } from '../../shared/global-settings-types'
import type { ExecutionHostId } from '../../shared/execution-host'
import type { SourceControlAiActionDefaults } from '../../shared/source-control-ai-actions'
export type RuntimeClientSettings = Pick<
GlobalSettings,
| 'defaultTuiAgent'
| 'newWorkspaceSetupOnly'
| 'disabledTuiAgents'
| 'agentCmdOverrides'
| 'agentDefaultArgs'
| 'agentDefaultEnv'
| 'agentStatusHooksEnabled'
| 'codexShareHistoryAcrossAccounts'
| 'claudeSubagentNavigationEnabled'
| 'terminalCopyTrimsGutter'
| 'defaultTaskSource'
| 'defaultTaskViewPreset'
| 'visibleTaskProviders'
| 'defaultRepoSelection'
| 'defaultLinearTeamSelection'
| 'githubProjects'
| 'experimentalNewWorktreeCardStyle'
| 'experimentalNativeChat'
| 'compactWorktreeCards'
| 'minimaxGroupId'
| 'minimaxUsageModels'
| 'minimaxEndpoint'
| 'zcodePlanSite'
| 'prBotAuthorOverrides'
| 'artifactSharingEnabled'
| 'worktreeVisibilityDefaults'
| 'agentSkillSharingEnabled'
| 'machineName'
| 'nativeChatPermissionMode'
| 'nativeChatQueueFollowUps'
| 'sourceControlGroupOrder'
| 'sourceControlCompareAgainstUpstream'
| 'diffShowWhitespace'
> & {
/** Older clients still read these; neither is persisted or accepted as an update. */
openAgentTabsInChatByDefault?: boolean
experimentalStructuredNativeChat?: boolean
hostSettingOverrides: RuntimeHostDisplayLabelOverrides
sourceControlAi: RuntimeClientSourceControlAi
}
/** The saved per-action launch recipes (agent, prompt template, agent args), already migrated. */
export type RuntimeClientSourceControlAi = { actions: SourceControlAiActionDefaults }
/** Safe paired projection: host labels only; filesystem defaults stay host-private. */
export type RuntimeHostDisplayLabelOverrides = Partial<
Record<ExecutionHostId, { displayLabel: string }>
>
export type RuntimeClientSettingsUpdate = Pick<
Partial<GlobalSettings>,
| 'agentStatusHooksEnabled'
| 'claudeSubagentNavigationEnabled'
| 'experimentalConnectors'
| 'defaultTuiAgent'
| 'disabledTuiAgents'
| 'agentDefaultArgs'
| 'agentDefaultEnv'
| 'defaultTaskSource'
| 'defaultTaskViewPreset'
| 'visibleTaskProviders'
| 'defaultRepoSelection'
| 'defaultLinearTeamSelection'
| 'githubProjects'
| 'experimentalNewWorktreeCardStyle'
| 'compactWorktreeCards'
| 'minimaxGroupId'
| 'minimaxUsageModels'
| 'minimaxEndpoint'
| 'zcodePlanSite'
| 'prBotAuthorOverrides'
| 'worktreeVisibilityDefaults'
| 'machineName'
| 'nativeChatPermissionMode'
>