@@ -72,21 +72,23 @@ Most users can skip this section.
7272
7373GABS uses local-only GABP communication for security and simplicity.
7474
75- When you start a game, GABS passes bridge configuration to the game-side bridge through:
75+ When you start a game, GABS passes GABP connection data to the game-side bridge through:
7676
77771 . Environment variables: ` GABP_SERVER_PORT ` , ` GABP_TOKEN ` , ` GABS_GAME_ID `
78- 2 . A bridge file fallback: ` ~/.gabs/{gameId}/bridge.json `
7978
80- The environment variables are authoritative when present. ` bridge.json ` is a
81- fallback/debug artifact for reconnects and diagnostics; game-side bridge code
82- should not let a stale bridge file override fresh ` GABP_* ` environment values.
79+ The ` bridge.json ` file is GABS' endpoint cache/debug artifact. Game-side bridge
80+ code should not read it as runtime configuration or use it as a fallback for
81+ missing ` GABP_* ` environment values.
8382
8483In the GABP layer, your game-side bridge listens for the connection and GABS connects
8584to it.
8685
8786GABS also keeps an internal ownership record at ` ~/.gabs/{gameId}/runtime.json `
88- so separate GABS sessions do not accidentally launch or attach to the same game
89- at the same time. Game integrations should ignore ` runtime.json ` ; it is for GABS itself.
87+ so separate GABS sessions do not accidentally launch or drive the same game at
88+ the same time. Ownership is an expiring active-use lease, so you can hop
89+ between live AI sessions by using ` games_connect ` after the previous session
90+ goes idle. Game integrations should ignore ` runtime.json ` ; it is for GABS
91+ itself.
9092
9193## Managing Your Games
9294
@@ -184,9 +186,8 @@ not passed to the game in this mode. Put launch options such as
184186
185187In launcher-driven setups, an already-running platform launcher process can
186188prevent GABS from proving that new environment variables reached the real game
187- process. ` games_status ` reports this as bridge-state diagnostics, including
188- stale launcher environment when the process ` GABP_* ` values disagree with
189- ` bridge.json ` . For deterministic env and argument control, use ` DirectPath ` or
189+ process. ` games_status ` reports whether the real game process environment is
190+ readable. For deterministic env and argument control, use ` DirectPath ` or
190191` CustomCommand ` .
191192
192193### EpicAppId
@@ -223,35 +224,40 @@ GABS uses local-only GABP communication.
223224### Local Communication (Current Implementation)
224225- GABS connects to game integrations on localhost (` 127.0.0.1 ` ) only
225226- Each game gets a unique port and token
226- - Bridge configuration is also written to ` ~/.gabs/{gameId}/bridge.json `
227+ - GABS may write ` ~/.gabs/{gameId}/bridge.json ` as an endpoint cache/debug artifact
227228
228229### Bridge Configuration
229- When you start a game, GABS creates a bridge configuration file that looks like this:
230+ When you start a game, GABS sends GABP configuration through environment
231+ variables:
230232
231- ``` json
232- {
233- "port" : 49234 ,
234- "token" : " a1b2c3d4e5f6..." ,
235- "gameId" : " factory"
236- }
237- ```
233+ - ` GABP_SERVER_PORT `
234+ - ` GABP_TOKEN `
235+ - ` GABS_GAME_ID `
238236
239- Game integrations can read this file, but environment variables remain the preferred source .
237+ Game integrations should read these environment variables directly .
240238
241239## Shared Runtime Ownership
242240
243241When a game is already starting or running, GABS writes a per-game
244- ` runtime.json ` file so other live GABS sessions can see that the game already
245- has an owner.
242+ ` runtime.json ` file so other live GABS sessions can see whether the game
243+ currently has an active owner.
246244
247245- A second ` games.start ` returns immediately with "already starting" or
248246 "already running" instead of launching a second copy
249- - A second ` games.connect ` also returns immediately instead of waiting for a
250- competing bridge connection
251- - ` games.status ` can report that another GABS session owns the process
247+ - ` games.connect ` takes ownership naturally once the previous owner's lease is
248+ idle
249+ - ` games.connect ` returns immediately with an active-owner result when another
250+ session is still inside its lease
251+ - game-bound tool calls also check the lease before touching the bridge
252+ - ` games.status ` reports the runtime owner, lease expiry, and bridge diagnostics
252253
253- If you intentionally want a different GABS session to take over a running game,
254- use ` games.connect ` with ` forceTakeover: true ` .
254+ If you intentionally want a different GABS session to take over before the
255+ active lease expires, use ` games.connect ` with ` forceTakeover: true ` .
256+
257+ If ` games.start ` reports ` endpoint_cache_in_use ` , the cached port is already
258+ listening. Use ` games.connect ` if an already-running bridge owns that endpoint.
259+ Use ` games.start ` with ` resetEndpoint: true ` only after confirming the cached
260+ endpoint should be rotated for a new process.
255261
256262## Tool Normalization Configuration
257263
@@ -325,25 +331,36 @@ tool metadata, including output schema information, remains available through
325331## Startup Timeout Configuration
326332
327333If your game takes longer to appear in the process list or longer for its GABP
328- game-side bridge to start listening, you can override the startup waits in
329- ` ~/.gabs/config.json ` .
334+ game-side bridge to start listening, you can override the startup process wait
335+ and connection budget in ` ~/.gabs/config.json ` .
330336
331337### Startup Timeout Options
332338
333339The ` timeouts.startup ` section supports these options:
334340
335341- ** ` processStartSeconds ` ** (integer): How long GABS waits for the launched game
336342 process to become detectable in the OS process list (default: ` 10 ` )
337- - ** ` gabpConnectSeconds ` ** (integer): How long ` games.start ` waits for the
338- game's GABP server to become available before returning control to you
339- (default: ` 60 ` ). You can also pass a one-off ` timeout ` argument to
340- ` games_start ` for unusually slow bridge startup without changing the
341- saved configuration.
342-
343- ` games_start ` only waits for the GABP handshake. Mirroring the connected bridge's
344- full tool list can continue briefly in the background. The public ` tools/list `
345- response stays stable, and known startup commands can be sent immediately
346- through ` games_call_tool ` while discovery tools refresh.
343+ - ** ` gabpConnectSeconds ` ** (integer): The total connection budget for the game
344+ GABP server to become available (default: ` 60 ` ). ` games_start ` waits only for
345+ a bounded initial slice of that budget, returns before MCP clients hit their
346+ own tool-call timeout, and continues connecting in the background. You can
347+ also pass a one-off ` timeout ` argument to ` games_start ` for unusually slow
348+ bridge startup without changing the saved configuration.
349+
350+ The ` timeouts.session ` section supports:
351+
352+ - ** ` ownerLeaseSeconds ` ** (integer): How long an idle GABS session remains the
353+ active runtime owner after a normal game-bound action (default: ` 30 ` ). Long
354+ game-bound calls extend the lease to cover their requested timeout plus a
355+ small safety margin, so this value controls roaming between idle sessions,
356+ not the maximum duration of a running command.
357+
358+ ` games_start ` only waits for an initial GABP handshake window. If the game is
359+ still loading, GABS keeps trying in the background for the remaining startup
360+ budget. Mirroring the connected bridge's full tool list can continue briefly in
361+ the background. The public ` tools/list ` response stays stable, and known startup
362+ commands can be sent immediately through ` games_call_tool ` while discovery tools
363+ refresh.
347364
348365### Example Configuration
349366
@@ -354,6 +371,9 @@ through `games_call_tool` while discovery tools refresh.
354371 "startup" : {
355372 "processStartSeconds" : 20 ,
356373 "gabpConnectSeconds" : 120
374+ },
375+ "session" : {
376+ "ownerLeaseSeconds" : 30
357377 }
358378 },
359379 "games" : {
@@ -426,10 +446,10 @@ mandatory.
4264461 . Make sure your game-side bridge supports GABP
4274472 . Check that the game-side bridge is listening on the right port
4284483 . Verify the game-side bridge is using ` GABP_SERVER_PORT ` , ` GABP_TOKEN ` , and ` GABS_GAME_ID `
429- from the environment or ` bridge.json `
449+ from the environment
4304504 . Run ` games_status ` and inspect ` diagnostics.code ` , ` diagnostics.message ` ,
431- and ` nextActions ` ; it can identify stale runtime state, stale bridge files ,
432- passively detected orphan listeners, and launcher environment mismatches .
451+ and ` nextActions ` ; it can identify stale runtime state, runtime ownership ,
452+ and whether the real game process environment is readable .
433453
434454### "Configuration not found"
435455The config file is created automatically when you add your first game. If it's missing, run ` gabs games add ` to create a new one.
0 commit comments