[codex] Make realtime delivery node-only

Merged
WI
5mo ago
+23022-2380

Summary

  • make node-scoped delivery unconditional: agents use REST tokens for HTTP APIs and receive realtime only through bound nodes
  • keep workspace /v1/ws observer-only while agent SDKs mint direct node tokens and connect to /v1/node/ws
  • collapse direct/broker WebSocket delivery onto ws.node.v1, with kind as transport and role as ownership/capacity semantics
  • route spawn/release and handler-agent actions as node action.invoke frames; deliver action completion/denial, reactions, and receipts as node deliver frames
  • update OpenAPI, README, MCP tools, and TypeScript/Python/Rust/Swift SDK surfaces and tests for the new node-first contract

Why

Direct agent sockets and broker node sockets were separate delivery paths even though they should share the same node delivery contract. That split caused double-delivery risks, missing node context, and action lifecycle gaps once nodes became first-class. This PR makes every agent have exactly one node route, makes the workspace stream an observer capability, and keeps SDK ergonomics by normalizing node frames into the existing app callbacks.

Validation

  • npx turbo build && npx turbo test && npx turbo lint
  • cargo test --manifest-path packages/sdk-rust/Cargo.toml
  • swift test --package-path packages/sdk-swift
  • npm --workspace @relaycast/engine test -- invocationCompletion.test.ts sdk-contract.test.ts node.test.ts
  • npm --workspace @relaycast/types test -- fleet-wire-fixtures.test.ts sdk-openapi-sync.test.ts
  • python3 -m pytest packages/sdk-python/tests/test_ws.py could not run locally because this environment does not have pytest installed (No module named pytest)