fix(agent-bff): derive a primary key when the schema declares none - #1895
Merged
Tonours merged 10 commits intoSep 14, 2026
Conversation
4 tasks
Tonours
force-pushed
the
fix/agent-bff-4xx-body-leak
branch
from
September 10, 2026 17:04
a3c826a to
77f255d
Compare
Tonours
force-pushed
the
fix/agent-bff-derive-primary-key
branch
from
September 10, 2026 17:04
3be7bf2 to
990d725
Compare
Tonours
force-pushed
the
fix/agent-bff-derive-primary-key
branch
from
September 10, 2026 18:37
990d725 to
64e7bf7
Compare
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F6Q1hDksLxX4pCp6Rw2PrB
nbouliol
reviewed
Sep 11, 2026
nbouliol
left a comment
Member
There was a problem hiding this comment.
Spec (no ticket): no Linear ticket is linked to this PR, so the functional check was limited to the PR description, which the diff matches.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F6Q1hDksLxX4pCp6Rw2PrB
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F6Q1hDksLxX4pCp6Rw2PrB
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F6Q1hDksLxX4pCp6Rw2PrB
2 new issues
|
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F6Q1hDksLxX4pCp6Rw2PrB
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F6Q1hDksLxX4pCp6Rw2PrB
nbouliol
reviewed
Sep 11, 2026
nbouliol
left a comment
Member
There was a problem hiding this comment.
Spec (no ticket): no Linear ticket is linked to this PR, so the functional check was limited to the PR description, which the diff matches.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MrKu79CMvSVAtDj7v1YyGi
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MrKu79CMvSVAtDj7v1YyGi
nbouliol
approved these changes
Sep 14, 2026
nbouliol
left a comment
Member
There was a problem hiding this comment.
Approving on the review side: the seven findings from the validator run at 59ef8a1a are all closed and verified at 3797d1ee, each with the property that closes its class and a regression pinned where a test applies.
Two things this approval does not clear:
- #1894 is still open, and this PR is based on its branch, so it cannot merge first.
LLM Integration Tests (ai-proxy)is red. Unrelated to this diff, but it is red.
This was referenced Sep 14, 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.

Stacked on #1894, which merges first. Review only the last commit; the parent's diff belongs to that PR.
What
A collection whose schema declares no primary key gets one derived from its
idfield.Why
forest_lianapublishesisPrimaryKeyonly from 9.17.6 (2026-06-04). Below that line every collection is keyless, sounpackPrimaryKeyrejects every record the agent returns and a plain list answers500 mapping_error. Of the 125forest-railsenvironments active in the last 120 days, the twenty oldest run between 2.14.6 and 8.3.2, several of them production.How
buildPrimaryKeysfalls back to a field literally namedid, typed as the schema declares it,Stringwhen no such field exists. Keyed on the shape of the schema rather than the liana version: a collection that declares a key keeps it, and every v2 agent declares one, so this only fires where the alternative is a 500.How to test
yarn workspace @forestadmin/agent-bff test. Three unit tests cover the declared-key, derived-key and no-id-field cases.Definition of Done
General
Security