Repository navigation
Conversation
When a workspace reports as "Running" but the SSH tunnel isn't ready, the symlink setup fails and the subsequent interactive SSH also errors. Now falls back to workspace_up() which properly establishes the tunnel.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the fast-attach path to treat work symlink setup as a health check for the SSH tunnel, and falls back to the normal workspace startup flow when the tunnel is not ready instead of failing with a tunneling error. Sequence diagram for fast-attach with SSH tunnel health checksequenceDiagram
actor Dev
participant CLI as dl_main
participant WS as WorkspaceService
participant FS as SymlinkManager
participant SSH as SSHClient
participant Cache as CacheUpdater
Dev->>CLI: invoke dl repo
CLI->>WS: get_workspace_state(workspace_id)
WS-->>CLI: state = Running
CLI->>FS: setup_work_symlink(workspace_id)
alt symlink setup succeeds (tunnel healthy)
FS-->>CLI: true
CLI->>SSH: workspace_ssh(workspace_id, shell_command, workdir, preserve_symlink=true)
SSH-->>CLI: SSH session exit code
CLI->>Cache: update_cache_background()
Cache-->>CLI: ok
CLI-->>Dev: return SSH exit code
else symlink setup fails (tunnel not ready)
FS-->>CLI: false
CLI->>CLI: log warning "SSH tunnel not ready, falling back to workspace_up()..."
CLI->>WS: workspace_up(workspace_id, shell_command)
WS-->>CLI: SSH session exit code
CLI-->>Dev: return SSH exit code
end
Flow diagram for updated fast-attach decision logicflowchart TD
A[Start dl main] --> B{custom_id is None?}
B -->|No| Z[Default workspace_up path]
B -->|Yes| C[get_workspace_state(workspace_id)]
C --> D{state == Running?}
D -->|No| Z[Default workspace_up path]
D -->|Yes| E[Log workspace already running]
E --> F[setup_work_symlink(workspace_id)]
F -->|False| G[Log warning SSH tunnel not ready, fallback]
G --> Z[Default workspace_up path]
F -->|True| H[workspace_ssh(workspace_id, shell_command, workdir, preserve_symlink=true)]
H --> I[update_cache_background()]
I --> J[Return SSH exit code]
Z --> J[Return result from workspace_up()]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Now that
setup_work_symlinkis used as a health check, it would be helpful to ensure its return type is explicitly boolean (and documented as such) so this new control flow is clear and less error-prone if the function is modified later. - Consider logging the workspace ID or more context in the warning (
SSH tunnel not ready, falling back...) to make it easier to correlate logs when multiple workspaces are active.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Now that `setup_work_symlink` is used as a health check, it would be helpful to ensure its return type is explicitly boolean (and documented as such) so this new control flow is clear and less error-prone if the function is modified later.
- Consider logging the workspace ID or more context in the warning (`SSH tunnel not ready, falling back...`) to make it easier to correlate logs when multiple workspaces are active.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #32 +/- ##
==========================================
- Coverage 82.45% 82.31% -0.15%
==========================================
Files 9 9
Lines 1174 1176 +2
==========================================
Hits 968 968
- Misses 206 208 +2
🚀 New features to boost your workflow:
|
Just calling workspace_up() on an already-running container doesn't fix a broken tunnel — devpod exits early. Stopping first forces a clean restart so the tunnel is properly re-established.
|
Closing as obsolete — the code this patches no longer exists. The diff rewrites the fast-attach block around The whole work-symlink mechanism was removed, and the fast-attach path was rewritten since (#145 among others). The branch is 220 commits behind main and conflicts; there is nothing to rebase it onto, because its subject was deleted rather than moved. Its required If a fast-attach still falls back when the SSH tunnel is not ready, that is worth a fresh issue against the current attach path ( |
Summary
setup_work_symlink()fails silently and the subsequent interactive SSH also errors withError tunneling to containerworkspace_up()which properly establishes the container tunnel before attachingTest plan
dl <repo>when workspace is running and tunnel is healthy — should fast-attach as beforedl <repo>when workspace is running but tunnel is stale — should log warning and fall back toworkspace_up()pixi run pytest test/)🤖 Generated with Claude Code
Summary by Sourcery
Bug Fixes: