Skip to content

fix(cli): print a run's output whole in the console bridge - #1922

Open
vlad-uipath wants to merge 1 commit into
mainfrom
fix/console-bridge-full-output
Open

vlad-uipath wants to merge 1 commit into
mainfrom
fix/console-bridge-full-output

Conversation

@vlad-uipath

Copy link
Copy Markdown

uipath run cut every output value at 250 characters and added ..., so a long output field could never be read in full. This came in from the uip CLI side (UV-16695, worked around for --output json in UiPath/cli#4647); a person reading the tree still saw the cut value.

What changed

ConsoleDebugBridge._print_json takes a new truncate flag, default True. The run's final output (emit_execution_completed) and the output shown when a run suspends for API input pass False. With False there is no 250-char cut, no depth-10 cut, and no 10,000-char cut on the JSON fallback.

  • Only the output, not the state. Intermediate state updates and breakpoint state still get shortened. That's a progress stream and can be large. The output is the answer the user asked for, so silently cutting it is the bug.
  • Markup escaping. Keys and values went into rich markup as-is. So a value like see [bold]docs[/bold] printed as see docs, and a stray closing tag like [/x] raised inside console.print, which dropped the whole payload into the JSON fallback. Both are now escaped with rich.markup.escape. It's the same function and the same kind of problem (the output shown isn't the output returned), so I kept it in this PR.
  • Version bumped to 2.14.28.

Blast radius: only changes what the console shows. Nothing machine-readable is affected; --output-file already wrote the full payload.

Verification

Real uipath run on a function whose Output has the ticket's 256-char field, main vs this branch:

[main]   ├── dials: ... PendingStaleDays=5 ProposalNudgeDays=3 ProposalStale...
         └── note: see docs
[branch] ├── dials: ... PendingStaleDays=5 ProposalNudgeDays=3 ProposalStaleDays=9
         └── note: see [bold]docs[/bold]
  • New tests/cli/test_console_debug_bridge.py (8 tests). With the source change reverted, 7 of them fail; the one that passes checks that state updates are still shortened.
  • pytest tests/cli: 1506 tests, 0 failures. ruff check, ruff format --check, mypy on the touched files, and uv lock --check are all clean.
  • Not tried: the interactive uipath debug console. It uses the same emit_* methods, so it gets the same behavior.

🤖 Generated with Claude Code

The console bridge cut every output value at 250 characters and added
"...", so `uipath run` could not show a long output field in full. The
final output (and the output shown when a run suspends for API input) is
the result itself, so it now prints untruncated and at any depth.
Intermediate state updates are still shortened.

Values and keys are also escaped before they go into rich markup, so
text like "[bold]" prints as-is instead of being styled away, and a
stray "[/x]" no longer breaks the tree and drops to the JSON fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 16:24
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime test:uipath-integrations labels Sep 30, 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.

Copilot review overview

🟢 Approval recommended

The focused implementation matches the stated behavior and includes comprehensive regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Ensures CLI run outputs are displayed completely and literally while retaining truncation for progress state.

Changes:

  • Disables value, depth, and fallback truncation for final and suspended API outputs.
  • Escapes Rich markup in payload keys and values.
  • Adds regression tests and bumps the package version.
File Description
packages/​uipath/​src/​uipath/​_cli/​_debug/​_bridge.py Implements selective truncation and markup escaping.
packages/​uipath/​tests/​cli/​test_console_debug_bridge.py Tests complete output, nesting, markup, and state truncation.
packages/​uipath/​pyproject.toml Bumps the package version to 2.14.28.
packages/​uipath/​uv.lock Synchronizes the locked package version.

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

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
80.0% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube Cloud

This branch has not been deployed

No deployments
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 test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants