fix: add radix parameter to parseInt() calls
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>
This commit is contained in:
parent
c283344a54
commit
63894c9891
|
|
@ -49,7 +49,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';
|
||||
},
|
||||
},
|
||||
|
|
@ -185,9 +186,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