Skip to content

fix(tracing): default a blank span attachment MIME type [AL-729] - #2009

Merged
apetraru-uipath merged 1 commit into
mainfrom
fix/al-729-span-attachment-mime-type
Nov 20, 2026
Merged

apetraru-uipath merged 1 commit into
mainfrom
fix/al-729-span-attachment-mime-type

Conversation

@apetraru-uipath

@apetraru-uipath apetraru-uipath commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

AL-729: when an agent gets an input file with an unknown extension (for example .ovpn), the trace has no Agent run root span. Its children show as top-level nodes and the inner LLM call stays in progress.

Studio Web uploads such a file with an empty MimeType. The runtime copies it into the span's attachments, and the traces API rejects the whole upsert:

POST llmopstenant_/api/Traces/v3/spans  400 Bad Request
{"code":"OPS0006","errorMessage":"The MimeType field is required.; The MimeType field is required."}
Failed to upsert span Agent run - Agent with final status

400 is not retried, so every span that carries the attachment is lost: Agent run, Tool call - Analyze_Files, and the final update of the tool's LLM call.

Change

SpanAttachment replaces a blank MIME type with the type guessed from the file name, else application/octet-stream. All attachment producers build this model, so one validator covers them.

uipath-platform 0.3.12 → 0.3.13.

Validation

Unit tests: blank and whitespace MIME types on the model, and a span with an untyped attachment serialised through otel_span_to_uipath_span(...).to_dict().

Local robot on alpha (Studio Web Debug, runtime Development), same agent and the same three files (3R1A.pdf and two .ovpn with an empty type), only this change toggled:

Without the fix With the fix
Job Faulted, AGENT_RUNTIME.FILE_ERROR Faulted, AGENT_RUNTIME.FILE_ERROR
Span upserts rejected with OPS0006 8 of 17 0 of 17
Agent run root span missing present, error status and message
Tool call - Analyze_Files missing present, error status
Tool's LLM call in progress, no end time ended, error status
Parent ids with no span 2 0

Not in this PR

  • The run still faults: the model rejects the file sent as application/octet-stream. That is the second defect in AL-729 and belongs in uipath-langchain-python.
  • The traces API still rejects a whole span over one attachment field; relaxing that validation is a separate change in llm-observability.

Release

The agent runtime picks this up after uipath-platform 0.3.13 is published and uipath-agents-python is bumped to it.

🤖 Generated with Claude Code

The traces API rejects a span upsert when an attachment has an empty
MimeType (400 OPS0006), and the span is dropped. A file with an unknown
extension uploaded from Studio Web has no MIME type, so the Agent run,
Tool call and LLM call spans that carry it disappeared from the trace.

SpanAttachment now replaces a blank MIME type with the type guessed from
the file name, else application/octet-stream.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 16:17
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Nov 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the attachment MIME-type normalization change.

No open issues 🎉

What changed in this PR

Prevents trace spans from being rejected when file attachments have blank MIME types, addressing the tracing defect in AL-729. The separate runtime file-processing error remains out of scope.

Changes:

  • Defaults blank or whitespace-only attachment MIME types using the filename, falling back to application/octet-stream.
  • Adds model and span-serialization regression tests.
  • Bumps uipath-platform to 0.3.13 and updates both lockfiles.
File Description
packages/​uipath/​uv.lock Updates the platform dependency version to 0.3.13.
packages/​uipath-platform/​uv.lock Synchronizes the platform package version.
packages/​uipath-platform/​tests/​services/​test_span_utils.py Tests MIME defaults, preservation, and serialized attachments.
packages/​uipath-platform/​src/​uipath/​platform/​common/​_span_utils.py Adds blank MIME-type normalization to SpanAttachment.
packages/​uipath-platform/​pyproject.toml Bumps the platform release version to 0.3.13.

Review effort: Balanced

@sonarqubecloud

Copy link
Copy Markdown

@apetraru-uipath
apetraru-uipath merged commit bbd3f2b into main Nov 20, 2026
100 checks passed
@apetraru-uipath
apetraru-uipath deleted the fix/al-729-span-attachment-mime-type branch November 20, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants