fix: add radix parameter to parseInt() calls (#862)
Add explicit radix=10 to parseInt() calls and NaN validation to prevent unexpected hex parsing and invalid config values. Changes: - Line 52: Add radix and NaN check in input validation - Line 189-192: Add radix and NaN fallback for config parsing Fixes potential issues: - Hex input (0x10) now rejected instead of parsed as 16 - Invalid strings return default value instead of NaN→null 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Brian <bmadcode@gmail.com>
This commit is contained in:
parent
9223e2be21
commit
f793cf8fcd
|
|
@ -50,7 +50,8 @@ class GitHubCopilotSetup extends BaseIdeSetup {
|
|||
message: 'Maximum requests per session (1-50)?',
|
||||
default: '15',
|
||||
validate: (input) => {
|
||||
const num = parseInt(input);
|
||||
const num = parseInt(input, 10);
|
||||
if (isNaN(num)) return 'Enter a valid number 1-50';
|
||||
return (num >= 1 && num <= 50) || 'Enter 1-50';
|
||||
},
|
||||
},
|
||||
|
|
@ -187,9 +188,10 @@ class GitHubCopilotSetup extends BaseIdeSetup {
|
|||
// Manual configuration - use pre-collected settings
|
||||
const manual = options.manualSettings || {};
|
||||
|
||||
const maxRequests = parseInt(manual.maxRequests || '15', 10);
|
||||
bmadSettings = {
|
||||
'chat.agent.enabled': true,
|
||||
'chat.agent.maxRequests': parseInt(manual.maxRequests || 15),
|
||||
'chat.agent.maxRequests': isNaN(maxRequests) ? 15 : maxRequests,
|
||||
'github.copilot.chat.agent.runTasks': manual.runTasks === undefined ? true : manual.runTasks,
|
||||
'chat.mcp.discovery.enabled': manual.mcpDiscovery === undefined ? true : manual.mcpDiscovery,
|
||||
'github.copilot.chat.agent.autoFix': manual.autoFix === undefined ? true : manual.autoFix,
|
||||
|
|
|
|||
Loading…
Reference in New Issue