Repository navigation
fix(ai): throw when every getAll row was skipped as moved - #4961
Merged
Merged
Conversation
Contributor
Prompt To Fix All With AI### Issue 1
.changeset/prompts-get-all-all-moved-guard.md:5
**Changeset is too detailed**
This description uses multiple sentences and explains implementation details. Repository guidance requires one short, user-facing line that states the fix or feature, so this must be shortened before merging.
```suggestion
Fix `prompts.getAll` returning an empty result when the server cannot resolve the requested label.
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(ai): throw when every getAll row was..." | Re-trigger Greptile |
| '@posthog/ai': patch | ||
| --- | ||
|
|
||
| `prompts.getAll` now throws the server-compatibility error when the server returned prompts but none resolve the requested label, instead of returning an empty result. This happens on PostHog servers without label support on the prompt list endpoint when every label points at an older version. |
Contributor
There was a problem hiding this comment.
This description uses multiple sentences and explains implementation details. Repository guidance requires one short, user-facing line that states the fix or feature, so this must be shortened before merging.
Suggested change
| `prompts.getAll` now throws the server-compatibility error when the server returned prompts but none resolve the requested label, instead of returning an empty result. This happens on PostHog servers without label support on the prompt list endpoint when every label points at an older version. | |
| Fix `prompts.getAll` returning an empty result when the server cannot resolve the requested label. |
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: .changeset/prompts-get-all-all-moved-guard.md
Line: 5
Comment:
**Changeset is too detailed**
This description uses multiple sentences and explains implementation details. Repository guidance requires one short, user-facing line that states the fix or feature, so this must be shortened before merging.
```suggestion
Fix `prompts.getAll` returning an empty result when the server cannot resolve the requested label.
```
**Context Used:** AGENTS.md ([source](https://github.com/posthog/posthog-js/blob/main/AGENTS.md))
---
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!
jurajmajerik
marked this pull request as ready for review
September 14, 2026 18:19
marandaneto
reviewed
Sep 15, 2026
| resolvedRows.push(row) | ||
| } | ||
|
|
||
| if (rows.length > 0 && resolvedRows.length === 0) { |
Member
There was a problem hiding this comment.
jsdocs should mention the method throws
ideally it should not throw at all but all the other methods do that already
marandaneto
approved these changes
Sep 15, 2026
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
@posthog/ai8.11.0 withgetAll(feat(ai): add prompts.getAll to fetch all prompts at a label #4903).getAllreturns{}as a successful result. It should raise the server-compatibility error, like it does when a row lacks the label entirely.Changes
getAllthrows the compatibility error instead of returning an empty object. A single moved row among resolved ones stays a skip with a warning.8d26eb1, which already shipped in posthog 7.53.0.Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
.changeset/(written by hand, same format aspnpm changeset)🤖 Agent context
Autonomy: Human-driven (agent-assisted)