fix: detect job attachments independent of dynamic model build order#902
Open
radu-mocanu wants to merge 1 commit into
Open
fix: detect job attachments independent of dynamic model build order#902radu-mocanu wants to merge 1 commit into
radu-mocanu wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes unreliable detection of “job attachment” fields in dynamically generated Pydantic models by removing dependence on the shared dynamic module’s last-written type object. Instead, each generated attachment class now carries a stable per-class marker used during JSONPath discovery, making detection independent of dynamic model build order.
Changes:
- Add a per-class marker (
__uipath_marker_name__) to dynamically generated BaseModel classes during schema-to-model conversion. - Update type-matching logic to prefer the per-class marker over module identity when detecting referenced types.
- Add a regression test ensuring attachment detection remains correct after building a second dynamic model.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/uipath_langchain/agent/react/jsonschema_pydantic_converter.py |
Sets a stable per-class marker on each generated dynamic BaseModel to avoid build-order-dependent identity issues. |
src/uipath_langchain/agent/react/json_utils.py |
Updates type matching to prefer the new per-class marker, keeping detection stable across multiple dynamic schema builds. |
tests/agent/react/test_json_utils.py |
Adds a regression test covering build-order independence for attachment detection. |
pyproject.toml |
Bumps project version to 0.11.17. |
uv.lock |
Updates locked package version to match 0.11.17. |
b23c600 to
9b875cb
Compare
9b875cb to
b91fe74
Compare
|
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.



Summary
Why
attachment detection compared field types by object identity against a single process-wide module attribute. each schema build registered its own attachment class under that attribute, so the most recent build won and detection on every other schema silently returned nothing.