Fetching Correct Usage from WhatIs
When Vex uses a command incorrectly, GameCatalyst automatically fetches the correct usage from WhatIs and appends it to the error response. This self-healing mechanism eliminates trial-and-error loops and enables Vex to correct mistakes on the next attempt without user intervention.
How it works:
The automatic recovery process happens in milliseconds:
- Command fails with validation error — Vex calls a command with missing or incorrect parameters
- GameCatalyst identifies the command name — Extracts the command name from the failed call
- GameCatalyst queries WhatIs for command documentation — Sends HTTP request to WhatIs Discovery endpoint (http://127.0.0.1:5001/api/command/{command_name})
- WhatIs returns: parameters, types, descriptions, examples — Full command documentation in JSON format
- GameCatalyst formats this as recovery guidance — Converts JSON to human-readable text optimized for AI consumption
- Guidance is appended to the error response — Error message + recovery guidance sent to Vex
- Vex reads the guidance and corrects the call — Next attempt succeeds
Example recovery:
Vex calls: component.set target="Player" property="mass" value=2
Error: “Missing required parameter ‘component'”
Auto-appended guidance:
“component.set requires: target (string), component (string), property (string), value (any). Example: component.set target=’Player’ component=’Rigidbody’ property=’mass’ value=2”
Vex’s corrected call: component.set target="Player" component="Rigidbody" property="mass" value=2
Success. No user intervention required.
Benefits:
- Vex self-corrects without user intervention — You don’t need to explain what went wrong or how to fix it
- Reduces trial-and-error loops — Vex gets it right on the second attempt instead of the fifth
- Provides consistent, accurate guidance — Documentation comes directly from WhatIs, always up-to-date
- Works even when Vex hasn’t called what_is beforehand — Vex doesn’t need to proactively check documentation; errors trigger automatic fetching
- Saves time — Eliminates back-and-forth debugging conversations
What you’ll notice:
When Vex makes a mistake, you’ll see two messages in quick succession:
- Error message with recovery guidance
- Success message from corrected attempt
The entire error-correction cycle takes 2-5 seconds. It feels almost instantaneous.
Offline fallback:
If the WhatIs Discovery endpoint is unavailable (server down, network issue), GameCatalyst falls back to local database rules stored in gc_settings.db. Recovery guidance still works, but it may be less detailed than the live WhatIs version.
Coverage:
Automatic recovery guidance works for all 40+ GameCatalyst commands. Every command has documentation in WhatIs, so every command can provide self-healing error responses.