Skip to content

refactor: resource-oriented gateway API + symmetric agent/world lifecycle#156

Merged
Jing-yilin merged 6 commits into
mainfrom
feat/gateway-api-rename
Mar 24, 2026
Merged

refactor: resource-oriented gateway API + symmetric agent/world lifecycle#156
Jing-yilin merged 6 commits into
mainfrom
feat/gateway-api-rename

Conversation

@Jing-yilin
Copy link
Copy Markdown
Contributor

Summary

Renames all gateway HTTP endpoints to follow consistent REST conventions and adds missing CRUD endpoints for full agent/world lifecycle symmetry.

Endpoint Changes

Old New
GET /peer/ping GET /ping
GET /peer/peers (removed — redundant with GET /agents)
POST /peer/announce POST /agents
POST /peer/heartbeat POST /agents/:agentId/heartbeat
POST /peer/message POST /messages
GET /world/:worldId GET /worlds/:worldId
DELETE /world/:worldId DELETE /worlds/:worldId
(missing) GET /agents/:agentId
(missing) DELETE /agents/:agentId
(missing) POST /worlds/:worldId/heartbeat

Symmetric Lifecycle

  • Agent: POST /agents (online) → POST /agents/:agentId/heartbeatDELETE /agents/:agentId (offline)
  • World: POST /agents with world: capability (online) → POST /worlds/:worldId/heartbeatDELETE /worlds/:worldId (offline)

Commits

Atomic commits per change type: gateway core, SDK, plugin caller, tests, changeset.

Tests

tests 214  pass 214  fail 0

Jing-yilin and others added 6 commits March 24, 2026 16:12
- /peer/ping → /ping
- /peer/peers removed (redundant with GET /agents)
- /peer/announce → POST /agents (agent online/re-announce)
- /peer/heartbeat → POST /agents/:agentId/heartbeat
- /peer/message → POST /messages
- /world/:worldId → /worlds/:worldId (fix singular/plural)
- DELETE /world/:worldId → DELETE /worlds/:worldId
- Add GET /agents/:agentId, DELETE /agents/:agentId, POST /worlds/:worldId/heartbeat

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…t endpoints

- announceToGateway: /peer/announce → /agents
- sendHeartbeat: /peer/heartbeat → /agents/:agentId/heartbeat for regular agents
  and /worlds/:worldId/heartbeat for world servers (detected via capabilities)
- heartbeat body no longer includes agentId/worldId (moved to path)

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>
- gateway-world-record: /world/ → /worlds/, /peer/announce → /agents
- gateway-heartbeat: new /agents/:agentId/heartbeat and /worlds/:worldId/heartbeat tests
- gateway-worlds: update OpenAPI path assertions
- gateway-announce-default: update expected announce URL
- index-lifecycle: update /world/arena → /worlds/arena mock URL

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>
- DELETE /worlds/:worldId and DELETE /agents/:agentId now call flushRegistry()
  so deregistrations survive restarts
- web/client.js: /world/ → /worlds/ (viewWorldInfo was hitting removed route)
- docs/index.html: /world/ → /worlds/ (API docs text)

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@Jing-yilin Jing-yilin merged commit 6121b02 into main Mar 24, 2026
3 checks passed
@Jing-yilin Jing-yilin deleted the feat/gateway-api-rename branch March 24, 2026 08:26
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