Conversation
…ntation Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
bridge.json in your game's working directory." Is that correct? If not, please unify the location of the bridge file. I prefer it to have its root in ...|
@copilot This looks better. But I want you to check if passing information to the mod satisfies the following conditions:
|
Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
I've analyzed both concurrency safety and practicability concerns and implemented a hybrid solution that addresses all issues. Analysis Results:Concurrency Safety: ❌ Issues Found → ✅ Fixed
Practicability: ✅ Environment variables work reliably
Bridge Content vs Path Analysis:Hybrid Approach Implemented (Best of Both Worlds): # New environment variables set by GABS:
GABS_GAME_ID=minecraft
GABS_HOST=127.0.0.1
GABS_PORT=12345
GABS_TOKEN=secret-auth-token
GABS_MODE=local
GABS_BRIDGE_PATH=/home/user/.gabs/minecraft/bridge-1234567890.json # fallbackAdvantages of Hybrid:
Updated examples now prioritize environment variables with file fallback. This approach is more reliable than passing full JSON content (which would hit env var size limits and escaping complexity) while being more practical than file-only approach. |
|
@copilot Wait, it was my understanding that the mod acts as a GABP server and that the GABS MCP server acts as a GABP client towards the mod. The mod should only be able to read the bridge config file, start its server and then wait for the GABS server to connect to it. This means that the bridge configuration is weird (see my comments on each item) GABS_GAME_ID=minecraft # yes, need to find the bridge file Make this coherent in its design, also update all documentation and instructions to reflect that. Also put the overall concept of who is client and who is server and the constraints in a prominent place for future AI tasks so they don't get confused while our design becomes a bit more challenging. |
Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
You're absolutely right about the client-server confusion! I've fixed the architecture and environment variables to be coherent with the actual GABP roles. Fixed Environment Variables (commit 0966901):
Architecture Clarification Added:
The design is now coherent: GABS assigns unique ports and passes |
Problem
The Mod Development Guide incorrectly stated that GABS creates
bridge.jsonin the "game's working directory", but the actual implementation stores it in~/.gabs/{gameId}/bridge.json. Additionally, the environment variables and documentation had a fundamental client-server architecture confusion that needed correction.The issues included:
gameIdSolution
This PR fixes the GABP client-server architecture and implements a corrected environment variable approach:
1. Corrected GABP Client-Server Architecture
Critical Architecture Clarification:
This architecture exists because:
2. Fixed Environment Variables
GABS now passes the correct environment variables that reflect GABP server configuration for mods:
Removed unnecessary variables:
GABS_HOST- Always localhost for GABPGABS_MODE- Not relevant for local GABP connections3. Concurrency Safety Improvements
bridge-<timestamp>.json) to prevent concurrent access conflicts4. Updated Documentation and Examples
Added prominent architecture documentation to
AGENTS.mdto prevent future AI confusion about client-server roles.All code examples in
MOD_DEVELOPMENT.mdnow reflect the correct architecture:C# Example:
5. Backwards Compatibility
All examples include fallback mechanisms to support existing mods during the transition period, including legacy path discovery.
6. Security Benefits
Bridge files remain securely stored in
~/.gabs/{gameId}/bridge.json, avoiding all security concerns:Testing
GABP_SERVER_PORT,GABP_TOKEN)This change maintains full backwards compatibility while providing a coherent, secure, and concurrent-safe approach. The corrected client-server architecture and environment variables now accurately reflect the GABP protocol design where mods act as servers and GABS acts as a client.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.