{"record":{"id":"a38394e7951a6b78","repo":"stablyai/orca","slug":"remote-filesystem-unavailable-reconnect-the-ssh-t","errorCode":null,"errorMessage":"Remote filesystem unavailable. Reconnect the SSH target before retrying.","messagePattern":"Remote filesystem unavailable\\. Reconnect the SSH target before retrying\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ipc/worktrees.ts","lineNumber":3446,"sourceCode":"              : ('none' as const)\n        }\n      }\n      return readIssueCommand(repo.path)\n    }\n  )\n\n  ipcMain.handle(\n    'hooks:writeIssueCommand',\n    async (_event, args: { repoId: string; content: string; hostId?: ExecutionHostId }) => {\n      const repo = getRepoForWorktreeRemoval(store, args.repoId, args.hostId)\n      if (!repo || isFolderRepo(repo)) {\n        return\n      }\n      if (repo.connectionId) {\n        const issueCommandPath = joinWorktreeRelativePath(repo.path, '.orca/issue-command')\n        const fsProvider = getSshFilesystemProvider(repo.connectionId)\n        if (!fsProvider) {\n          throw new Error(\n            'Remote filesystem unavailable. Reconnect the SSH target before retrying.'\n          )\n        }\n        const trimmed = args.content.trim()\n        if (!trimmed) {\n          await fsProvider.deletePath(issueCommandPath, false).catch((error: unknown) => {\n            if (!isENOENT(error)) {\n              throw error\n            }\n          })\n          return\n        }\n        await fsProvider.createDir(joinWorktreeRelativePath(repo.path, '.orca'))\n        const gitignorePath = joinWorktreeRelativePath(repo.path, '.gitignore')\n        try {\n          const result = await fsProvider.readFile(gitignorePath)\n          if (!result.isBinary && !/^\\.orca\\/?$/m.test(result.content)) {\n            const separator = result.content.endsWith('\\n') ? '' : '\\n'","sourceCodeStart":3428,"sourceCodeEnd":3464,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/worktrees.ts#L3428-L3464","documentation":"Thrown by 'hooks:writeIssueCommand' for an SSH repo (repo.connectionId set) when getSshFilesystemProvider(repo.connectionId) returns nothing. The remote filesystem provider is the bridge that writes .orca/issue-command over SSH; its absence means the SSH connection is gone, so writing is refused rather than silently dropping the command.","triggerScenarios":"The SSH target dropped or was disconnected after the repo was opened, then the user edits the issue-command. Also when the SSH provider module is torn down during quit while a write is in flight.","commonSituations":"Network interruption to the SSH host, SSH agent/keys removed, host rebooted, or the connection was closed from another pane. Reconnecting usually restores the provider.","solutions":["Reconnect the SSH target, then retry the write.","Guard the UI: if getSshFilesystemProvider(repo.connectionId) is falsy, disable Save and show a reconnect prompt.","For local repos this path is not taken; ensure repo.connectionId is not stale."],"exampleFix":"// before\nawait ipc.invoke('hooks:writeIssueCommand', { repoId, content, hostId })\n// after\nif (repo.connectionId && !getSshFilesystemProvider(repo.connectionId)) {\n  await promptReconnect(repo.connectionId)\n}\nawait ipc.invoke('hooks:writeIssueCommand', { repoId, content, hostId })","handlingStrategy":"validation","validationCode":"if (repo.connectionId && !getSshFilesystemProvider(repo.connectionId)) { await promptReconnect(repo.connectionId); return }","typeGuard":"function hasRemoteFilesystem(connectionId: string | undefined): boolean {\n  return !connectionId || Boolean(getSshFilesystemProvider(connectionId))\n}","tryCatchPattern":"try { await ipc.invoke('hooks:writeIssueCommand', { repoId, content, hostId }) }\ncatch (e) {\n  if (/Remote filesystem unavailable/.test(String((e as Error).message))) await reconnectSsh(repo.connectionId)\n  else throw e\n}","preventionTips":["Disable the issue-command Save button when the SSH provider is unavailable.","Reconnect SSH before editing hooks on remote repos.","Surface connection health in the UI before writes are attempted."],"tags":["ssh","remote-filesystem","hooks","connection","issue-command"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}