Skip to content

fix: remove namespace filtering from create_model#662

Merged
andreitava-uip merged 1 commit intomainfrom
fix/nested-static-args-pydantic
Mar 4, 2026
Merged

fix: remove namespace filtering from create_model#662
andreitava-uip merged 1 commit intomainfrom
fix/nested-static-args-pydantic

Conversation

@andreitava-uip
Copy link
Copy Markdown
Contributor

@andreitava-uip andreitava-uip commented Mar 4, 2026

Context

Previously we were filtering the returned namespace and renaming the types. This was redundant, and if anything, the filtering and renaming actively hurt it and caused bugs in forward ref resolution when defs only referenced by other defs were involved.

Easiest way to reproduce problems is to set static args for nested fields. Because the static args flow converts the pydantic model back to json schema for parsing. This roundtrip converts previous inline objects to refs, with some refs not referenced by root.

{"Code":"AGENT_RUNTIME.UNEXPECTED_ERROR","Title":"Unexpected error: PydanticUserError","Detail":"An unexpected error occurred during agent execution, please try again later or contact your Administrator.\nError Details:\nSend_Message_to_Useris not fully defined; you should define__Dynamictype_3, then call Send_Message_to_User.model_rebuild().\n\nFor further information visit <https://errors.pydantic.dev/2.12/u/class-not-fully-defined>","Category":"Unknown","Status":null}

Fix

Simply remove the filtering logic and use the returned namespace as is.

Validation and testing

After the fix, the is not fully defined error disappears and tool static args works as intended.
Job attachment extraction logic has been validated and still works as expected (the job attachment type is correctly identified and resolved)

@andreitava-uip andreitava-uip merged commit fb5f31b into main Mar 4, 2026
39 checks passed
@andreitava-uip andreitava-uip deleted the fix/nested-static-args-pydantic branch March 4, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants