Skip to content

fix(uipath-maestro-bpmn): count a connector response with .Count, and align the live-debug grader hint - #4833

Merged
rockymadden merged 4 commits into
mainfrom
fix/bpmn-length-count-and-grader-hint
Nov 18, 2026
Merged

rockymadden merged 4 commits into
mainfrom
fix/bpmn-length-count-and-grader-hint

Conversation

@rockymadden

@rockymadden rockymadden commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • references/connectors.md: the connector outputs example counts a response with =response.Count, not =response.length. A plain = expression has no .length: it reads back null and the run still completes.
  • references/connectors.md: .Count counts an array and silently returns the field count on an object. A list operation's runtime response is the bare array (builder-sdk list-envelopes.json: all eight measured operations), even where uip is resources run prints { items, Pagination }.
  • references/bpmn-runtime.md (js-for-methods): a JS property such as .length reads back null with no incident; use .Count.
  • live_debug_e2e/check_live_debug.py: the source="=result" failure hint now says return 6 * 7;. The old hint (return { response: 6 * 7 }) double-wraps under scriptVersion v2 and later and contradicted live_debug_e2e.yaml.

Refs MW-279. Companion: UiPath/cli#6132 now fails validate on a plain .length on any root.

Evidence

Alpha debug run (instance bc0388cd-48dc-408a-a457-64e9da5c9f1f, solution deleted): a script returning [1, 2, 3], mapped three ways.

Output source Value
=result.response.length null (run Completed)
=result.response.Count 3
=js:result.response.length 3

validate passed all three on uip 1.207.0-dev.

Coder evals

  • paginated_reference_lookup: every required criterion passed.
  • live_debug_e2e: passed on rerun (1.000). The first run failed the debug-evidence check because the agent hand-wrote debug-evidence/debug.json without FinalStatus; the hint this PR edits was not reached. The origin/main baseline passed (1.000).

Not verified

  • The probe used a script result. A connector response goes through the same plain evaluator, but no connector run was made.
  • No test covers the grader hint string, so there was no revert check.

🤖 Generated with Claude Code

… align the live-debug grader hint

Plain `=` expressions have no `.length`: on alpha, `=result.response.length`
read back null while `.Count` and `=js:...length` returned 3.

The live-debug grader's hint told the agent to `return { response: ... }`,
which double-wraps under scriptVersion v3.

Refs MW-279, MW-281

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rockymadden
rockymadden requested review from a team, dmetzgar and tmatup as code owners November 16, 2026 23:50
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @rockymadden's task in 42s —— View job


Summary

Two one-line fixes. connectors.md now uses =response.Count in place of =response.length in the connector outputs example. The check_live_debug.py failure hint now says return 6 * 7;, which matches live_debug_e2e.yaml.

Change-by-Change Review

1. skills/uipath-maestro-bpmn/references/connectors.md:72

OK. The fix matches the existing rule at references/bpmn-runtime.md:52-57: a plain = expression is evaluated C#-style, and .NET members work there. The PR's alpha-run table backs it up: .Count returns 3, while .length returns null and the run still completes. The edited line sits outside every skill-flavor block in the file (the blocks are at 43–51, 135–137 and 258–260), so flavors pick up the change without an override. No other plain =…length remains in the skill or in skill-flavors/*/uipath-maestro-bpmn; every other .length is inside =js: or script bodies.

2. tests/tasks/uipath-maestro-bpmn/debug/live_debug_e2e/check_live_debug.py:307

OK. The new hint agrees with live_debug_e2e.yaml:62-68 and with bpmn-runtime.md:114 / diagnose.md:225. All three say return value; and warn that { response: … } double-wraps. The old hint told agents to do the exact thing the task prompt forbids.

What's Missing

  • Low: the rule at bpmn-runtime.md:51-58 covers JS method calls that fault the run. It does not cover JS properties like .length, which fail more quietly: they read back null, the run completes, and nothing faults. That silent-null case is the dangerous one. A short clause would give the fix a canonical home rather than leaving it in a single example, for instance: "a JS property such as .length reads back null without faulting; use .Count or =js:". It's optional, and the CLI-side validate check in UiPath/cli#6132 partly covers it.

