feat(ai): support unlabeled batch fetch in prompts getAll - #5000
Merged
Merged
Conversation
5 tasks
Contributor
Prompt To Fix All With AI### Issue 1
packages/ai/src/prompts.ts:106-109
**Misplaced label-state documentation**
The new helper separates `rowLabelState` from the documentation that describes it, making that documentation appear to describe `promptListReference` instead. Move the helper above the label-state documentation, or move the documentation directly above `rowLabelState`, so future changes do not misread the helper's behavior.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(ai): support unlabeled batch fetch ..." | Re-trigger Greptile |
Comment on lines
+106
to
+109
| /** Formats a batch-fetch reference for logs and errors. */ | ||
| function promptListReference(label: string | undefined): string { | ||
| return label === undefined ? 'all prompts' : `prompts with label "${label}"` | ||
| } |
Contributor
There was a problem hiding this comment.
Misplaced label-state documentation
The new helper separates rowLabelState from the documentation that describes it, making that documentation appear to describe promptListReference instead. Move the helper above the label-state documentation, or move the documentation directly above rowLabelState, so future changes do not misread the helper's behavior.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/ai/src/prompts.ts
Line: 106-109
Comment:
**Misplaced label-state documentation**
The new helper separates `rowLabelState` from the documentation that describes it, making that documentation appear to describe `promptListReference` instead. Move the helper above the label-state documentation, or move the documentation directly above `rowLabelState`, so future changes do not misread the helper's behavior.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
marandaneto
approved these changes
Sep 17, 2026
marandaneto
left a comment
Member
There was a problem hiding this comment.
The code looks good; no qualifying findings. Verdict: correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
prompts.getAll()requires a label, so there is no way to batch-fetch the latest version of every prompt. The server treats any label value as a filter, so no value a caller could pass produces the unlabeled listing that plainget(name)resolves to. Requested by a customer; mirrors PostHog/posthog-python#966.Changes
labelongetAllis now optional. Without it, the request omits thelabelparam and returns the latest version of every prompt, matching plainget(name).undefinedcache key that plainget(name)reads, so those calls become cache hits.Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
.changeset/prompts-get-all-unlabeled.md, minor)🤖 Agent context
Autonomy: Human-driven (agent-assisted)
getAll()block: an unlabeled fetch must omit thelabelparam from the URL, accept rows without labels, and seed the unlabeledget()cache. All 69 prompt tests pass;check-types, oxlint and oxfmt clean.