DashboardCodestartServer() returns plain object, not…

startServer() returns plain object, not Promise — use startGateway() for programmatic async use

Category: gotcha
Confidence: 1.00
ID: 019e49d5-15c4-78d1-8bbc-f43fde34d9f1
Project ID: ffa98226-3908-4f0c-936b-969018c62abf
Cross-project: No
Recalled in other projects: 2
Source session: (none)
Created: 2026-06-11 21:49:18
Updated: 2026-06-12 00:15:06

Cross-Project Recalls

ProjectHitsLast recalled
opencode 3 8d ago
opencode-lore 9 23d ago

Content

Gateway startup traps: (1) startServer() returns { stop, port, hosts } synchronously — use startGateway() from cli/start.ts for Promise<GatewayHandle>. (2) loadConfig() in config.ts is SYNC — calling .then() throws TypeError. (3) EADDRINUSE fires as async 'error' event — wrap server.listen() in a Promise. (4) Use port 0 (ephemeral) in tests. (5) In-process callers MUST pass local:true — hosted mode disables FS ops in @loreai/core (breaks getGitRemote(), .lore.md import, config loading). (6) lore run and lore import always set opts.local=true.

Move to: