Skip to content

fix: align env contract with platform and support isPublic/password/maxAgents#16

Merged
Jing-yilin merged 2 commits into
mainfrom
fix/platform-env-contract
Mar 25, 2026
Merged

fix: align env contract with platform and support isPublic/password/maxAgents#16
Jing-yilin merged 2 commits into
mainfrom
fix/platform-env-contract

Conversation

@Jing-yilin
Copy link
Copy Markdown
Contributor

Summary

Platform deploys inject WORLD_ID, WORLD_NAME, WORLD_PASSWORD, MAX_AGENTS, WORLD_PUBLIC, PUBLIC_ADDR, PUBLIC_PORT, GATEWAY_URL, PEER_PORT, and DATA_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 via WORLD_ID) were silently ignored.

Changes

  • src/config.ts: Platform envs checked first; added WORLD_PASSWORD, MAX_AGENTS, WORLD_PUBLIC support; added bool() parser for WORLD_PUBLIC
  • src/index.ts: isPublic now uses resolved config value instead of hardcoded true
  • src/types.ts: Added isPublic?: boolean to StarOfficeConfig
  • test/config.test.mjs: Coverage for platform env precedence and legacy fallback

Context

Deployed worlds were registering on the gateway with default slug star-office instead of the platform-assigned unique slug, because STAR_OFFICE_WORLD_ID (empty) was checked before WORLD_ID (set by platform). This caused 6 duplicate/indistinguishable zombie registrations.

Closes #13

Jing-yilin and others added 2 commits March 25, 2026 11:20
…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>
@Jing-yilin Jing-yilin merged commit 230386e into main Mar 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant