Repository navigation
feat: DisallowAgents also ignores COLLIDER_RECORD - #16
Merged
Merged
Conversation
A shipped game calls DisallowAgents to stop outside programs taking control, yet COLLIDER_RECORD still made Run write a GIF to any path the environment named; games had to unset it before Run. Recording belongs to the same outside-control surface as COLLIDER_AGENT (it is how agents record their demos), so the same call now locks both. No new API: a second switch would be one more thing every shipped game must remember, and a game that wants demos keeps recording by calling DisallowAgents only in release builds. Run reads the path through recordPath, which returns "" for a game that disallowed agents. Documented on DisallowAgents and Run, in the README cheat sheet, agent and recording sections, and AGENTS.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
g.DisallowAgents()now also makes the game ignoreCOLLIDER_RECORD. Before, a shipped game that locked agents out still wrote a GIF to whatever pathCOLLIDER_RECORDnamed, and games had to unset the variable beforeRun.Design
COLLIDER_RECORDis part of the same outside-control surface asCOLLIDER_AGENT(it is how an agent records its own demo, per AGENTS.md), and "lock the shipped build" is one decision. A separate call would be another switch every shipped game must remember. A game that still wants demo GIFs callsDisallowAgentsonly in release builds (a build tag), which is what shipping games already do.Runreads the path through a smallrecordPath()helper:""when agents are disallowed, else the env var.DisallowAgentsandRundoc comments, README cheat-sheet row, the agents section, the "Record a GIF" section, AGENTS.md.Proof
TestDisallowAgentsIgnoresRecording: withCOLLIDER_RECORD=demo.gif, a normal game records to it, the same game afterDisallowAgentsrecords nothing.go test ./..., wasm vet/build.