You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow Prompts.get_all() without a label, to batch-fetch the latest version of every prompt #959
Prompts.get_all() requires a label. An app that wants the current version of every prompt has no batch entry point, so it falls back to one get() per prompt.
That is the common shape for teams that do not use labels at all, and it is the shape get_all was added to remove. Each prompt costs one request against the prompt fetch rate limits, and the requests are made on every cache cycle.
The server side already supports it. GET /api/environments/@current/llm_prompts/ returns the latest version of every prompt when label is omitted, and PostHog/posthog#100690 makes that path report $llm_prompt_fetched the same way the labeled path does.
Without label, every prompt comes back at its latest version, cached under the same key get(name) reads, so a later get(name) is a cache hit within the TTL.
With label, behavior is unchanged.
The change is additive, so existing get_all(label=...) callers are unaffected. It does touch references/public_api_snapshot.txt.
The label-compatibility guards in get_all (the absent and "no row resolved the label" errors) only apply when a label was requested. They exist to catch an older server that ignores the label parameter, and the unlabeled list has always returned latest versions, so the unlabeled path skips them.
A working patch along these lines passes the existing posthog/test/ai/test_prompts.py suite unchanged. Happy to open a PR once a maintainer agrees on the shape, per the "Public API changes" rule in CONTRIBUTING.md.
Filed by a PostHog agent, from an inbox report about prompt-management callers hitting the per-prompt rate limits.
Activity
fix(ai): let Prompts.get_all() batch without a label
ioannisj commentedon Sep 18, 2026
Fixed by #966, released in v7.55.0