{{ message }}
fix: make RelationResponse.from_id optional to handle null permalinks - #484
Merged
Conversation
Contributor
…inks When entities are imported from environments where permalinks were not enabled, from_entity.permalink can be None. Previously this caused Pydantic validation to fail. This fix uses a model_validator to properly resolve entity references: - Prefers permalink when available - Falls back to file_path directly (not converted to permalink format) because if the entity doesn't have a permalink, the system won't find it by a generated one anyway Fixes #483 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
phernandez
force-pushed
the
claude/issue-483-20251229-2348
branch
from
December 30, 2025 00:24
bc3b95c to
2ea78f6
Compare
Contributor
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.

Fixes #483
When entities are imported from environments where permalinks were not enabled, the
from_entity.permalinkcan be None. This caused Pydantic validation to fail because theAliasChoicesapproach would find the None value (since the path exists) rather than falling back.Changes
AliasChoiceswith amodel_validatorthat properly resolves entity referencespermalinkis available, use itpermalinkis None, fall back tofile_pathdirectlyfile_pathas-is (not converted to permalink format) because if the entity doesn't have a permalink, the system won't find it by a generated one anywayWhy file_path instead of None?
The previous approach made
from_idoptional and returnedNone. This loses useful information - the client can't identify the source entity of the relation. Using the actualfile_pathpreserves a real identifier that can be used to find the entity.🤖 Generated with Claude Code