What problem does it solve?
In Golem, an agent is uniquely identified by its constructor parameters, so calling get with the same parameters always returns the same instance. This Skill explains how to use phantom agents in MoonBit to create multiple fully independent, durable agent instances that share identical constructor parameters, distinguished by an extra phantom UUID.
Core Features & Use Cases
- Phantom Instance Creation: Use the generated client methods new_phantom, get_phantom, and their scoped and with_config variants to create or reconnect to phantom agents.
- Phantom ID Management: Retrieve an agent's phantom UUID via the phantom_id() method and reconnect later with get_phantom, which is idempotent for the same UUID and parameters.
- HTTP-Mounted Phantom Agents: Set mount_phantom to true so every incoming HTTP request is handled by a fresh phantom instance.
- Use Case: A chat application needs a separate Counter agent per user session even though all sessions use the same name parameter; new_phantom creates an isolated instance per session while get_phantom reconnects to it later.
Quick Start
Show me how to create and reconnect to phantom agent instances in MoonBit using the generated client methods.