Skip to content

fix: don't let the multipart body envelope param shadow real body fields - #1066

Merged
andreitava-uip merged 1 commit into
mainfrom
fix/integration-tool-multipart-body-envelope-collision
Sep 4, 2026
Merged

fix: don't let the multipart body envelope param shadow real body fields#1066
andreitava-uip merged 1 commit into
mainfrom
fix/integration-tool-multipart-body-envelope-collision

Conversation

@andreitava-uip

Copy link
Copy Markdown
Contributor

Summary

  • For IS activities using a multipart body (bodyStructure.contentType: "multipart"), the raw connector parameter list includes an envelope-marker parameter whose name equals jsonBodySection (e.g. body, fieldLocation: "multipart"). This is IS's own convention for "wrap the JSON entity in one multipart part named X" — not real data.
  • When an activity's entity schema also nests real fields under that same top-level name (e.g. Teams' chatMessage.bodybody.content, body.adaptiveCardContent, fieldLocation: "body"), both got classified under the identical key in convert_to_activity_metadata. Since multipart_params was checked before body_fields, the real value was misrouted there and silently dropped by the existing "don't duplicate the envelope part" guard in uipath-platform's _build_activity_request_spec.
  • Reproduced live against the Microsoft Teams "Send Individual Chat Message" IS tool: the LLM-supplied message body was silently missing from the outgoing request.
  • Fix: skip the envelope-marker parameter by identity (name matches jsonBodySection and its own fieldLocation is multipart/file) so it never competes with the real body-field grouping derived from its children.

Test plan

  • Added test_multipart_envelope_marker_does_not_shadow_nested_body_field — confirmed it fails without the fix and passes with it
  • uv run pytest tests/agent/tools/test_integration_tool.py — 69 passed
  • uv run pytest (full suite, all extras) — 2799 passed, 3 skipped (unrelated, uip CLI not on PATH)
  • ruff check / ruff format --check / mypy clean on changed files
  • Verified live end-to-end against a real UiPath tenant's Teams connector: the message body now reaches the actual HTTP request and a real Teams message is sent successfully

Copilot AI lite review requested due to automatic review settings September 4, 2026 07:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is narrowly scoped, matches the described root cause, and is covered by a focused regression test that exercises the reported failure mode.

Pull request overview

Fixes a subtle parameter-classification bug in the Integration Service tool metadata mapping for multipart activities, preventing IS’s multipart JSON-envelope marker parameter (e.g. name == jsonBodySection) from shadowing real entity fields that share the same top-level name (e.g. body.content).

Changes:

  • Compute content_type and json_body_section early and skip the multipart/file envelope-marker parameter during location mapping in convert_to_activity_metadata.
  • Add a regression test ensuring nested body.* fields are preserved and not misrouted into multipart_params.
  • Bump package version to 0.16.17 in project metadata and lockfile.
File summaries
File Description
src/uipath_langchain/agent/tools/integration_tool.py Skips the multipart JSON-envelope marker param so it cannot compete with real body.* fields during parameter location mapping.
tests/agent/tools/test_integration_tool.py Adds a regression test covering the multipart envelope-marker vs nested body-field name collision.
pyproject.toml Bumps package version to 0.16.17.
uv.lock Updates locked editable package version to 0.16.17.
Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@andreitava-uip andreitava-uip changed the title fix(agent): don't let the multipart body envelope param shadow real body.* fields fix: don't let the multipart body envelope param shadow real body.* fields Sep 4, 2026
@andreitava-uip andreitava-uip changed the title fix: don't let the multipart body envelope param shadow real body.* fields fix: don't let the multipart body envelope param shadow real body fields Sep 4, 2026
@andreitava-uip
andreitava-uip force-pushed the fix/integration-tool-multipart-body-envelope-collision branch from 990be0c to 89582d2 Compare September 4, 2026 07:20
…ody.* fields

IS's own envelope marker for the JSON body section shared a name with
the entity's real body.content field, so real content got dropped.
@andreitava-uip
andreitava-uip force-pushed the fix/integration-tool-multipart-body-envelope-collision branch from 89582d2 to b618913 Compare September 4, 2026 07:25
@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@andreitava-uip
andreitava-uip merged commit 196e647 into main Sep 4, 2026
48 checks passed
@andreitava-uip
andreitava-uip deleted the fix/integration-tool-multipart-body-envelope-collision branch September 4, 2026 09:22
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.

4 participants