In production
Ask for the prompt by id and let the production channel decide the version:
Pinning a version
Pass a version to address one exactly:
Useful for reproducing a past run, or for an evaluation that has to compare versions against each other rather than follow whatever is live.
version wins when you pass both version and channel — the channel is ignored rather than rejected.
Reading history
There is no separate versions call. Ask get to include the history:
History is omitted unless you ask for it, so the common read stays small. Each entry carries version, message, and createdAt — not the content. Fetch a specific version to read its text.
Caching
Every resolve is a network call. If you resolve on a hot path, cache the result for as long as you are willing to wait for a promotion to take effect:
A cache is also a failure mode: a promoted version will not reach callers until entries expire. Keep the window short enough that a rollback still counts as fast.
Falling back
Treat a resolve like any other network call. Keeping a copy of the prompt in your code means an outage degrades quality rather than breaking the feature: