fix: align env contract with platform and support isPublic/password/maxAgents#16
Merged
Conversation
…axAgents Platform injects WORLD_ID, WORLD_NAME, WORLD_PASSWORD, MAX_AGENTS, WORLD_PUBLIC, PUBLIC_ADDR, PUBLIC_PORT, GATEWAY_URL, PEER_PORT, DATA_DIR. These now take precedence over legacy STAR_OFFICE_* aliases. - config.ts: platform envs first, add WORLD_PASSWORD/MAX_AGENTS/WORLD_PUBLIC - index.ts: honor resolved isPublic instead of hardcoding true - types.ts: add isPublic to StarOfficeConfig - test/config.test.mjs: coverage for env precedence and legacy fallback Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
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.
Summary
Platform deploys inject
WORLD_ID,WORLD_NAME,WORLD_PASSWORD,MAX_AGENTS,WORLD_PUBLIC,PUBLIC_ADDR,PUBLIC_PORT,GATEWAY_URL,PEER_PORT, andDATA_DIR.These platform-injected env vars now take precedence over the legacy
STAR_OFFICE_*aliases. Previously, the legacy aliases were checked first, which meant platform-assigned values (e.g. unique slug viaWORLD_ID) were silently ignored.Changes
src/config.ts: Platform envs checked first; addedWORLD_PASSWORD,MAX_AGENTS,WORLD_PUBLICsupport; addedbool()parser forWORLD_PUBLICsrc/index.ts:isPublicnow uses resolved config value instead of hardcodedtruesrc/types.ts: AddedisPublic?: booleantoStarOfficeConfigtest/config.test.mjs: Coverage for platform env precedence and legacy fallbackContext
Deployed worlds were registering on the gateway with default slug
star-officeinstead of the platform-assigned unique slug, becauseSTAR_OFFICE_WORLD_ID(empty) was checked beforeWORLD_ID(set by platform). This caused 6 duplicate/indistinguishable zombie registrations.Closes #13