Skip to content

Fix game command coherence - accept both game ID and launch target#7

Merged
pardeike merged 3 commits intomainfrom
copilot/fix-2897d0ca-88d6-43ea-8504-7db94024e5d9
Sep 13, 2025
Merged

Fix game command coherence - accept both game ID and launch target#7
pardeike merged 3 commits intomainfrom
copilot/fix-2897d0ca-88d6-43ea-8504-7db94024e5d9

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 13, 2025

Fixes an issue where AI agents would get confused by games.list output and fail when trying to start games using Steam App IDs or other launch targets.

Problem

When AI agents call games.list, they see output like:

• **rimworld** (RimWorld) - stopped
  Launch: SteamAppId via 294100

The AI would then try games.start {"gameId": "294100"} using the prominent Steam App ID, which would fail with "Game '294100' not found". This created a poor user experience where the commands appeared incoherent - what you see in games.list doesn't work in games.start.

Solution

Made the game management commands more forgiving and the output clearer:

1. Forgiving Input Resolution

Added resolveGameId() helper that accepts both:

  • Game ID: "rimworld" (configured ID)
  • Launch target: "294100" (Steam App ID), "/path/to/game" (direct path), etc.

All game commands now use this resolution: games.start, games.stop, games.kill, games.status

2. Clearer Output Format

games.list now shows:

• **rimworld** - RimWorld (stopped)
  Use gameId: 'rimworld' (or target: '294100')
  Launch: SteamAppId

This makes it clear which identifiers can be used in commands.

3. Better Error Messages

Instead of "Game '294100' not found", now shows:
"Game '294100' not found. Use games.list to see available games."

Results

Before:

  • games.start {"gameId": "294100"} → ❌ "Game '294100' not found"
  • AI confusion due to inconsistent interface

After:

  • games.start {"gameId": "294100"} → ✅ "Game 'rimworld' (RimWorld) started successfully"
  • games.start {"gameId": "rimworld"} → ✅ Still works as before
  • Clear, coherent interface that works as AI agents expect

Testing

Added comprehensive tests covering:

  • Direct game ID resolution ("rimworld")
  • Steam App ID resolution ("294100")
  • Direct path resolution ("/opt/minecraft/start.sh")
  • Invalid ID handling with helpful errors
  • Backward compatibility verification

All existing functionality is preserved while fixing the coherence issue.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits September 13, 2025 19:02
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] when starting a game, my test showed that at least one AI first listed the games with games.list and then tried games.start with { "gameId": "294100" } which of course failed. Can you redesign the build-in commands so they are more coherent in what th... Fix game command coherence - accept both game ID and launch target Sep 13, 2025
Copilot AI requested a review from pardeike September 13, 2025 19:08
@pardeike pardeike marked this pull request as ready for review September 13, 2025 19:09
@pardeike pardeike merged commit 7281e2a into main Sep 13, 2025
1 check passed
@pardeike pardeike deleted the copilot/fix-2897d0ca-88d6-43ea-8504-7db94024e5d9 branch September 13, 2025 19:10
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