fix: acp init dir no permission - #1118
Conversation
WalkthroughThis PR modifies the ACP initialization helper to introduce dedicated temporary directory management. A new private helper function obtains or creates a temporary directory under Electron's userData path, with fallback to Changes
Sequence DiagramsequenceDiagram
participant Init as ACP Initialization
participant Helper as getAcpTempDir()
participant FS as Electron userData / FS
participant PTY as PTY Session
Init->>Helper: Request ACP temp directory
Helper->>FS: Check/create directory under userData
alt Directory creation succeeds
FS-->>Helper: Directory path
else Creation fails
FS-->>Helper: Return process.cwd()
end
Helper-->>Init: Return workDir
Init->>PTY: Initialize with workDir
PTY->>PTY: Set cwd to workDir
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/presenter/configPresenter/acpInitHelper.ts(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/main/presenter/configPresenter/acpInitHelper.ts (1)
test/mocks/electron.ts (2)
app(2-10)shell(25-27)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: build-mac (arm64)
- GitHub Check: build-mac (x64)
- GitHub Check: build-linux (x64)
- GitHub Check: build-windows (x64)
- GitHub Check: build-check (x64)
🔇 Additional comments (2)
src/main/presenter/configPresenter/acpInitHelper.ts (2)
5-5: LGTM!The import of
appfrom Electron is necessary to access the userData path for the temporary directory.
344-345: LGTM!The temporary directory is correctly integrated into the PTY session lifecycle. The working directory is computed once via
getAcpTempDir()and consistently used for both logging and as thecwdparameter when spawning the PTY process.Also applies to: 367-367, 375-375
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.