Skip to content

fix: own persistent SSH transport lifecycle - #1177

Merged
skevetter merged 2 commits into
mainfrom
implement-devsy-pr2-transport-ownership
Sep 2, 2026
Merged

skevetter merged 2 commits into
mainfrom
implement-devsy-pr2-transport-ownership

Conversation

@skevetter

@skevetter skevetter commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor
  • add first-close-wins lifecycle ownership and structured closure attribution for persistent proxy and workspace SSH transports
  • log canonical transport closure metadata and reject negative SSH keepalive acknowledgements
  • cover direct-tcpip reuse, concurrent channels, idle parent connections, lifecycle cancellation, and close attribution

Summary by CodeRabbit

  • Bug Fixes

    • Improved SSH tunnel reliability when opening repeated, concurrent, or delayed forwarding channels.
    • SSH keepalive failures now report rejected requests as errors, making connection issues easier to identify.
    • Tunnel shutdowns are handled more consistently, including provider failures, SSH failures, and canceled connections.
  • Improvements

    • Added more complete transport lifecycle tracking and close-event logging to improve tunnel diagnostics.
    • Enhanced tunnel metadata reporting for workspace connections.

@netlify

netlify Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit f23b9ce
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a9845dc287262000802427b

@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 5714943b-1f89-4c11-9239-ccd6a334d6c4

📥 Commits

Reviewing files that changed from the base of the PR and between 544d50b and f23b9ce.

📒 Files selected for processing (8)
  • .github/workflows/pr-ci.yml
  • cmd/workspace/ssh.go
  • cmd/workspace/ssh_keepalive_test.go
  • pkg/ssh/direct_tcpip_test.go
  • pkg/tunnel/container.go
  • pkg/tunnel/direct.go
  • pkg/tunnel/transport.go
  • pkg/tunnel/transport_test.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

The change adds persistent transport lifecycle management with close classification, cancellation, first-close-wins metadata, and close logging. Tunnel callers now pass metadata. SSH keepalive rejection handling and direct-tcpip channel tests were added. The CI workflow upgrades Podman to v5.8.4.

Tunnel transport lifecycle

Layer / File(s) Summary
Persistent transport lifecycle
pkg/tunnel/transport.go, pkg/tunnel/transport_test.go
Adds transport state, cancellation, completion signaling, close classification, logging, orchestration, and lifecycle tests.
Tunnel integration and metadata logging
pkg/tunnel/direct.go, pkg/tunnel/container.go, cmd/workspace/ssh.go
Routes tunnel execution through runPersistentPair, logs close information, and passes provider, mode, and workspace metadata.
SSH keepalive and direct-tcpip validation
cmd/workspace/ssh.go, cmd/workspace/ssh_keepalive_test.go, pkg/ssh/direct_tcpip_test.go
Reports rejected keepalive requests and tests repeated, concurrent, and idle direct-tcpip channels.

Podman integration test runtime

Layer / File(s) Summary
Podman static binary update
.github/workflows/pr-ci.yml
Updates the cached archive, download URL, and checksum to Podman v5.8.4.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to f23b9

The PR updates persistent SSH transport lifecycle handling without any identified concrete product or runtime risk; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant WorkspaceSSH
  participant Tunnel
  participant PersistentTransport
  participant PipeBridge
  participant Provider
  participant SSHHandler
  WorkspaceSSH->>Tunnel: provide provider, mode, and workspace metadata
  Tunnel->>PersistentTransport: start persistent provider and SSH pair
  PersistentTransport->>PipeBridge: run paired transports
  Provider-->>PersistentTransport: complete or return provider error
  SSHHandler-->>PersistentTransport: complete or return SSH error
  PersistentTransport->>PersistentTransport: classify and record first close
  PersistentTransport-->>Tunnel: return close info and error
  Tunnel->>Tunnel: log transport close
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.35% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 7 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: owning the persistent SSH transport lifecycle. It matches the pull request objectives and changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 19.35% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 7 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch implement-devsy-pr2-transport-ownership

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit f23b9ce
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a9845dced2a330008783f1d

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@skevetter
skevetter force-pushed the implement-devsy-pr2-transport-ownership branch from f221cfc to 21c6d16 Compare September 2, 2026 14:12
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@skevetter
skevetter marked this pull request as ready for review September 2, 2026 17:16
@mergify

mergify Bot commented Sep 2, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@skevetter
skevetter merged commit 1f6466e into main Sep 2, 2026
85 checks passed
@skevetter
skevetter deleted the implement-devsy-pr2-transport-ownership branch September 2, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant