refactor: simplify codebase — remove dead code and duplication#18
Merged
jacksoncage merged 3 commits intomainfrom Mar 1, 2026
Merged
refactor: simplify codebase — remove dead code and duplication#18jacksoncage merged 3 commits intomainfrom
jacksoncage merged 3 commits intomainfrom
Conversation
…ication, and reducing verbosity - Remove dead code: PLATFORM_FORMAT_HINTS, listRecentFailed, cleanup method in trace, unused ValidationResult interface, unused imports - Extract shared helpers: replyAndLog, formatDuration, cancelDebouncedStatus, initRepoFromSlug, loadHtml, getConfigPath, whichSync - Consolidate duplication: withTimeout into shared runners/timeout.ts, complete/fail into shared finish method, adapter status collection, SSE broadcasting, bot token verification loop, .env section writing - Replace verbose patterns: 13 command if-statements → lookup table, priority maps → module-level constants, nested if chains → optional chaining - Remove noise comments that restate what code already communicates 21 files changed, 344 net lines removed. All 369 tests pass.
Bare catch blocks were silently swallowing errors in broadcastSSE, SSE controller close, and config loading. Restore debug/warn logging so failures are observable without changing control flow.
The withTimeout helper left a dangling 30-minute setTimeout when the process exited normally, leaking one timer per task. Clear it on exit.
Owner
Author
Code Review SummaryReviewed by 4 specialized agents: code quality, silent failure analysis, test coverage, and type design. Findings & FixesFixed — Silent failure issues (3 bare
Fixed — Timer leak in
No Issues Found
Stats
|
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
PLATFORM_FORMAT_HINTS,listRecentFailed,cleanup()in trace, unusedValidationResultinterface, unused importsreplyAndLog,formatDuration,cancelDebouncedStatus,initRepoFromSlug,loadHtml,getConfigPath,whichSync,withTimeout(newrunners/timeout.ts)complete/fail→ sharedfinishmethod, adapter status collection, SSE broadcasting, bot token verification loop,.envsection writing, 13 command if-statements → lookup table22 files changed, 329 net lines removed (-696/+367). All 369 tests pass.
Test plan
bun test— 369 tests pass, 744 assertions, 0 failuresbun run setupinteractive flow