fix: add SSH remote support for wizard file operations#567
fix: add SSH remote support for wizard file operations#567rothnic wants to merge 6 commits intoRunMaestro:mainfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a wrapper openWizardModal in App that reads Changes
Sequence DiagramsequenceDiagram
participant App as App (Maestro)
participant Settings as window.maestro.settings
participant ModalStore as ModalStore
participant useWizard as useWizard()
App->>Settings: read wizardResumeState
Settings-->>App: return resume data
alt resumeState present & resumable step
App->>ModalStore: openModal('wizardResume', SerializableWizardState)
ModalStore-->>App: modal opened
else no applicable resume state or error
App->>useWizard: call _baseOpenWizardModal()
useWizard-->>App: wizard modal opened
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
Greptile SummaryThis PR adds SSH remote session support to two wizard document-generation code paths ( Key findings:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant App as App.tsx
participant Settings as window.maestro.settings
participant ModalStore as ModalStore
participant WizardScreen as PreparingPlanScreen
participant PhaseGen as phaseGenerator.ts
participant InlineGen as inlineWizardDocGen.ts
participant FS as window.maestro.fs
participant AutoRun as window.maestro.autorun
User->>App: Click Wizard button
App->>Settings: get('wizardResumeState')
Settings-->>App: saved state or null
alt Has resumable saved state
App->>ModalStore: openModal('wizardResume', {state})
else No saved state
App->>App: _baseOpenWizardModal()
end
WizardScreen->>WizardScreen: Extract sshRemoteId from state.sessionSshRemoteConfig
WizardScreen->>PhaseGen: saveDocuments(path, docs, cb, 'Initiation', sshRemoteId)
PhaseGen->>AutoRun: watchFolder(autoRunPath, sshRemoteId)
PhaseGen->>AutoRun: writeDoc(path, filename, content, sshRemoteId)
AutoRun-->>PhaseGen: file change event
PhaseGen->>FS: readFile(fullPath, sshRemoteId) ✅
Note over InlineGen: inlineWizardDocGen flow
InlineGen->>AutoRun: watchFolder(subfolderPath, sshRemoteId) ✅
AutoRun-->>InlineGen: file change event
InlineGen->>FS: readFile(fullPath) ❌ missing sshRemoteId
InlineGen->>AutoRun: saveDocument → writeDoc(path, filename, content, sshRemoteId) ✅
|
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/components/Wizard/screens/PreparingPlanScreen.tsx (1)
771-782:⚠️ Potential issue | 🔴 Critical
sshRemoteIdis computed but not forwarded tosaveDocuments.
Line 771prepares the remote ID, but thesaveDocumentsinvocation omits the new 5th argument, so remote writes still run without SSH context in this flow.🐛 Proposed fix
const saveResult = await phaseGenerator.saveDocuments( state.directoryPath, genResult.documents, (file) => { // Add file to the created files list as it's saved addCreatedFile(file); }, - 'Initiation' // Save in Initiation subfolder + 'Initiation', // Save in Initiation subfolder + sshRemoteId );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/renderer/components/Wizard/screens/PreparingPlanScreen.tsx` around lines 771 - 782, The variable sshRemoteId is computed from state.sessionSshRemoteConfig but never passed into phaseGenerator.saveDocuments, so remote writes run without SSH context; update the call to phaseGenerator.saveDocuments (the invocation that currently passes state.directoryPath, genResult.documents, the progress callback addCreatedFile, and 'Initiation') to include sshRemoteId as the fifth argument so saveDocuments receives the SSH remote id; locate the call to phaseGenerator.saveDocuments in PreparingPlanScreen.tsx and append sshRemoteId to its parameter list.
🧹 Nitpick comments (1)
docs/releases.md (1)
201-201: Normalize product spelling and hyphenation consistency.Use
GitHub(Line 201), and keep one style for pre-release wording (pre-releasevsprerelease) consistently across the page (Line 266).Also applies to: 266-266
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/releases.md` at line 201, Replace the inconsistent product spelling and hyphenation: change "Github Worktree" to "GitHub Worktree" (the phrase currently "Github Worktree was added") and normalize all occurrences of the pre-release wording to a single style (use "pre-release" consistently instead of "prerelease") throughout the document, searching for variants like "pre-release", "prerelease", and "pre release" and updating them to "pre-release".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/releases.md`:
- Line 101: Fix the typo in the user-facing sentence that currently reads
"Launch from file preview or from the FIle tree panel" by changing "FIle" to
"File" in the "🗄️ Document Graphs." line of docs/releases.md so the sentence
becomes "Launch from file preview or from the File tree panel."
- Line 107: Replace the incorrect heading "Smaller Changes in 014.x" with the
correctly formatted version label "Smaller Changes in 0.14.x" in the
docs/releases.md heading line so it matches the project's versioning style;
locate the heading string "# Smaller Changes in 014.x" and update it to "#
Smaller Changes in 0.14.x".
- Line 20: Several release-section headings (e.g., the heading "Major 0.15.x
Additions") are using top-level or inconsistent hash depth which breaks
hierarchy and TOC; update those subsection headings under each "vX.Y.x" section
to a consistent third-level header (use "###") so they nest correctly. Search
for headings that jump back to "#" or "##" inside version blocks (including the
ones noted like the "Major 0.15.x Additions" heading and the other similar
section headings) and change their leading hashes to "###" to maintain
consistent heading depth across the release notes.
In `@src/renderer/App.tsx`:
- Around line 354-373: The catch in openWizardModal currently only logs errors
and falls back, which hides failures from production monitoring; update the
catch to capture the exception with Sentry (e.g. call Sentry.captureException(e)
or Sentry.withScope to add context such as { handler: 'openWizardModal', key:
'wizardResumeState' }) before the console.error, ensuring Sentry is
imported/available, then continue with the existing fallback to
_baseOpenWizardModal(); reference openWizardModal, window.maestro.settings.get,
and useModalStore.getState().openModal when adding context.
---
Outside diff comments:
In `@src/renderer/components/Wizard/screens/PreparingPlanScreen.tsx`:
- Around line 771-782: The variable sshRemoteId is computed from
state.sessionSshRemoteConfig but never passed into phaseGenerator.saveDocuments,
so remote writes run without SSH context; update the call to
phaseGenerator.saveDocuments (the invocation that currently passes
state.directoryPath, genResult.documents, the progress callback addCreatedFile,
and 'Initiation') to include sshRemoteId as the fifth argument so saveDocuments
receives the SSH remote id; locate the call to phaseGenerator.saveDocuments in
PreparingPlanScreen.tsx and append sshRemoteId to its parameter list.
---
Nitpick comments:
In `@docs/releases.md`:
- Line 201: Replace the inconsistent product spelling and hyphenation: change
"Github Worktree" to "GitHub Worktree" (the phrase currently "Github Worktree
was added") and normalize all occurrences of the pre-release wording to a single
style (use "pre-release" consistently instead of "prerelease") throughout the
document, searching for variants like "pre-release", "prerelease", and "pre
release" and updating them to "pre-release".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e1d40375-a27b-47bc-ac63-7e2002621d63
📒 Files selected for processing (5)
docs/releases.mdsrc/renderer/App.tsxsrc/renderer/components/Wizard/screens/PreparingPlanScreen.tsxsrc/renderer/components/Wizard/services/phaseGenerator.tssrc/renderer/services/inlineWizardDocumentGeneration.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/renderer/App.tsx`:
- Around line 360-369: The code opens the 'wizardResume' modal by casting a
loosely-validated saved object to SerializableWizardState based only on presence
of currentStep; tighten validation by checking that saved.currentStep is one of
the known resumable steps (e.g. an allowlist like ['step-a','step-b',...]) and
that required SerializableWizardState fields exist/types before calling
useModalStore.getState().openModal('wizardResume', { state: saved as
SerializableWizardState });; update the guard around saved/currentStep to
validate against the allowlist (and any other mandatory keys) and only then cast
and pass saved to openModal.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2a8ba2a8-f3b4-4187-a95d-635c621c22c0
📒 Files selected for processing (3)
src/renderer/App.tsxsrc/renderer/components/Wizard/screens/PreparingPlanScreen.tsxsrc/renderer/services/inlineWizardDocumentGeneration.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/renderer/components/Wizard/screens/PreparingPlanScreen.tsx
- src/renderer/services/inlineWizardDocumentGeneration.ts
45e94f7 to
c14d109
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (3)
docs/releases.md (3)
20-20:⚠️ Potential issue | 🟡 MinorKeep subsection heading depth consistent within each version section.
Line 20 and the other referenced lines still jump back to
#/##under## vX.Y.xsections, which breaks document hierarchy and TOC nesting. Use###for these subsection headers.Also applies to: 32-32, 107-107, 170-170, 174-174, 178-178, 203-203, 295-295, 303-303, 313-313, 318-318, 324-324
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/releases.md` at line 20, Several subsection headings under version sections use top-level/second-level headers (e.g., the line "# Major 0.15.x Additions" and other headers listed) which breaks hierarchy and TOC nesting; update those subsection headers inside each "## vX.Y.x" section to use third-level headings (###) instead of "#" or "##" so their depth is consistent across the document and the TOC nests correctly; locate the offending headings by searching for "Major 0.15.x Additions" and other repeated top-level/second-level subsection titles and convert them to "###" headings.
107-107:⚠️ Potential issue | 🟡 MinorCorrect version label formatting in the heading.
Line 107 uses
014.x; this should be0.14.xfor consistency with the rest of the changelog.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/releases.md` at line 107, Update the malformed changelog heading "Smaller Changes in 014.x" to use the correct semantic version format by replacing "014.x" with "0.14.x" so the heading reads "Smaller Changes in 0.14.x"; locate the heading string "Smaller Changes in 014.x" in docs/releases.md and make this single-word change to restore consistency with other release headings.
101-101:⚠️ Potential issue | 🟡 MinorFix typo in user-facing release text.
Line 101 still says
FIle tree panel; this should beFile tree panel.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/releases.md` at line 101, Fix the typo in the release note sentence that currently reads "Launch from file preview or from the FIle tree panel" by changing "FIle tree panel" to "File tree panel"; locate the sentence in docs/releases.md (the line containing "Launch from file preview or from the FIle tree panel") and update the capitalization to "File" so the user-facing text reads "Launch from file preview or from the File tree panel."
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/releases.md`:
- Line 201: The release note line starting with "Github Worktree support was
added." uses incorrect casing; update that occurrence to "GitHub Worktree
support was added." (replace "Github" with the official "GitHub") so the product
name uses correct casing in the release notes text.
In `@src/renderer/components/Wizard/services/phaseGenerator.ts`:
- Around line 979-987: The SSH remote id (sshRemoteId) is passed into
watchFolder but not used in subsequent read/fallback code paths; update the
file-reading calls to include the remote context so SSH sessions see
remote-generated docs: pass sshRemoteId into the fs.readFile invocation(s)
(referencing fs.readFile) and thread the sshRemoteId through the disk fallback
by updating readDocumentsFromDisk to accept and use a remoteId parameter
(referencing readDocumentsFromDisk), or call a remote-aware read API, ensuring
all places that read files use the sshRemoteId when
config.sshRemoteConfig?.enabled.
In `@src/renderer/services/inlineWizardDocumentGeneration.ts`:
- Around line 846-847: The SSH remote id (sshRemoteId) is not passed into the
fallback disk-read paths causing documentsFromWatcher to be empty; thread
sshRemoteId into the disk read functions so remote reads use the same context:
update the callsites that perform fs.readFile and the readDocumentsFromDisk
invocation to accept and forward sshRemoteId, and modify readDocumentsFromDisk
(and any helper that does the actual fs.readFile) to use sshRemoteId when
resolving/reading files so watchFolder/saveDocument and the fallback path use
the same remote context.
---
Duplicate comments:
In `@docs/releases.md`:
- Line 20: Several subsection headings under version sections use
top-level/second-level headers (e.g., the line "# Major 0.15.x Additions" and
other headers listed) which breaks hierarchy and TOC nesting; update those
subsection headers inside each "## vX.Y.x" section to use third-level headings
(###) instead of "#" or "##" so their depth is consistent across the document
and the TOC nests correctly; locate the offending headings by searching for
"Major 0.15.x Additions" and other repeated top-level/second-level subsection
titles and convert them to "###" headings.
- Line 107: Update the malformed changelog heading "Smaller Changes in 014.x" to
use the correct semantic version format by replacing "014.x" with "0.14.x" so
the heading reads "Smaller Changes in 0.14.x"; locate the heading string
"Smaller Changes in 014.x" in docs/releases.md and make this single-word change
to restore consistency with other release headings.
- Line 101: Fix the typo in the release note sentence that currently reads
"Launch from file preview or from the FIle tree panel" by changing "FIle tree
panel" to "File tree panel"; locate the sentence in docs/releases.md (the line
containing "Launch from file preview or from the FIle tree panel") and update
the capitalization to "File" so the user-facing text reads "Launch from file
preview or from the File tree panel."
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 477cdf73-476e-41bb-a716-da4f409efd26
📒 Files selected for processing (5)
docs/releases.mdsrc/renderer/App.tsxsrc/renderer/components/Wizard/screens/PreparingPlanScreen.tsxsrc/renderer/components/Wizard/services/phaseGenerator.tssrc/renderer/services/inlineWizardDocumentGeneration.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/components/Wizard/screens/PreparingPlanScreen.tsx
…cion Addresses Greptile review comments: - PreparingPlanScreen.tsx: Pass sshRemoteId as 5th parameter to phaseGenerator.saveDocuments() - inlineWizardDocumentGeneration.ts: Use ?? undefined at extraction time, remove || undefined at call sites
- Add Sentry captureException to openWizardModal error handler (App.tsx) - Greptile fixes already committed: sshRemoteId parameter passing and ?? undefined pattern
- Add explicit validation that currentStep is a known resumable step - Check typeof saved.currentStep === 'string' before includes() check - Validates against known steps: directory-selection, conversation, preparing-plan, phase-review
c14d109 to
bc501e3
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/renderer/components/Wizard/services/phaseGenerator.ts (1)
1025-1025:⚠️ Potential issue | 🟠 MajorFile read inside watcher callback lacks SSH remote context.
The
fs.readFile(fullPath)call at Line 1025 doesn't passsshRemoteId. When the watcher detects file creation on a remote session, this read will fail or read from the wrong location. ThesshRemoteIdis available in the outer closure scope (defined at lines 980-982) and should be passed here.🔧 Proposed fix
- const content = await window.maestro.fs.readFile(fullPath); + const content = await window.maestro.fs.readFile(fullPath, sshRemoteId);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/renderer/components/Wizard/services/phaseGenerator.ts` at line 1025, The file read inside the watcher callback uses window.maestro.fs.readFile(fullPath) without the remote context; update the call to include the outer-scope sshRemoteId so remote reads succeed (e.g., window.maestro.fs.readFile(fullPath, sshRemoteId) or the API-specific options object containing sshRemoteId), ensuring you modify the read in the watcher callback that references fullPath so it forwards sshRemoteId from the closure.src/renderer/components/Wizard/screens/PreparingPlanScreen.tsx (1)
830-839:⚠️ Potential issue | 🟡 MinorMissing
state.sessionSshRemoteConfigin dependency array.The
startGenerationcallback readsstate.sessionSshRemoteConfigat lines 729 and 771, but it's not included in the dependency array. If the SSH config changes during the wizard flow, the callback would use stale values.🛠️ Proposed fix
}, [ state.selectedAgent, state.directoryPath, state.agentName, state.conversationHistory, + state.sessionSshRemoteConfig, setGeneratingDocuments, setGeneratedDocuments, setGenerationError, nextStep, ]);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/renderer/components/Wizard/screens/PreparingPlanScreen.tsx` around lines 830 - 839, The startGeneration callback (used in PreparingPlanScreen) reads state.sessionSshRemoteConfig but the useCallback dependency array at the end of the file omits it; add state.sessionSshRemoteConfig to the dependency array that currently includes state.selectedAgent, state.directoryPath, state.agentName, state.conversationHistory, setGeneratingDocuments, setGeneratedDocuments, setGenerationError, and nextStep so the callback captures updates to the SSH config and avoids using stale values.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/renderer/components/Wizard/screens/PreparingPlanScreen.tsx`:
- Around line 830-839: The startGeneration callback (used in
PreparingPlanScreen) reads state.sessionSshRemoteConfig but the useCallback
dependency array at the end of the file omits it; add
state.sessionSshRemoteConfig to the dependency array that currently includes
state.selectedAgent, state.directoryPath, state.agentName,
state.conversationHistory, setGeneratingDocuments, setGeneratedDocuments,
setGenerationError, and nextStep so the callback captures updates to the SSH
config and avoids using stale values.
In `@src/renderer/components/Wizard/services/phaseGenerator.ts`:
- Line 1025: The file read inside the watcher callback uses
window.maestro.fs.readFile(fullPath) without the remote context; update the call
to include the outer-scope sshRemoteId so remote reads succeed (e.g.,
window.maestro.fs.readFile(fullPath, sshRemoteId) or the API-specific options
object containing sshRemoteId), ensuring you modify the read in the watcher
callback that references fullPath so it forwards sshRemoteId from the closure.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7587a77a-fa4d-45b7-b36e-9d3866def94e
📒 Files selected for processing (4)
src/renderer/App.tsxsrc/renderer/components/Wizard/screens/PreparingPlanScreen.tsxsrc/renderer/components/Wizard/services/phaseGenerator.tssrc/renderer/services/inlineWizardDocumentGeneration.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/services/inlineWizardDocumentGeneration.ts
- phaseGenerator.ts: Pass sshRemoteId to fs.readFile in watcher callback (line 1025) - PreparingPlanScreen.tsx: Add state.sessionSshRemoteConfig to useCallback dependency array
|
Addressed all feedback from coderabbit and greptile, this should be good for review. |
|
@coderabbitai re-review |
|
🧠 Learnings used✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
♻️ Duplicate comments (2)
src/renderer/services/inlineWizardDocumentGeneration.ts (1)
846-847:⚠️ Potential issue | 🟠 MajorRemote watcher is wired, but remote fallback reads are still local.
watchFolder(..., sshRemoteId)is correct, but fallback paths still miss remote context: Line 874 usesreadFile(fullPath)(no SSH ID) and Line 1099 callsreadDocumentsFromDisk(subfolderPath)without SSH context. In remote sessions, this can still return zero docs on fallback.🔧 Suggested fix
- const content = await window.maestro.fs.readFile(fullPath); + const content = await window.maestro.fs.readFile(fullPath, sshRemoteId); - const diskDocs = await readDocumentsFromDisk(subfolderPath); + const diskDocs = await readDocumentsFromDisk(subfolderPath, sshRemoteId); - async function readDocumentsFromDisk(autoRunFolderPath: string): Promise<ParsedDocument[]> { + async function readDocumentsFromDisk( + autoRunFolderPath: string, + sshRemoteId?: string + ): Promise<ParsedDocument[]> { - const listResult = await window.maestro.autorun.listDocs(autoRunFolderPath); + const listResult = await window.maestro.autorun.listDocs(autoRunFolderPath, sshRemoteId); - const readResult = await window.maestro.autorun.readDoc(autoRunFolderPath, fileBaseName); + const readResult = await window.maestro.autorun.readDoc( + autoRunFolderPath, + fileBaseName, + sshRemoteId + );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/renderer/services/inlineWizardDocumentGeneration.ts` around lines 846 - 847, The remote watch call uses watchFolder(subfolderPath, sshRemoteId) but the fallback disk reads still use local-only functions; update the fallback reads to pass the SSH context so remote sessions read from the remote filesystem: change calls that use readFile(fullPath) to the SSH-aware variant (or add sshRemoteId parameter) and update readDocumentsFromDisk(subfolderPath) to accept and forward sshRemoteId (or call a readDocumentsFromDiskRemote(subfolderPath, sshRemoteId)) so both fallback branches use sshRemoteId consistently; ensure any helper functions invoked by watchResult propagate sshRemoteId as well.src/renderer/components/Wizard/services/phaseGenerator.ts (1)
979-987:⚠️ Potential issue | 🟠 MajorSSH support is still incomplete in the disk fallback path.
The watcher now gets
sshRemoteId, but Line 709 still callsreadDocumentsFromDisk(config.directoryPath)without remote context, and the helper at Line 1160 reads via locallistDocs/readDoc. If watcher events are unavailable for remote (expected), fallback can still miss generated docs.🔧 Suggested fix
- const diskDocs = await this.readDocumentsFromDisk(config.directoryPath); + const diskDocs = await this.readDocumentsFromDisk(config.directoryPath, sshRemoteId); - private async readDocumentsFromDisk(directoryPath: string): Promise<ParsedDocument[]> { + private async readDocumentsFromDisk( + directoryPath: string, + sshRemoteId?: string + ): Promise<ParsedDocument[]> { - const listResult = await window.maestro.autorun.listDocs(autoRunPath); + const listResult = await window.maestro.autorun.listDocs(autoRunPath, sshRemoteId); - const readResult = await window.maestro.autorun.readDoc(autoRunPath, fileBaseName); + const readResult = await window.maestro.autorun.readDoc( + autoRunPath, + fileBaseName, + sshRemoteId + );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/renderer/components/Wizard/services/phaseGenerator.ts` around lines 979 - 987, The disk-fallback path must include the remote context: update the call site that currently invokes readDocumentsFromDisk(config.directoryPath) so it also passes sshRemoteId (the same value computed for window.maestro.autorun.watchFolder), and update the helper that reads files (the helper calling listDocs/readDoc) to use the remote-aware APIs (or accept sshRemoteId and call the remote variants) so remote document listing/reading uses sshRemoteId instead of only local filesystem functions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/renderer/components/Wizard/services/phaseGenerator.ts`:
- Around line 979-987: The disk-fallback path must include the remote context:
update the call site that currently invokes
readDocumentsFromDisk(config.directoryPath) so it also passes sshRemoteId (the
same value computed for window.maestro.autorun.watchFolder), and update the
helper that reads files (the helper calling listDocs/readDoc) to use the
remote-aware APIs (or accept sshRemoteId and call the remote variants) so remote
document listing/reading uses sshRemoteId instead of only local filesystem
functions.
In `@src/renderer/services/inlineWizardDocumentGeneration.ts`:
- Around line 846-847: The remote watch call uses watchFolder(subfolderPath,
sshRemoteId) but the fallback disk reads still use local-only functions; update
the fallback reads to pass the SSH context so remote sessions read from the
remote filesystem: change calls that use readFile(fullPath) to the SSH-aware
variant (or add sshRemoteId parameter) and update
readDocumentsFromDisk(subfolderPath) to accept and forward sshRemoteId (or call
a readDocumentsFromDiskRemote(subfolderPath, sshRemoteId)) so both fallback
branches use sshRemoteId consistently; ensure any helper functions invoked by
watchResult propagate sshRemoteId as well.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0bab768f-73f6-4285-812a-d6b2e69d0411
📒 Files selected for processing (4)
src/renderer/App.tsxsrc/renderer/components/Wizard/screens/PreparingPlanScreen.tsxsrc/renderer/components/Wizard/services/phaseGenerator.tssrc/renderer/services/inlineWizardDocumentGeneration.ts
Addresses CodeRabbit review comments: - phaseGenerator.ts: Pass sshRemoteId through readDocumentsFromDisk, listDocs, and readDoc calls - inlineWizardDocumentGeneration.ts: Pass sshRemoteId through readFile, readDocumentsFromDisk, listDocs, and readDoc calls - Ensures SSH context is preserved in all file operations for remote sessions
Summary
Adds SSH remote support for wizard file operations to fix issues when generating Auto Run documents on remote hosts.
Changes
Fixes
Testing
All existing tests pass. The changes ensure SSH remote configuration is properly passed through the wizard document generation flow.
Related
Replaces and consolidates PR #548 (which had messy commit history with debug logging).
Summary by CodeRabbit
New Features
Bug Fixes