Skip to content

fix(ssh): show actionable MaxSessions panel when channels are exhausted#2080

Merged
jschwxrz merged 4 commits into
mainfrom
jona/eng-1293-ssh-channel-unavailable-leaves-remote-project-stuck-in-ui
May 18, 2026
Merged

fix(ssh): show actionable MaxSessions panel when channels are exhausted#2080
jschwxrz merged 4 commits into
mainfrom
jona/eng-1293-ssh-channel-unavailable-leaves-remote-project-stuck-in-ui

Conversation

@jschwxrz
Copy link
Copy Markdown
Collaborator

  • edit modal copy
  • also show channel unavailable issues on project mount

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 18, 2026

Greptile Summary

This PR surfaces the SshChannelUnavailablePanel earlier — now triggered on project mount in addition to post-mount degraded health — and replaces the generic error copy with an actionable instructions card explaining how to raise MaxSessions and reload sshd.

  • create-project-provider.ts: calls reportChannelError in the SSH provider creation catch block so a channel-open failure at mount time correctly marks the connection as degraded.
  • project-ssh-health-gate.tsx: reads data directly from ProjectStore (available in all states) instead of only from the mounted-project payload, so the panel appears even during the bootstrapping phase.
  • ssh-channel-unavailable-panel.tsx: rewrites the error message and adds a code card with the MaxSessions config snippet and systemctl reload commands; widens the container from max-w-sm to max-w-md.

Confidence Score: 3/5

Safe to merge after fixing the sshd_config comment syntax in the instructions panel.

The instructions card in SshChannelUnavailablePanel shows a pre block containing MaxSessions 100 // 500 for heavy parallel use. sshd_config only recognises # as a comment character; // is treated as a literal value, making the line unparseable. A user who copies the snippet verbatim will get a config-parse error when reloading sshd. The other two changes are correct and well-scoped.

ssh-channel-unavailable-panel.tsx — the pre config snippet uses invalid comment syntax for sshd_config.

Important Files Changed

Filename Overview
src/renderer/features/projects/components/ssh-channel-unavailable-panel.tsx Improved copy and added an actionable instructions card; pre block uses // comment syntax instead of #, which is invalid in sshd_config and can break the user's SSH daemon if pasted verbatim.
src/renderer/features/projects/components/project-ssh-health-gate.tsx Widens the check from mounted-only to any ProjectStore state by reading data directly instead of via asMounted; allows the degraded panel to appear during project boot/mount phase. Handles null data safely via optional chaining.
src/main/core/projects/create-project-provider.ts Calls reportChannelError in the SSH provider creation catch block so that channel-open failures during mount set the degraded health state and surface the new panel.

Sequence Diagram

sequenceDiagram
    participant App as Renderer
    participant Gate as ProjectSshHealthGate
    participant Store as ProjectStore
    participant Main as createSshProvider (main)
    participant Manager as SshConnectionManager

    App->>Gate: mount(projectId)
    Gate->>Store: getProjectStore(projectId)?.data
    Note over Store: data available in ALL states
    Store-->>Gate: "SshProject { connectionId }"
    Gate->>App: healthFor(connectionId) null ok
    App->>Main: createSshProvider()
    Main->>Manager: connect(connectionId)
    Manager-->>Main: throws channel-open error
    Main->>Manager: reportChannelError(connectionId, error)
    Manager-->>App: health state degraded
    App->>Gate: re-render MobX reaction
    Gate-->>App: SshChannelUnavailablePanel
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
src/renderer/features/projects/components/ssh-channel-unavailable-panel.tsx:19-22
The `<pre>` block will render as `MaxSessions 100     // 500 for heavy parallel use` on a single line. `sshd_config` does not recognize `//` as a comment delimiter — only `#` is valid. A user who copies the full `<pre>` content and pastes it verbatim will get a config-parse error when sshd tries to reload, which is the exact failure path this panel is trying to help them recover from.

```suggestion
          <pre className="text-[11px] font-mono text-foreground bg-background rounded px-2 py-1 overflow-x-auto">
            {'MaxSessions 100     # 500 for heavy parallel use'}
          </pre>
```

Reviews (1): Last reviewed commit: "fix(projects): render SSH health panel b..." | Re-trigger Greptile

@jschwxrz jschwxrz merged commit 9e24413 into main May 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant