fix(uipath-rpa): document both run/debug payload shapes (Helm vs Studio Desktop) and drop the --output-filter mandate - #3102
Conversation
…-safe verdict filter
|
Claude finished @danmunteanu1's task in 3m 12s —— View job PR Review: fix(uipath-rpa): document the real run/debug payload shape and a null-safe verdict filter
SummaryCorrects the Change-by-Change Review1.
|
| Area | Status | Notes |
|---|---|---|
| Frontmatter | OK | Not changed; still valid |
| E2E Tests | OK | Docs-only change; existing tests don't reference removed strings |
| Skill Body | OK | Rule 8a updated consistently |
| References & Assets | OK | All four reference changes are internally consistent and cross-linked correctly |
| Repo Hygiene | OK | No secrets, no cross-skill deps, changes scoped to uipath-rpa only |
Issues for Manual Review
- CLI payload shape accuracy: The review criteria note that automated reviewers cannot verify whether CLI commands match the tool's actual API. The PR author probed the shape on uip 1.200.1-preview.129 and 1.202.0-dev.8548 — independent confirmation on a GA release would strengthen confidence that the documented shape is stable.
- JMESPath filter null-safety: The claim that
logEntries[?level!='Trace'].message | [-8:]evaluates cleanly whenlogEntriesisnullis consistent with the JMESPath spec (filter onnull→null, slice onnull→null), but verifying against the CLI's specific JMESPath implementation would be belt-and-suspenders.
Conclusion
Clean, well-motivated docs fix that corrects a real and measurable agent failure mode (26/30 bench runs hit it). All four files are internally consistent, correctly cross-linked, and free of the old payload shape outside the intentional runResult fallback clause. The only observation is a pre-existing PascalCase inconsistency in untouched sections of debugging.md — not blocking. Approve.
…filter keys and diagnostic callout
…(outputDirectory casing, output/debugDetails states)
…lope is the verdict
…lines, placeholder example output
… (Helm vs Studio Desktop); verdict rule per shape
andrei-balint
left a comment
There was a problem hiding this comment.
I created a jira issue for the rpa-tool side as well https://uipath.atlassian.net/browse/STUD-81410
|
|
||
| - **Headless Studio (Helm) — default.** Ships as a NuGet package and auto-launches on first use. **No Studio Desktop install needed.** First call on a cold NuGet cache may sit near-silent for 30–90 s while `dotnet restore` runs — the default shell timeout covers this; raise `timeoutSeconds` only behind a slow feed. | ||
| - **Studio Desktop.** The interactive UI. Used automatically only by verbs with **UI side effects** — those that open a window or highlight something in the designer (discover them via `--help`; they don't work headless). For such a verb, ensure Desktop is up first (`uip rpa studio start --project-dir "<PROJECT_DIR>"`), then run it. Force Desktop for any command with `UIPATH_RPA_TOOL_USE_STUDIO=1` (not recommended for the standard authoring loop). | ||
| - **Studio Desktop.** The interactive UI. A running Studio Desktop instance that has the project open handles that project's `uip rpa` calls — `run` and `debug start` included — and `uip rpa instances list --output json` shows which instance holds which project. Verbs with **UI side effects** (open a window, highlight something in the designer; discover them via `--help`) work only here: ensure Desktop is up first (`uip rpa studio start --project-dir "<PROJECT_DIR>"`), then run them. Force Desktop for any command with `UIPATH_RPA_TOOL_USE_STUDIO=1` (not recommended for the standard authoring loop). **The two backends return different `run` / `debug start` payloads** — see [Reading run / debug results](#reading-run--debug-results). |
There was a problem hiding this comment.
How would the model know it has a running SD instance? It would probably query the processes list, right?
Also, I fear the UIPATH_RPA_TOOL_USE_STUDIO=1 part is outdated. cc @DragosUnguru @RaduAna-Maria
There was a problem hiding this comment.
I ran additional tests with this branch rebased on latest main. The agent never writes about these details, it just runs the command and never comments about the output type, just observes the workflow succeeded.
There was a problem hiding this comment.
It does feel more confident about its output interpretation:
Run passed: hasErrors: false, debugState: "Completed", and the log line reads Calculator result: 5 + 5 = 10.
Why
In a 30-run headless bench of
uipath-rpa(5 journeys x 2 skill arms x 3 replicates,@uipath/cli1.200.1-preview.129), 26 of 30 runs had at least oneuip rpa run/debug startrejected with:The filter is the one the skill mandates verbatim in
cli-reference.md§ Capturing the verdict (Rule 8a says "always pass--output-filter"). Each rejection cost 1-3 retry turns (the workflow had already run, so retries re-drive the application), and agents then spent further turns saving "output-filter null errors" / "run verdict shape" notes to memory. Across the bench this was the largest single source of post-gate turns.Root cause
The docs described one
Datapayload —{output: "Session ended", errors: [...], logEntries: [...]}(from #2698) — and derived the verdict rule and the mandated--output-filterfrom it. That payload is what Studio Desktop returns when the project is open in a running Studio instance. The bench, and every agent running against a project that is not open in Studio, goes through headless Studio (Helm), which returns a different payload:{output, hasErrors, errorMessage, profiling, debugState, debugDetails}with the workflow's log lines streamed above the envelope as[<Level>] …text. Same machine, same project, same CLI, two shapes — selected by the backend, not by the build (reproduced on uip 1.200.1-preview and 1.201.0-preview.133 with rpa-tool 1.200.0-preview, 1.200.1, 1.201.0-preview, 1.202.0-dev).Consequences on Helm of docs written for the Desktop shape:
length(errors)throws becauseerrorsdoes not exist there (26 of 30 bench runs);outputis the serialized output arguments, not a status string; the log lines are outsideData; the verdict rule could never be satisfied, so agents fell back to the outerResult, which Rule 8a forbids.Data(clean run){output: "{}", hasErrors: false, errorMessage: null, profiling: null, debugState: null, debugDetails: null};debug startaddsdebugState: "Completed";[Level]log lines above the enveloperun→ outerResult: "Failure",Message= the fields JSON-encoded withhasErrors: true; faulteddebug start→Suspended, exception indebugDetails; unopenable dir / busy executor →Message: {"success": false, "errorMessage": …}{output: "Session ended", errors: [], logEntries: [{source, level, message}], debugState: "Completed"}forrunanddebug start; nothing streams above the envelopeResult: "Success",{output: "Failed to open the file <path>", errors: [], logEntries: []}; an undeclared--input-argumentskey is accepted silently. Unhandled exception: not observed, not documentedFix (docs only)
cli-reference.md§ Reading run / debug results + § Capturing the verdict: document both payloads keyed by backend (table above), with one verdict rule per shape — Helm:hasErrors == falseANDerrorMessage == nullANDdebugStatein {null,"Completed"}; Studio Desktop:errorsempty ANDoutput == "Session ended"(the missing-entry-point case shows why both are needed). § Headless Studio (Helm) vs Studio Desktop now states the routing that was observed: a running Studio instance that has the project open handles that project's calls,run/debug startincluded (uip rpa instances list --output jsonshows who holds what); it previously said Desktop is used only by UI-side-effect verbs. The--output-filtermandate forrun/debug startis dropped, not replaced:Datais six short fields (a filter saves nothing), the filter cannot reach the log lines (they stream above the envelope), and any filter naming a key outsideDatafails the call after the workflow has already run. One anti-pattern line keeps that failure mode documented. The "never| tail/| head" rule stays with the corrected rationale (log lines precede the envelope).--output-filterremains documented in § Output format for list-shaped responses, where it does help.SKILL.mdRule 8a: same verdict fields,outputsemantics corrected, "read the envelope as printed, no--output-filter, never tail/head".debugging.md§ Output Format: two subsections, § Helm shape and § Studio Desktop shape, each with its example, field table and verdict callout; § 5 Runtime Validation, § Reading Debug Output Effectively and the profiling notes use the probed camelCase names (profiling.outputDirectory).uia-starter-guide.md§ Running UI Automation Workflows step 2:debug startwithout a filter; log lines stream above the envelope.Removed rather than rewritten, because neither reproduces on either backend: the nested
Data.runResultvariant, and the "a style diagnostic (IDE0063) can fail the verdict" callout (a coded workflow with a simplifiableusingruns withhasErrors: false). The Desktop shape's unhandled-exception state (errorsitem fields,output: "Execution aborted…") is also not documented — it has not been observed.Rule numbering, section anchors and every inbound link are unchanged.
Claim-by-claim probe (third commit)
Every factual sentence in the changed sections was re-run against the CLI (uip 1.200.1-preview.129, rpa-tool 1.200.0-preview) with purpose-built fixtures: an entry point with an out argument and an Error-level
Log Message, a divide-by-zeroAssign, a 25 sDelay, a missing entry point, an unknown flag, an unopenable project dir,--breakpoints,--profiling,debug statein every state. Corrections that came out of it:profilingis{"outputDirectory": "..."}(camelCase) — everyOutputDirectorymention fixed.outputis"{}"on a run that faulted inside an activity and""only when the run never started (validation failure, missing entry point) or while a session isPaused/Suspended/Running;debug continueto completion returns the out-arguments.debugDetailsis""(notnull) whileRunning.hasErrorscauses reduced to the three observed (unhandled exception, compile/validation failure, missing entry point); "cancellation, timeout" removed as unverified.errorMessagehas three observed forms (activity faultSource:/Message:/Exception Type:;Validation failed with N error(s):;Message: The <file> workflow cannot be found), all listed.Failurehas twoMessageshapes: the Data fields JSON-encoded (faulted / invalid / missing-entry-pointrun) and{"success": false, "errorMessage": ...}(unopenable project dir, busy executor).Everything else in the sections reproduced as written. Probe script and raw output are in the bench workspace (
probe-payload.sh,probe-results.txt,PROBES.md).Second probe pass (after dropping the filter mandate)
Re-checked the sentences the cleanup introduced: a filter naming an absent key fails only after the workflow ran (the
[Error]log line andexecution endedprint before theValidationError); log lines and envelope are both on stdout (stderr empty), so> run.logcaptures everything;PauseddebugDetailshas exactlyActivity,ActivityId,WorkflowFile,CurrentActivity,Locals; the profiling folder holds*.uistat(screenshots appear only for UI activities);profilingisnullon a compile failure. Two wording fixes came out of it: log lines are[<Level>] …(not only[Information]), and theFailureenvelope'sMessagehas two shapes (Data fields JSON-encoded vs{"success": false, "errorMessage": …}), now stated in cli-reference as well. Example output uses<PROJECT_NAME>and a literal observedSum: 10line rather than invented text.Verification
run, cleandebug start,debug startsuspended onDivideByZeroException, faultedrun. Payload shape re-confirmed on rpa-tool 1.200.1 (latest), 1.201.0-preview.20260828.10 (preview) and 1.202.0-dev.20260825.8 (dev), see the table above.node scripts/check-skill-links.mjs: 6602 links resolve.npm run skills:validate: OK (27 skills / 1759 files; studioweb 182 replacements). Noskill-flavors/override touches the four files. No test YAML references the removed strings.