Fix SSH OpenCode commit message generation#5197
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR adds optional shell-wrapped execution support to remote command invocation. The SSH Git provider can now request shell execution by passing 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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: Pro
Run ID: c55ce06e-e56e-44a6-8a61-afd19944fb19
📒 Files selected for processing (4)
src/main/providers/ssh-git-provider.test.tssrc/main/providers/ssh-git-provider.tssrc/relay/agent-exec-handler.test.tssrc/relay/agent-exec-handler.ts
cc13535 to
d5d50c9
Compare
Excited to hopefully make my first contribution!
Video
opencode-ssh-fix.mov
Summary
Closes #4720.
Screenshots
No visual change.
Testing
pnpm exec vitest run --config config/vitest.config.ts src/relay/agent-exec-handler.test.ts src/main/providers/ssh-git-provider.test.tspnpm run build:relayopencode, while$SHELL -ilc "command -v opencode"did; verified OpenCode Source Control generation filled the commit message instead of showing the remote PATH error.pnpm run typecheck- currently fails on currentorigin/maininsrc/renderer/src/components/sidebar/folder-workspace-composer-submit.ts, which is outside this PR's diff.pnpm run lint- currently fails on currentorigin/mainmax-lines findings in existing renderer files outside this PR's diff.pnpm test- focused SSH tests pass, but the full suite currently has unrelated failures in sidebar and PTY tests outside this PR's diff.pnpm build- not run; this change only touches relay/provider behavior, andpnpm run build:relaywas run for the changed relay path.AI Review Report
Reviewed the code paths for SSH commit-message and PR-field generation, relay subprocess spawning, cancellation lanes, argument passing, and regression coverage. The main risk checked was introducing shell injection while switching to shell-based launch. The implementation uses
exec "$@"with the binary and args passed as positional shell parameters instead of string-concatenating user input.Cross-platform compatibility was checked explicitly:
-ilcto inherit login/interactive PATH setup for SSH relay commands..cmd/.bathandling throughcmd.exe.Security Audit
Reviewed command execution and IPC payload handling. The new
shellflag is only honored as a strict boolean, and the shell command does not interpolate the agent binary, model, cwd, or prompt into shell source. The prompt still travels through stdin for OpenCode/Codex-style agents, and existing timeout/cancellation limits remain in place.No secrets, auth flows, or dependency changes are introduced.
Notes
The fix is intentionally scoped to non-interactive SSH Source Control AI generation. Normal non-shell execution remains the default unless the caller asks for shell PATH resolution.