Skip to content

Refactor static args handling and schema editing utilities#648

Merged
ionut-mihalache-uipath merged 2 commits intofix/is-tools-static-argumentsfrom
claude/address-pr-comments-N50ve
Feb 27, 2026
Merged

Refactor static args handling and schema editing utilities#648
ionut-mihalache-uipath merged 2 commits intofix/is-tools-static-argumentsfrom
claude/address-pr-comments-N50ve

Conversation

@ionut-mihalache-uipath
Copy link
Contributor

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_args function: The integration-specific parameter resolution logic has been removed from static_args.py. This functionality is now handled through the unified resolve_static_args function which works with any resource that has argument_properties.

  • Simplified resolve_static_args: Updated to work with any resource type that has argument_properties attribute, removing the special case handling for AgentIntegrationToolResourceConfig.

  • Extracted schema navigation to schema_editing.py: Moved _resolve_schema_ref and _navigate_schema_to_field functions from integration_tool.py to schema_editing.py and renamed to _navigate_schema_inlining_refs for better clarity and reusability.

  • Added strip_matching_enums utility: Created a new public function in schema_editing.py that encapsulates the logic for removing enum values matching a regex pattern. This replaces the inline enum-stripping logic previously in strip_template_enums_from_schema.

  • Updated integration_tool.py:

    • Fixed regex pattern matching to use _TEMPLATE_PATTERN.match() instead of fullmatch()
    • Updated strip_template_enums_from_schema to use the new strip_matching_enums utility
    • Changed integration_tool_wrapper to pass tool instead of resource to handle_static_args
  • Cleaned up test suite: Removed extensive test cases for resolve_integration_static_args and integration-specific fixtures, replacing them with simpler tests for the unified resolve_static_args function.

Implementation Details

  • The refactoring maintains backward compatibility by ensuring resolve_static_args continues to work with resources that have argument_properties
  • Schema navigation now properly handles $ref resolution inline, making the logic more robust
  • The regex pattern for template matching is now consistently applied across the codebase

https://claude.ai/code/session_01NJvRhU5bJ3GweCdNhhgidg

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
@ionut-mihalache-uipath ionut-mihalache-uipath marked this pull request as draft February 27, 2026 15:50
…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
@ionut-mihalache-uipath ionut-mihalache-uipath marked this pull request as ready for review February 27, 2026 16:30
@ionut-mihalache-uipath ionut-mihalache-uipath merged commit dede931 into fix/is-tools-static-arguments Feb 27, 2026
5 checks passed
@ionut-mihalache-uipath ionut-mihalache-uipath deleted the claude/address-pr-comments-N50ve branch February 27, 2026 16:31
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