Skip to content

Improve process tracking for Steam/Epic games with stopProcessName configuration#31

Merged
pardeike merged 3 commits intomainfrom
copilot/fix-0fa5d938-2e28-4e80-8630-1249b462eaf3
Sep 14, 2025
Merged

Improve process tracking for Steam/Epic games with stopProcessName configuration#31
pardeike merged 3 commits intomainfrom
copilot/fix-0fa5d938-2e28-4e80-8630-1249b462eaf3

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 14, 2025

Problem

GABS previously showed "cannot track whether it's still running" messages for all Steam/Epic launcher-based games, even when sufficient information was available to actually track the game processes. This created a poor user experience and inaccurate status reporting.

The core issue was that the IsRunning() method in the process controller always returned false for Steam/Epic games, regardless of whether a stopProcessName was configured that would enable actual process tracking.

Solution

Enhanced the process tracking system to leverage available tracking information:

1. Improved IsRunning() Method

The process controller now uses stopProcessName when available to check if Steam/Epic games are actually running:

// Before: Always returned false for Steam/Epic games
if c.spec.Mode == "SteamAppId" || c.spec.Mode == "EpicAppId" {
    return false // Cannot track launcher games
}

// After: Uses stopProcessName for accurate tracking
if c.spec.Mode == "SteamAppId" || c.spec.Mode == "EpicAppId" {
    if c.spec.StopProcessName != "" {
        pids, err := findProcessesByName(c.spec.StopProcessName)
        return err == nil && len(pids) > 0 // Actually check the game process
    }
    return false // Only when truly cannot track
}

2. Enhanced Status Reporting

Status messages now accurately reflect tracking capabilities:

  • With tracking configured: "running (GABS is tracking the game process)"
  • Without tracking configured: "launched via SteamAppId (GABS cannot track the game process - no stopProcessName configured)"
  • Direct games: "running (GABS controls the process)" (unchanged)

3. Intelligent Warning Messages

The "cannot track" warning now only appears when genuinely no tracking information is available, and includes helpful configuration guidance.

Testing

Added comprehensive test coverage including:

  • Verification that games with stopProcessName show accurate status
  • Confirmation that games without stopProcessName still show appropriate warnings
  • Validation that direct games continue to work as expected
  • Integration tests demonstrating the improved user experience

Backward Compatibility

All changes are additive and backward compatible:

  • Existing configurations continue to work unchanged
  • API remains the same
  • Only improves behavior for cases that previously showed limitations

This addresses the core issue: "Since we now have guarantees that we either have a binary path or a process name, we can actually track the status" - GABS now does exactly this.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits September 14, 2025 14:15
Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
Copilot AI changed the title [WIP] You can improve the 'GABS cannot track whether it's still running' part. Since we now have guarantees that we either have a binary path or a process name, we can actually track the status. Find all occurances of similar output or behaviour and fix them. Improve process tracking for Steam/Epic games with stopProcessName configuration Sep 14, 2025
Copilot AI requested a review from pardeike September 14, 2025 14:17
@pardeike pardeike marked this pull request as ready for review September 14, 2025 14:28
@pardeike pardeike merged commit a2964b1 into main Sep 14, 2025
3 checks passed
@pardeike pardeike deleted the copilot/fix-0fa5d938-2e28-4e80-8630-1249b462eaf3 branch September 14, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants