Skip to content

Conversation

@dgarros
Copy link
Collaborator

@dgarros dgarros commented Jan 3, 2026

Fixes #8014

Add unit test that reproduces the KeyError bug when a schema defines
a relationship with `inherited: true` but the relationship doesn't
exist in any generic that the node inherits from.

The bug occurs in _generate_weight_nodes_profiles when it assumes
that any field with inherited=True will be found in generic_fields_map.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 3, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Jan 3, 2026
@dgarros dgarros force-pushed the claude/investigate-issue-8014-TE3qF branch 3 times, most recently from a68bcc4 to 90ae67f Compare January 3, 2026 12:11
The `inherited` field on attributes and relationships is an internal
property that should only be set by the system during schema processing.
When users explicitly set `inherited: true` in their schema definitions,
it would cause a KeyError later during weight generation because the
field wasn't found in the generic fields map.

This fix adds Pydantic field validators to AttributeSchema and
RelationshipSchema that reject any schema with `inherited=True`,
providing a clear error message that explains this is an internal
property.

Fixes #8014
@dgarros dgarros force-pushed the claude/investigate-issue-8014-TE3qF branch from 90ae67f to d040324 Compare January 3, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group/backend Issue related to the backend (API Server, Git Agent)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Traceback when loading a fresh schema

3 participants