Split remote.ts by topic, starting with migrations
- 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
Assessment
This issue has not been assessed yet.