refactor: extract magic-number timeouts into named constants#474
Merged
Conversation
Replace hard-coded timeout/delay literals with named constants. Values are unchanged (behavior-invariant). - browser-local-server / vscode-tunnel-websocket: reference existing SELECTOR_TIMEOUT_NAVIGATION_MS (30000) / SELECTOR_TIMEOUT_SINGLE_MS (10000) - db-query: new DB_CONNECT_TIMEOUT_MS (10000) for MySQL/PG connect timeouts - browser: new BROWSER_SESSION_RETRY_DELAY_MS (500) - vscode-server: new STARTUP_HEALTH_POLL_MS (500) for health-check polling Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Refactor loop (iteration 1). Replace hard-coded timeout/delay literals in the agent with named constants. Values unchanged — behavior-invariant.
Changes
browser-local-server.ts/vscode-tunnel-websocket.ts: reference the already-definedSELECTOR_TIMEOUT_NAVIGATION_MS(30000) /SELECTOR_TIMEOUT_SINGLE_MS(10000) instead of literals (the constants existed but weren't referenced here)db-query.ts: newDB_CONNECT_TIMEOUT_MS(10000) for MySQLconnectTimeout/ PGconnectionTimeoutMillisbrowser.ts: newBROWSER_SESSION_RETRY_DELAY_MS(500)vscode-server.ts: newSTARTUP_HEALTH_POLL_MS(500) for startup health-check pollingDeliberately left untouched: the
Math.min(params.waitForTimeout, 10000)input-clamp (a different concept — upper bound on caller input, not a selector timeout).Tests
🤖 Generated with Claude Code