Repository navigation
Start AI commit messages from the same shell environment chats use - #26808
Conversation
A Dock-launched Orca only takes PATH from the user's shell, so variables exported in the shell rc (proxy base URL, auth token) never reached the commit-message agent even though chats and terminals saw them. Local host generation now starts from the same cached login-shell base env as chats, with account overrides applied on top; WSL and SSH paths are unchanged.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe changes add a shared resolver for host agent base environments and use it in structured-agent launch checks and commit-message services. For non-WSL targets, commit-message preparation applies the resolved environment to shell-config and agent-specific settings. WSL targets skip host environment resolution. Tests cover environment overrides, resolution failures, and local versus SSH generation. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No merge-blocking issue is established; the change is ready for normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 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: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a47d3b1b-b343-4da3-bee8-9f3a2bbaba2a
📒 Files selected for processing (7)
src/main/ipc/filesystem-commit-message-generation.test.tssrc/main/runtime/structured-agent-launch-support.tssrc/main/runtime/structured-agent-shell-environment.tssrc/main/startup/main-process-runtime-service.tssrc/main/startup/main-window-core-services.tssrc/main/text-generation/commit-message-agent-environment.test.tssrc/main/text-generation/commit-message-agent-environment.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
…shell-env # Conflicts: # src/main/startup/main-process-runtime-service.ts
…or commit messages
…26808) * Start AI commit messages from the login-shell environment chats use A Dock-launched Orca only takes PATH from the user's shell, so variables exported in the shell rc (proxy base URL, auth token) never reached the commit-message agent even though chats and terminals saw them. Local host generation now starts from the same cached login-shell base env as chats, with account overrides applied on top; WSL and SSH paths are unchanged. * Prefer the login shell's config directory over Orca's inherited one for commit messages (cherry picked from commit 65b2fcf)
ELI5
When Orca is opened from the Dock, the AI commit message didn't see anything you set in your shell startup file (like a Claude proxy address and key), so it failed with "Not logged in" while chats and terminals in the same Orca worked. It now starts from the same shell environment chats already use.
What Changed
.zshrcand the like was missing.nativeChatShellEnvironmentPolicy), with Orca's own overrides on top in the same order as chats: managed Codex home, Claude account patch, and the OpenCode/Pi/OMP/Grok config folders. No extra shell is started; the result is the chats' cached one. If the shell environment can't be read, it falls back to Orca's own environment, which was the old behaviour.resolveHostAgentBaseEnvironmentinstructured-agent-shell-environment.ts, and both chats and text generation call it.Why
Chats and the commit message should see the same environment. Reusing the chats' cached shell environment fixes it with no new shell spawn and no new setting. The alternative was a separate shell lookup just for text generation, which would duplicate what chats already do and could drift from it.
Linked Issue
Follow-up found while re-landing Claude per-account folders (STA-3698, #26769 and #26801). The bug is already on main.
Visual Proof
N/A: no UI change. Reproduced in a sandboxed build: with a proxy and key set only in the sandbox's
.zshrcand Orca launched with a clean environment, terminal and chat reached the proxy, but the commit message said "Not logged in" on both main and the re-land branch.Testing
New unit tests:
CODEX_HOMEwins over the shell's.An IPC test checks that local generation gets a login-shell-only variable.
pnpm tc, the targeted suites (225 tests) andcheck:code-quality:changedpass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
An independent agent review found no must-fix issues. Worth knowing:
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)