fix: add validation bounds to config schemas and fix .env.example#25
Open
fix: add validation bounds to config schemas and fix .env.example#25
Conversation
Add .min()/.max()/.int() constraints to all numeric config fields, cross-field refinements (minWait <= maxWait, stepTimeout >= llmTimeout), replace z.any() with z.unknown(), and fix the Google API key env var name.
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
Adds proper bounds validation to all numeric config fields so invalid values (negative timeouts, zero-width windows, etc.) are caught at parse time instead of causing cryptic Playwright errors later.
Config validation changes
ViewportConfigSchema:
windowWidth—.int().min(200).max(7680)(up to 8K resolution)windowHeight—.int().min(200).max(4320)minWaitPageLoadMs—.int().min(0).max(30000)waitForNetworkIdleMs—.int().min(0).max(30000)maxWaitPageLoadMs—.int().min(0).max(120000)minimumWaitBetweenActions—.int().min(0).max(30000)maxErrorLength—.int().min(50).max(10000)commandsPerStep—.int().min(1).max(50)maxIframes—.int().min(0).max(20)minWaitPageLoadMs <= maxWaitPageLoadMsAgentConfigSchema:
stepLimit—.int().min(1).max(1000)commandsPerStep—.int().min(1).max(50)failureThreshold—.int().min(1).max(100)retryDelay—.int().min(0).max(60000)contextWindowSize—.int().min(1000).max(2000000)commandDelayMs—.int().min(0).max(10000)strategyInterval—.int().min(0).max(100)stepTimeout—.int().min(1000).max(600000)llmTimeout—.int().min(1000).max(600000)maxElementsInDom—.int().min(100).max(50000)stepTimeout >= llmTimeoutplannerModel—z.any()→z.unknown()(type-safe).env.example fixes
GOOGLE_AI_API_KEY→GOOGLE_GENERATIVE_AI_API_KEY(matches what@ai-sdk/googleactually reads)BROWSER_HEADLESS,BROWSER_BINARY_PATH, etc.)OPEN_BROWSER_TIMEOUTandOPEN_BROWSER_MODELvarsTest plan
bun run build— all 3 packages compile cleanbun run test— all 364 tests pass