Area Ratings

Area Status Notes
Frontmatter OK Unchanged
E2E Tests OK Hint string fixed; the PR body includes eval runs
Skill Body OK Unchanged
References & Assets OK Outside flavor blocks; consistent with bpmn-runtime.md
Repo Hygiene OK Scoped to one skill; no secrets or paths

Issues for Manual Review

  • .Count on a connector response that is an object rather than an array has not been tested; the probe used a script result. The PR body already lists this under "Not verified".

Conclusion

Approve. The fix is correct, minimal and matches the rest of the skill. The only suggestion is the optional Low item above.

@tmatup tmatup left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approve. No blocking issues. Both two-line edits are correct.

  • .length -> .Count (connectors.md:72) matches cli#6132's new COLLECTION_LENGTH_NOT_SUPPORTED rule, which suggests .Count/.Length (or =js: with .length); its tests accept =result.response.Count > 0. No other plain-= .length remains in the skill; the two left (composing-guide.md:176, high-volume-batch-guide.md:56) are inside Jint script bodies, where JS .length is right.
  • Grader hint (check_live_debug.py:307): the old hint told the agent to write return { response: 6 * 7 }, which the same checker fails at line 332 (regex return\s*\{\s*response) and live_debug_e2e.yaml:68 forbids. The new hint matches both. py_compile passes; CI is green, including the maestro-bpmn checker unit tests.

Smaller issues (inline): envelope responses and a backtick nit.

Not reviewed: no live connector run; the cited coder-eval runs were not re-run.


Review run with Claude Code; each finding was reproduced with a probe at the PR head.

- Outlook `send-email`: `message.toRecipients`, `ccRecipients` and `bccRecipients` are ONE comma-separated string, never an array (`CONNECTOR_INPUT … expected string, got object`). Always set `saveAsDraft`: `false` to send, `true` to draft. The definition's default (`true`) is not compiled into the task, and the response (`status: "success"`) does not say which happened.
- An `=`-expression is left alone; a plain string is checked against the field's declared type.
- The response lands in `outputVar` (default `<id>_response`) and the failure in `errorVar` (default `<id>_Error`); `outputs: { poCount: { source: '=response.length', name: 'POCount', type: 'integer' } }` adds a mapped output row per extra variable, each declared by the task like the two standard ones. These are what a decompiled import's `.connector()` calls carry, so an edit keeps the variables the process already reads.
- The response lands in `outputVar` (default `<id>_response`) and the failure in `errorVar` (default `<id>_Error`); `outputs: { poCount: { source: '=response.Count', name: 'POCount', type: 'integer' } }` adds a mapped output row per extra variable, each declared by the task like the two standard ones. These are what a decompiled import's `.connector()` calls carry, so an edit keeps the variables the process already reads.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Non-blocking: .Count counts an array response. For a list operation that returns an envelope ({ items: [...] }), =response.Count won't count the records. Consider adding "for an envelope, count the list field, e.g. =response.items.Count". Not verified on a live connector.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 7cd0a80, but not as =response.items.Count. builder-sdk's typescript/sdk/lib/library-json.samples/list-envelopes.json measures all eight list operations as bare arrays at runtime. { items, Pagination } is only what uip is resources run prints, so =response.items.Count would read nothing at runtime. The line now says .Count counts an array, silently returns the field count on an object, and that the runtime list response is the bare array even when the CLI shows { items, Pagination }.

f"{path}: script output maps product from source=\"=result\". "
"Studio Web completes this shape but reads product back empty; "
"return { response: 6 * 7 } and map source=\"=result.response\"."
"return 6 * 7; and map source=\"=result.response\"."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: return 6 * 7; and map ... reads as one statement. Wrap the code in backticks, as line 337 does: return `return 6 * 7;` and map source="=result.response".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 7cd0a80: the hint now reads \return 6 * 7;` and map source="=result.response"`.

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

Consolidated from two independent agent reviews (one validating claims against PO.Frontend origin/develop and PO.BpmnEngine origin/main, one on completeness and house rules). Findings were deduplicated and checked against source; items that only restate existing threads are marked as such.

Verified correct:

  • .Count and .Length resolve; .length does not (ExpressionList.cs:24,60).
  • The return 6 * 7; + =result.response hint matches v2+ wrapping (ScriptTaskService.cs:262-266) and the checker at :332.

Medium

  1. connectors.md:72: .Count on an envelope response silently returns the number of keys. It does not fail, does not return null, and validate passes (ExpressionDictionary.cs:25). tmatup's open thread understates this.
    • Fix: add ".Count counts an array response; when the response is an object, count its list field (=response.items.Count) — .Count on an object returns its number of fields, with no error."

Low / Nit

  1. bpmn-runtime.md:51-57 (js-for-methods) still implies a property read like .length works. Add "a JS property such as .length reads back null without faulting; use .Count or =js:."
  2. check_live_debug.py:307: tmatup's backtick nit is open.
  3. Optional: the version wording differs (the body and bpmn-runtime.md:112 say "v3", the checker at :335 says "v2+").

rockymadden and others added 2 commits November 17, 2026 08:38
`.Count` on an object returns its field count with no error. A list
operation's runtime response is the bare array (builder-sdk
list-envelopes.json: all eight measured operations), even where
`uip is resources run` prints `{ items, Pagination }`.

