coder / coder/vscode-coder

Split remote.ts by topic, starting with migrations

Open
#1,066 1 comment 0 reactions 0 assignees View on GitHub
Improvement tech-debt vs-code
Dominant language
TypeScript
Stars
130
Forks
48
Avg merge
3d 3h
Merged PRs (30d)
15

Description

\`src/remote/remote.ts\` is 1,207 lines and mixes every concern of remote setup in one class. Recent work (per-editor SSH configs, legacy authority migration) keeps growing it.

## Topics currently mixed into the class

- Setup orchestration: \`setup\`, \`setupCoderRemote\`
- Migrations: \`migrateLegacyAuthority\` (authority), \`migrateToSecretsStorage\`, \`migrateSessionTokenFile\`, \`migrateSessionAuthFromFiles\` (credentials)
- SSH config assembly: \`updateSSHConfig\`, \`writeRemoteSshConfig\`, \`buildProxyCommand\`, \`getSshConfigPath\`, \`getLogArgs\`, \`getLogDir\`
- Workspace lifecycle: \`lookupWorkspace\`, \`waitForWorkspaceReady\`, \`resolveAgent\`
- Auth/session: \`ensureLoggedInAndRetry\`, \`showSessionExpiredDialog\`, \`watchRemoteSessionAuth\`
- Binary management: \`resolveRemoteBinary\`, \`checkCompatibility\`
- Window/UI glue: \`createAgentMetadataStatusBar\`, \`watchSettings\`, \`registerLabelFormatter\`, \`closeRemote\`, \`reloadWindow\`

## Proposal

1. Extract migrations first, e.g. into \`src/remote/migrations.ts\`. They are self-contained, interact little with the rest of setup, and each has a deletion horizon; keeping them together makes them easy to find and eventually remove.
2. If that lands well, extract SSH config assembly next. It is the most test-heavy area and only needs the path resolver, settings, and logger.
3. Keep orchestration (\`setup\`/\`setupCoderRemote\`) in \`remote.ts\`.

Non-goals: no behavior changes and no new abstractions; move plain methods by topic and keep the telemetry span threading as is.

Filed by Claude Code for @EhabY.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.