Repository navigation
rm git shim - #14141
rm git shim#14141
Conversation
Drops the terminal git/gh PATH wrapper and its settings toggle. Renames the no-marker shell-ready launch config after what it does. Co-authored-by: Orca <[email protected]>
Deletes the orphaned wrapper dir and scrubs inherited env/PATH, so a daemon that outlives the upgrade cannot keep seeding it. Drops a now-unread spawn option. Co-authored-by: Orca <[email protected]>
Scrub after the PATH prepends (they re-read process.env on the sparse daemon env) and run the cleanup above the serve branch so remote hosts get it too. Retry a locked removal; match PATH case-insensitively. Co-authored-by: Orca <[email protected]>
Refuse to re-prepend a legacy entry during agent-teams PATH promotion, which runs after the scrub. Cover the removal guard. Co-authored-by: Orca <[email protected]>
📝 WalkthroughWalkthroughThe change removes terminal GitHub attribution from settings, runtime contracts, PTY environment assembly, shell wrappers, shared prompts, tests, and localization data. It replaces attribution-specific shell launch configuration with markerless configuration. It adds startup and PTY cleanup for legacy terminal shim directories, environment variables, and PATH entries. It also updates Agent Teams environment handling and preserves unrelated PATH entries. Mergeability Score: 🔵 Low · up to The change removes terminal attribution and its setting, but some localized UI text still mentions the removed feature and Windows cleanup may miss case-variant legacy environment keys, allowing stale behavior for some installs. These are bounded follow-ups, so the PR is mergeable with explicit owner awareness. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d9aa9712-37d8-4327-a6aa-d0b10689f519
📒 Files selected for processing (55)
config/max-lines-baseline.txtconfig/scripts/locale-ko-key-overrides.jsonconfig/scripts/locale-ko-value-overrides.mjsconfig/scripts/locale-search-keyword-overrides.mjsconfig/scripts/locale-translation-policy.es-pr.test.mjsconfig/scripts/locale-translation-policy.zh-round5.test.mjsconfig/scripts/locale-zh-phrase-fixes-round5.mjsconfig/scripts/locale-zh-value-overrides.mjssrc/main/attribution/terminal-attribution-path-env-casing.test.tssrc/main/attribution/terminal-attribution-win32-dash-argument.test.tssrc/main/attribution/terminal-attribution.test.tssrc/main/attribution/terminal-attribution.tssrc/main/codex-accounts/runtime-home-service.test.tssrc/main/codex-accounts/service.test.tssrc/main/daemon/pty-subprocess.test.tssrc/main/daemon/pty-subprocess.tssrc/main/daemon/shell-ready.test.tssrc/main/daemon/shell-ready.tssrc/main/index.tssrc/main/ipc/pty.test.tssrc/main/ipc/pty.tssrc/main/providers/local-pty-provider.test.tssrc/main/providers/local-pty-provider.tssrc/main/providers/local-pty-shell-ready.test.tssrc/main/providers/local-pty-shell-ready.tssrc/main/providers/ssh-pty-provider.test.tssrc/main/pty/legacy-terminal-shim-dir.test.tssrc/main/pty/legacy-terminal-shim-dir.tssrc/main/runtime/claude-agent-teams-shim-env.test.tssrc/main/runtime/claude-agent-teams-shim-env.tssrc/main/runtime/claude-agent-teams-tmux-dispatcher.tssrc/main/runtime/orca-runtime-git.test.tssrc/main/runtime/orca-runtime-git.tssrc/main/runtime/rpc/methods/git-params.tssrc/main/runtime/rpc/methods/git.test.tssrc/main/runtime/rpc/methods/git.tssrc/main/text-generation/commit-message-text-generation.test.tssrc/relay/pty-handler.test.tssrc/renderer/src/components/settings/GitPane.tsxsrc/renderer/src/components/settings/Settings.tsxsrc/renderer/src/components/settings/git-search.tssrc/renderer/src/hooks/useSettingsNavigationMetadata.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/runtime/runtime-git-client.test.tssrc/renderer/src/runtime/runtime-git-client.tssrc/shared/commit-message-prompt.tssrc/shared/constants.tssrc/shared/external-worktree-inbox.test.tssrc/shared/orca-attribution.tssrc/shared/types.tssrc/shared/worktree-ownership.test.ts
💤 Files with no reviewable changes (20)
- src/main/runtime/rpc/methods/git.test.ts
- config/scripts/locale-zh-phrase-fixes-round5.mjs
- config/scripts/locale-search-keyword-overrides.mjs
- config/max-lines-baseline.txt
- src/main/codex-accounts/service.test.ts
- src/main/attribution/terminal-attribution.test.ts
- src/main/attribution/terminal-attribution.ts
- src/main/attribution/terminal-attribution-path-env-casing.test.ts
- src/shared/constants.ts
- src/shared/worktree-ownership.test.ts
- src/main/codex-accounts/runtime-home-service.test.ts
- src/main/runtime/rpc/methods/git-params.ts
- src/shared/external-worktree-inbox.test.ts
- src/shared/types.ts
- src/shared/orca-attribution.ts
- src/main/text-generation/commit-message-text-generation.test.ts
- config/scripts/locale-ko-key-overrides.json
- src/renderer/src/components/settings/GitPane.tsx
- src/main/runtime/rpc/methods/git.ts
- src/main/attribution/terminal-attribution-win32-dash-argument.test.ts
| export function stripLegacyTerminalShimEnv( | ||
| env: Record<string, string>, | ||
| platform: NodeJS.Platform = process.platform | ||
| ): void { | ||
| for (const key of LEGACY_SHIM_ENV_KEYS) { | ||
| delete env[key] | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
Does Node.js child_process spawn treat Windows environment variable names case-insensitively when an env object contains a mixed-case key such as orca_attribution_shim_dir?
💡 Result:
Yes, Node.js child_process spawn treats environment variable names case-insensitively on Windows [1][2]. When you provide an env object to spawn on Windows, Node.js performs a sanitization step to handle the fact that Windows environment variables are case-insensitive [3][4]. Specifically, it lexicographically sorts the keys in the provided env object and keeps only the first entry that matches a given name when compared case-insensitively [1][5]. If your env object contains multiple variants of the same key (e.g., ORCA_ATTRIBUTION_SHIM_DIR and orca_attribution_shim_dir), only the one that appears first lexicographically will be passed to the spawned subprocess [1][3]. This behavior is designed to prevent issues caused by duplicate environment variable keys with different casings, which can confuse some applications on Windows [3][4].
Citations:
- 1: https://nodejs.org/api/child_process.html
- 2: https://nodejs.org/download/release/latest-v24.x/docs/api/child_process.html
- 3: win, child_process: sanitize env variables nodejs/node#35210
- 4: nodejs/node@abd8cdfc4e
- 5: https://nodejs.org/download/release/v25.5.0/docs/api/child_process.html
🏁 Script executed:
#!/bin/bash
set -e
file=$(fd -t f 'legacy-terminal-shim-dir\.ts$' . | head -n 1)
printf '%s\n' "$file"
ast-grep outline "$file"
printf '\n--- implementation ---\n'
cat -n "$file"
printf '\n--- references ---\n'
rg -n -C 3 'stripLegacyTerminalShimEnv|LEGACY_SHIM_ENV_KEYS' .
printf '\n--- related tests ---\n'
fd -t f -i 'legacy.*shim|terminal.*shim' . | sortRepository: stablyai/orca
Length of output: 9469
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- path-key resolver ---'
resolver=$(fd -t f 'windows-environment-path\.ts$' . | head -n 1)
printf '%s\n' "$resolver"
cat -n "$resolver"
printf '%s\n' '--- existing tests ---'
test_file=$(fd -t f 'legacy-terminal-shim-dir\.test\.ts$' . | head -n 1)
cat -n "$test_file"
printf '%s\n' '--- environment construction around the call site ---'
cat -n src/main/ipc/pty.ts | sed -n '1840,1910p'Repository: stablyai/orca
Length of output: 21933
Delete legacy environment keys case-insensitively on Windows.
When platform === 'win32', remove every env key matching LEGACY_SHIM_ENV_KEYS without regard to case. Windows environment names are case-insensitive, so stale shim configuration can survive when only the uppercase spelling is deleted.
Add a test for a case-variant key.
| "5235c215ca": "「タスク」ページとサイドバーに表示するタスクプロバイダーを選択します。", | ||
| "85f4fd7710": "タスクソース", | ||
| "ab4b21b58e": "ブランチの名前、基本参照、帰属、および Git AI 作成者。", | ||
| "ab4b21b58e": "ブランチの名前、基本参照、および Git AI 作成者。", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Remove obsolete attribution text from localized Git descriptions. The attribution setting is removed, but the updated Japanese and Chinese descriptions still mention it. Remove that phrase from both entries so the settings and search UI describe only the remaining branch-naming and base-reference options.
📍 Affects 2 files
src/renderer/src/i18n/locales/ja.json#L789-L789(this comment)src/renderer/src/i18n/locales/zh.json#L789-L789
Upstream removed the terminal git/gh attribution shim (rm git shim stablyai#14141, stablyai#14255) and actively scrubs it on every spawn. Restoring terminal-attribution.ts and orca-attribution.ts as standalone source for reference/later rework, without rewiring the ~119 other files upstream touched to remove it (settings toggle, PTY spawn, RPC methods, locales, protocol version) — full revival would fight upstream's active cleanup logic.
* rm git shim Drops the terminal git/gh PATH wrapper and its settings toggle. Renames the no-marker shell-ready launch config after what it does. Co-authored-by: Orca <[email protected]> * rm git shim: clear stale state from older installs Deletes the orphaned wrapper dir and scrubs inherited env/PATH, so a daemon that outlives the upgrade cannot keep seeding it. Drops a now-unread spawn option. Co-authored-by: Orca <[email protected]> * rm git shim: cover the daemon and headless paths Scrub after the PATH prepends (they re-read process.env on the sparse daemon env) and run the cleanup above the serve branch so remote hosts get it too. Retry a locked removal; match PATH case-insensitively. Co-authored-by: Orca <[email protected]> * rm git shim: keep the scrub final Refuse to re-prepend a legacy entry during agent-teams PATH promotion, which runs after the scrub. Cover the removal guard. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
Removes the terminal git/gh PATH shim wholesale.
The shim installed generated
gitandghwrapper scripts into a PATH-prepended directory for Orca-managed PTYs, appending a commit trailer and a PR/issue body footer. This drops the feature, itsenableGitHubAttributionsetting, and the plumbing that carried it.What's gone
src/main/attribution/(the generated POSIX + PowerShell wrappers) andsrc/shared/orca-attribution.tsbuildPtyHostEnvand the shim-dir PATH restore in the bash/zsh shell-ready rc files (both the daemon and local-provider copies)GlobalSettingsfield, default, Git pane toggle, settings-search entries, and the renderer → RPC → runtime param chain. Removing the optional field from the zod schema is wire-safe — the schema is non-strict, so an older client still sending it is ignored rather than rejected.Cleanup for existing installs
Installs that had the toggle on still have wrapper scripts on disk and the env that activates them. That mattered more than it first looked: a healthy daemon is deliberately kept alive across an upgrade when it has live sessions, and it uses its own
process.envas the authoritative base for new PTYs. Without cleanup those panes would keep applying the trailer with no setting left to turn it off.So
src/main/pty/legacy-terminal-shim-dir.tsdeletes the orphaned directory once at startup (above the serve branch, so remote/SSH hosts get it too) and scrubs the stale env and PATH entries per spawn — after the PATH prepends, since those re-readprocess.envwhen the daemon hands over a sparse env.Also
getAttributionShellLaunchConfig→getMarkerlessShellLaunchConfig; it's still used by OpenCode, Codex, and agent-teams, but its only remaining meaning was "wrapped shell without a ready marker"BuildPtyHostEnvOptions.shellPathTesting
typecheckandlintclean. Full suite: 50,858 passing. Remaining failures are pre-existing and reproduce identically onorigin/main—agent-exec-handler(2), the cross-version-wire harness (needs local checkouts), and two load-flaky timeouts.Generated shell wrappers were verified by extracting all 9 variants and running
bash -n/zsh -n, checking for orphan calls and dangling guards. The new daemon-path regression test was mutation-tested: it fails on the previous placement and passes on the fix.