Backtick the grader hint's code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…js-for-methods rule

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rockymadden

Copy link
Copy Markdown
Collaborator Author

@DevMomo thanks. Each item checked against source:

  1. Envelope .Count: confirmed, ExpressionDictionary.cs:25 returns the key count. Fixed in 7cd0a80. The fix doesn't use =response.items.Count: builder-sdk list-envelopes.json measures all eight list operations as bare arrays at runtime, and { items, Pagination } is only the CLI's shape.
  2. js-for-methods property read: fixed in 71a841b.
  3. Backtick nit: fixed in 7cd0a80.
  4. v3 vs v2+: bpmn-runtime.md:112 says v3 because that's what .scriptTask() writes, and the checker's v2+ is the engine rule (ScriptTaskService.cs:262). They don't conflict, so no change there. The PR body now says v2 and later.

Picks up #4858, which fixes main's package build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rockymadden
rockymadden merged commit a165801 into main Nov 18, 2026
48 checks passed
@rockymadden
rockymadden deleted the fix/bpmn-length-count-and-grader-hint branch November 18, 2026 16:22
DevMomo added a commit that referenced this pull request Nov 18, 2026
…omputed result reads

- bpmn-runtime.md: js-everywhere keeps #4833's warning for plain = expressions an agent keeps or edits (.length reads null; use .Count; .length only inside =js:).
- Contract test: FORM_VALUE also exempts the start-event row source: '=vars.<inputId>', var: (#4892 writes these).
- Grader: RESULT_READ exempts only a bare result/response/Error/iterator path, so a computed plain expression fails --check js.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rockymadden

Copy link
Copy Markdown
Collaborator Author

/cherrypick release/v1.207

@github-actions

Copy link
Copy Markdown
Contributor

A cherry pick from this PR targeting release/v1.207 was triggered.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Cherry-pick to release/v1.207 succeeded: #4952

rockymadden pushed a commit that referenced this pull request Nov 19, 2026
… align the live-debug grader hint (#4833) (#4952)

* fix(uipath-maestro-bpmn): count a connector response with .Count, and align the live-debug grader hint

Plain `=` expressions have no `.length`: on alpha, `=result.response.length`
read back null while `.Count` and `=js:...length` returned 3.

The live-debug grader's hint told the agent to `return { response: ... }`,
which double-wraps under scriptVersion v3.

Refs MW-279, MW-281

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(uipath-maestro-bpmn): say what .Count counts on a connector response

`.Count` on an object returns its field count with no error. A list
operation's runtime response is the bare array (builder-sdk
list-envelopes.json: all eight measured operations), even where
`uip is resources run` prints `{ items, Pagination }`.

Backtick the grader hint's code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(uipath-maestro-bpmn): a plain-grammar .length reads null, in the js-for-methods rule

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants