Fix 9 critical code review issues: validation, error handling, and security#42
Merged
Fix 9 critical code review issues: validation, error handling, and security#42
Conversation
- Fix Issue 1: Allow empty Target for DirectPath in automated environments - Fix Issue 2: Remove reference to non-existent 'gabs games edit' command - Fix Issue 3: Propagate HTTP server startup errors properly - Fix Issue 4: Fix writer cleanup to avoid connection leaks - Fix Issue 5: Return GameConfig copy (safer than map reference) - Fix Issue 6: Add validation for negative durations and min > max in parseBackoff - Fix Issue 7: Log stop errors in Controller.Restart but continue - Fix Issue 8: Add 1MB size limit to HTTP request body reads Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
Fix Issue 9: Enhanced README documentation to make stopProcessName requirement more prominent for Steam/Epic games, emphasizing it's critical for proper game termination. Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Code review
Fix 9 critical code review issues: validation, error handling, and security
Sep 14, 2025
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.
This PR addresses 9 critical issues identified in the AI code review, implementing minimal surgical fixes to improve robustness and security without breaking existing functionality.
Issues Fixed
1. Non-interactive game validation failure
GameConfig.Validate()to allow emptyTargetforDirectPathmode in automated environmentsgabs games addto work in CI/CD pipelines and scripts2. CLI references non-existent command
gabs games editcommand in success messages3. HTTP server startup error handling
ServeHTTPto properly propagate startup errors instead of swallowing them4. Connection leak in writer cleanup
5. Memory safety in config access
GetGame()to return a safe copy instead of a pointer to map value6. Input validation for backoff parameters
parseBackoff7. Error visibility in process restart
Controller.Restart()to log stop errors while continuing with restart8. HTTP request body size limits
http.MaxBytesReader9. Documentation clarity for Steam/Epic games
stopProcessNameis required for Steam/Epic gamesTesting
Impact
These changes improve the robustness and security of GABS while maintaining full backward compatibility. The fixes are minimal and surgical, reducing regression risk while addressing real issues that could affect production deployments.
Fixes #41.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.