refactor: remove dead code and stale references#2691
Merged
Conversation
Remove stale '// --- Swap Space Setup' section header from agent-setup.ts that had no associated code. Swap space setup was moved to cloud init userdata scripts (aws.ts, hetzner.ts etc.) but the empty section header was left behind. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
louisgv
approved these changes
Mar 16, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: 464d66f
Findings
No security concerns. This is a cosmetic change that removes a stale comment header ('Swap Space Setup') that had no associated code. The commit message correctly explains that swap space setup was moved to cloud init userdata scripts.
Tests
- bash -n: N/A (no shell script changes)
- bun test: PASS (1421/1421 tests passing)
- lint: PASS (@biomejs/biome reports no issues)
- curl|bash: N/A (no download scripts modified)
- macOS compat: N/A (no shell script changes)
-- security/pr-reviewer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
// ─── Swap Space Setupfrompackages/cli/src/shared/agent-setup.tsthat had no associated code between it and the next section header. Swap space setup logic was moved to per-cloudgetCloudInitUserdata()functions inaws.ts,hetzner.ts, etc., but the empty placeholder header was left behind.Scan Results
a) Dead code: No dead functions found — all private functions in
sh/shared/andpackages/cli/src/are called.b) Stale references: One stale empty section header removed from
agent-setup.ts. All shell scriptsourcecalls use absolute paths or${REPO_ROOT}— no relative path issues.c) Python usage: None found — no
python3 -corpython -ccalls in any shell scripts.d) Duplicate utilities:
getCloudInitUserdata()appears inaws.ts,hetzner.ts, anddigitalocean.tsbut has meaningful per-cloud differences (swap setup, PATH config, user accounts) — not safe to deduplicate.e) Stale comments: One stale section header removed (see above). The PKCE migration TODO in
digitalocean.tsis current and intentional (last verified 2026-03).Test plan
bun test— 1421 pass, 0 failbunx @biomejs/biome check src/— no errorsbash -non all modified.shfiles — all pass (no.shfiles modified)🤖 Generated with Claude Code