Pi SDK is ESM-only. tsx (esbuild) doesn't emit decorator metadata, so NestJS constructor injection fails without explicit @Inject(). - Set "type": "module" in gateway package.json - Switch tsconfig to NodeNext module resolution - Add @Inject(AgentService) to ChatController and ChatGateway Tested end-to-end: REST /api/chat → Pi SDK → Anthropic → response OK. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>