Skip to content

feat(batch-transform): default to single-shot from-attachment (kill switch: DisableBatchTransformFromAttachment) - #1120

Merged
cfauchere merged 1 commit into
mainfrom
feat/batch-transform-from-attachment
Sep 30, 2026
Merged

cfauchere merged 1 commit into
mainfrom
feat/batch-transform-from-attachment

Conversation

@cfauchere

Copy link
Copy Markdown
Contributor

What

Makes Batch Transform's internal tool default to the single-call start_batch_transform_from_attachment primitive — one durable interrupt returning CreateBatchTransform(attachment=<id>, ...); the server creates the ephemeral index and starts the Batch Transform task in one operation. The previous two-step ephemeral-index flow is retained behind a kill switch so we can flip back in production if something goes wrong.

Changes

  • batch_transform_tool.py:
    • Default path: single interrupt(...) emitting CreateBatchTransform(attachment=attachment_id, index_folder_key=UiPathConfig.folder_key, ...).
    • Fallback path (kill switch on): the previous create_ephemeral_index + WaitEphemeralIndex / ReadyEphemeralIndex + create_batch_transform(index_id, index_name, is_ephemeral_index=True) two-step flow, unchanged.
    • Kill switch: DisableBatchTransformFromAttachment — declared locally as BATCH_TRANSFORM_FROM_ATTACHMENT_KILL_SWITCH. FeatureFlags.is_flag_enabled(..., default=False) resolves it against UIPATH_FEATURE_DisableBatchTransformFromAttachment.
  • test_batch_transform_tool.py:
    • New default-path test covers the single-shot flow — one interrupt, CreateBatchTransform.attachment, .prompt, .destination_path, .index_folder_key from UIPATH_FOLDER_KEY.
    • Fallback tests set UIPATH_FEATURE_DisableBatchTransformFromAttachment=1 and exercise the two-step path (instant-ready index, wait-for-ingestion, folder-key passthrough, destination-path variants).
  • pyproject.toml / uv.lock: bump uipath-platform>=0.2.31 → >=0.2.33 for the new primitive; bump package 0.18.17 → 0.18.18.

Depends on

  • UiPath/uipath-python#1920 — merged. Ships the start_batch_transform_from_attachment primitive, CreateBatchTransform.attachment field, and dispatcher branch this PR relies on.

Why

Old path: two durable interrupts, one with a WaitEphemeralIndex suspend in between while the server ingested the attachment. New path: one interrupt — the server does index creation + ingestion + task start in one call. The trailing job-attachment upload of the CSV result is unchanged.

Making the new path the default (rather than opt-in) commits us to the simpler flow; the kill switch is the safety net for a fast rollback without a code change if the server-side path regresses in production.

Rollback

Set UIPATH_FEATURE_DisableBatchTransformFromAttachment=1 on the runtime. The tool reverts to the previous two-step behaviour immediately — no redeploy needed.

@cfauchere
cfauchere force-pushed the feat/batch-transform-from-attachment branch from 09acf23 to acaf702 Compare September 29, 2026 22:14
@cfauchere
cfauchere marked this pull request as ready for review September 29, 2026 22:30
Copilot AI balanced review requested due to automatic review settings September 29, 2026 22:30

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.

Copilot review overview

🟡 Changes recommended

The selected path can change during interrupt replay, and the default request omits a configured folder prefix.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

This PR makes the single-call, attachment-based Batch Transform the default while retaining the previous flow behind a kill switch.

Changes:

  • Use one interrupt to start a Batch Transform from an attachment.
  • Keep the two-step path as a fallback and update its tests.
  • Bump the package version and platform dependency.
File Description
uv.lock Updates locked versions and package metadata.
tests/​agent/​tools/​internal_tools/​test_batch_transform_tool.py Tests the default path and kill-switch fallback.
src/​uipath_langchain/​agent/​tools/​internal_tools/​batch_transform_tool.py Adds the single-call path and fallback selection.
pyproject.toml Bumps the package version and platform requirement.

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

Comment on lines +138 to +140
if not FeatureFlags.is_flag_enabled(
BATCH_TRANSFORM_FROM_ATTACHMENT_KILL_SWITCH, default=False
):
attachment=attachment_id,
enable_web_search_grounding=static_web_search,
destination_path=destination_path,
index_folder_key=UiPathConfig.folder_key,

@JeremyReist2 JeremyReist2 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.

lgtm - plz wait for @CalebMartinUiPath who has more experience on this

Kill switch: DisableBatchTransformFromAttachment.

Makes the Batch Transform internal tool default to the single-call
start_batch_transform_from_attachment primitive - one durable interrupt
returning CreateBatchTransform(attachment=<id>, ...); the server creates the
ephemeral index and starts the Batch Transform task in one operation. The
previous two-step ephemeral-index flow is retained behind a kill switch so we
can flip back in production if something goes wrong.

Changes
- batch_transform_tool.py:
  - Default path: single interrupt emitting CreateBatchTransform(
      attachment=attachment_id, index_folder_key=UiPathConfig.folder_key, ...).
  - Fallback path (kill switch on): the previous create_ephemeral_index +
    WaitEphemeralIndex / ReadyEphemeralIndex + create_batch_transform two-step
    flow, unchanged.
  - Kill switch: DisableBatchTransformFromAttachment - declared locally as
    BATCH_TRANSFORM_FROM_ATTACHMENT_KILL_SWITCH.
    FeatureFlags.is_flag_enabled(..., default=False) resolves it against
    UIPATH_FEATURE_DisableBatchTransformFromAttachment.
- test_batch_transform_tool.py:
  - New default-path test covers the single-shot flow.
  - Existing two-step tests set
    UIPATH_FEATURE_DisableBatchTransformFromAttachment=1 to force the fallback.
- pyproject.toml / uv.lock: bump uipath-platform>=0.2.31 to >=0.2.33 for the
  new primitive; bump package 0.18.17 to 0.18.18.

Rollback
Set UIPATH_FEATURE_DisableBatchTransformFromAttachment=1 on the runtime. The
tool reverts to the previous two-step behaviour immediately - no redeploy
needed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@cfauchere
cfauchere force-pushed the feat/batch-transform-from-attachment branch from acaf702 to dd90f4a Compare September 30, 2026 20:20
@sonarqubecloud

Copy link
Copy Markdown

@cfauchere
cfauchere merged commit ad39dab into main Sep 30, 2026
46 of 48 checks passed
@cfauchere
cfauchere deleted the feat/batch-transform-from-attachment branch September 30, 2026 21:46
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