Refactor static args handling and schema editing utilities#648
Merged
ionut-mihalache-uipath merged 2 commits intofix/is-tools-static-argumentsfrom Feb 27, 2026
Merged
Conversation
1. Unify regex: reuse compiled _TEMPLATE_PATTERN (with capturing group) instead of inline re.fullmatch for template matching consistency. 2. Extract enum-stripping to schema_editing.py: add strip_matching_enums() that reuses _navigate_schema_inlining_refs, removing duplicate _resolve_schema_ref and _navigate_schema_to_field from integration_tool.py. 3. Remove integration-specific handling from static_args: delete resolve_integration_static_args() and the AgentIntegrationToolResourceConfig branch in resolve_static_args(), since integration tools now use argument_properties uniformly via StructuredToolWithArgumentProperties. https://claude.ai/code/session_01NJvRhU5bJ3GweCdNhhgidg
…c_args Covers gaps from removing resolve_integration_static_args: - Static values of different types (string, int, object) through resolve_static_args - AgentToolArgumentArgumentProperties runtime resolution from agent_input - Mixed static and argument properties resolved together - Missing argument key in agent_input is skipped - Parametrized malformed brace patterns (5 patterns) for argument template validation https://claude.ai/code/session_01NJvRhU5bJ3GweCdNhhgidg
dede931
into
fix/is-tools-static-arguments
5 checks passed
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
This PR refactors the static arguments handling and schema editing logic to improve code organization and reduce duplication. The main changes involve removing integration-specific static args resolution logic and consolidating schema navigation utilities.
Key Changes
Removed
resolve_integration_static_argsfunction: The integration-specific parameter resolution logic has been removed fromstatic_args.py. This functionality is now handled through the unifiedresolve_static_argsfunction which works with any resource that hasargument_properties.Simplified
resolve_static_args: Updated to work with any resource type that hasargument_propertiesattribute, removing the special case handling forAgentIntegrationToolResourceConfig.Extracted schema navigation to
schema_editing.py: Moved_resolve_schema_refand_navigate_schema_to_fieldfunctions fromintegration_tool.pytoschema_editing.pyand renamed to_navigate_schema_inlining_refsfor better clarity and reusability.Added
strip_matching_enumsutility: Created a new public function inschema_editing.pythat encapsulates the logic for removing enum values matching a regex pattern. This replaces the inline enum-stripping logic previously instrip_template_enums_from_schema.Updated
integration_tool.py:_TEMPLATE_PATTERN.match()instead offullmatch()strip_template_enums_from_schemato use the newstrip_matching_enumsutilityintegration_tool_wrapperto passtoolinstead ofresourcetohandle_static_argsCleaned up test suite: Removed extensive test cases for
resolve_integration_static_argsand integration-specific fixtures, replacing them with simpler tests for the unifiedresolve_static_argsfunction.Implementation Details
resolve_static_argscontinues to work with resources that haveargument_properties$refresolution inline, making the logic more robusthttps://claude.ai/code/session_01NJvRhU5bJ3GweCdNhhgidg