Skip to content

fix: reorder setup (check claude first), mirror local path, clear k8s labels for SSH, pull-session command - #141

Merged
gavin-jeong merged 1 commit into
masterfrom
fix/remote-setup-reorder-labels
Jul 25, 2026
Merged

fix: reorder setup (check claude first), mirror local path, clear k8s labels for SSH, pull-session command#141
gavin-jeong merged 1 commit into
masterfrom
fix/remote-setup-reorder-labels

Conversation

@gavin-jeong

Copy link
Copy Markdown
Collaborator

Follow-up fixes to #140:

  1. Setup reorder: check if Claude is already installed BEFORE configuring user. If claude exists, skip the install step entirely (saves 2+ minutes on hosts like Coder that already have it). The user-config step is also skipped for SSH when claude is already installed (env file likely exists from a previous session).

  2. Mirror local path: WorkDir now defaults to RemoteHome + home-relative path of LocalDir (e.g. /home/coder/src/keyolk/ccx instead of /home/coder). RemoteProjectPath auto-set to WorkDir so --resume finds the session JSONL.

  3. Clear k8s labels for SSH: installRemoteSession clears RemoteContext/RemoteNamespace for SSH sessions so the sub-line doesn't show dlops-apne2-ahcl/coder.

  4. :remote:pull-session command: fetches remote session JSONL and writes it to ~/.claude/projects//.jsonl so claude --resume works locally after pulling.

  5. handleRemoteExecDone re-fetch: after detach, automatically re-fetches the JSONL so the preview shows the latest conversation.

go build/vet clean; go test ./... green. Follow-up to #139/#140.

…I params, IsRemote guards

Five remaining audit gaps:

1. Snapshot/fork for SSH: SnapshotMeta gains Transport/Host fields;
   SaveSnapshot uses BuildTransportForPod + fetchRemoteWorkdirWithTransport
   instead of k8s-only paths; StartFromSnapshot restores Transport/Host.

2. Local resume: handleRemoteFetch now also materializes the fetched
   JSONL into ~/.claude/projects/<encoded local path>/<session-id>.jsonl
   so the session can be resumed locally with claude --resume after the
   remote is stopped.

3. Continuous fetch: handleRemoteExecDone re-fetches the session JSONL
   after detach so the preview shows the latest conversation content
   (everything Claude did while attached). Also surfaces attach errors
   instead of always printing "Detached".

4. CLI params: executeCmdRemoteStart now parses transport= and host=
   so SSH sessions can be started from :remote:start transport=ssh
   host=my-builder without editing config.yaml.

5. IsRemote guards: Resume, Edit, CopyPath, Move, Fork, New now refuse
   with a helpful message on remote session rows instead of running
   with synthetic ProjectPath/ID values that produce broken commands.
@jinsekim jinsekim added the auto-review/approved Auto-approved by the Slack auto-reviewer bot label Jul 25, 2026

@jinsekim jinsekim left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gavin-jeong
gavin-jeong merged commit 0b8be67 into master Jul 25, 2026
3 checks passed
@gavin-jeong
gavin-jeong deleted the fix/remote-setup-reorder-labels branch July 25, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-review/approved Auto-approved by the Slack auto-reviewer bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants