fix(uipath-maestro-flow): correct inline-agent canonical shape (MST-9263)#517
Conversation
|
Claude finished @tmatup's task in 3m 14s —— View job PR Review: fix(uipath-maestro-flow): correct inline-agent canonical shape (MST-9263)
SummaryAdds an investigation report tracing why an agent reached for Change-by-Change Review1.
|
| Area | Status | Notes |
|---|---|---|
| Frontmatter | OK | No frontmatter changes in this PR |
| E2E Tests | Issue | No test tasks for updated inline-agent guidance (Medium) |
| Skill Body | OK | SKILL.md not changed |
| References & Assets | Issue | Line-number pointers fragile (Low); moderate heredoc recipe duplication across files (Medium) |
| Repo Hygiene | OK | CODEOWNERS already covers path; no secrets; .gitignore addition clean; investigation doc in docs/ is fine |
Issues for Manual Review
- Domain accuracy of the
inputs.sourcevsmodel.sourceframing. The PR claimsinputs.sourceis canonical post-flow-core-0.2.50 andmodel.sourceis legacy. This is sourced from canvas behavior atserialization/uipath-extension.ts:417-420andnode-service.ts:535-545. An automated reviewer cannot verify these source references — a domain expert should confirm the canonical/legacy framing is correct for the current product state. - Validator hydration behavior. The Debug table and Repair Recipe assert that
flow validatehydratesinputs.systemPrompt/inputs.userPromptfromagent.json.messages[]when the source UUID is correctly set. The investigation report says the opposite happened in the observed session (validator rejected withREQUIRED_FIELD). The PR's explanation is that hydration short-circuits when the source key is missing oragent.jsonhas empty content — a domain expert should confirm this hydration contract is accurately described. - Storage bridge round-trip claim. Line 192 and line 275 warn that inserting placeholders into
inputs.systemPrompt/userPromptwill corruptagent.jsonvia the storage bridge. This is the key anti-pattern fix from the investigation. The claim is sourced fromagent-fields.ts— domain expert should verify.
Conclusion
The PR is well-researched and the corrections to the canonical inline-agent shape are clearly grounded in the investigation. The Edit Tooling section in editing-operations-json.md fills a real gap. The repair recipes in impl.md are prescriptive and copy-paste ready.
Two actionable items:
- Medium: Consider adding a smoke or integration test task that exercises inline-agent node creation with the updated
inputs.sourcecanonical shape — the new guidance paths are significant enough to warrant coverage. - Medium: The heredoc recipe pattern appears in 5 code blocks across 2 files. If the canonical shape changes, all need updating. The cross-reference from impl.md to
editing-operations-json.md#edit-toolingpartially mitigates this, but the specialized recipes don't inherit from the generic one — they're standalone copies.
The Low-severity line-number pointer fragility (line 158) is a minor nit — anchor links would be more durable but aren't blocking.
Overall: the PR improves the skill materially. The domain-accuracy questions in "Issues for Manual Review" should be confirmed by a domain expert before merge.
… impl note Address PR #517 review: - Replace `editing-operations-cli.md:158` line-number references with anchor links to the section heading (3 sites: investigation report, json reference, inline-agent impl) so they survive future reorganization. - Trim dense paragraph at inline-agent/impl.md following `node add` block: drop internal source-code citation and Jira ticket reference; surface the agent-actionable canonical-vs-legacy choice. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Review ResponseTriaged the bot review ( 1. Line-number pointer to Fixed in 81a58a4. All three sites now link to the section anchor 2. Dense paragraph after Fixed in 81a58a4. Dropped the internal 3. Long Keeping current implementation — the table row is the index entry; the dedicated Resolve a 4. Heredoc recipe duplicated across 5 code blocks in 2 files Keeping current implementation — the 5. No new test tasks for updated inline-agent guidance Keeping current implementation — existing coverage at 6. Domain-accuracy questions — Keeping current implementation — these claims are sourced from the investigation that produced this PR ( 🤖 Generated with Claude Code Co-Authored-By: Claude noreply@anthropic.com |
Review Response (round 2)Triaged 7 inline comments from @rockymadden and @cotovanu-cristian. Fixes pushed in 1. Investigation file should be removed pre-merge — Fixed in 2. Fixed in
The recommendation for direct-JSON authoring stays at 3. Version-specific framing in agent prompt — Fixed in 4. Fixed in 5. Keeping current implementation — but happy to sync. SKILL.md only declares If you'd rather the table be narrower — e.g., drop the Nits (none outstanding). Investigation file removed; canonical/legacy framing reconciled with workbench reality; agent.json notation disambiguated; version-specific framing dropped. 🤖 Generated with Claude Code Co-Authored-By: Claude noreply@anthropic.com |
… impl note Address PR #517 review: - Replace `editing-operations-cli.md:158` line-number references with anchor links to the section heading (3 sites: investigation report, json reference, inline-agent impl) so they survive future reorganization. - Trim dense paragraph at inline-agent/impl.md following `node add` block: drop internal source-code citation and Jira ticket reference; surface the agent-actionable canonical-vs-legacy choice. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
16e8035 to
b82f690
Compare
…e-agent validator workaround (MST-9263) Three skill edits addressing the gaps surfaced in MST-9263 (agent reaching for python3 heredocs while authoring a .flow): 1. inline-agent/impl.md — new Debug-table row for the `REQUIRED_FIELD systemPrompt/userPrompt` validator-vs-doc contradiction, prescribing single-character placeholders. Reconciled the matching "What NOT to Do" rule so it forbids real prompt content but permits placeholder values for the validator. 2. inline-agent/impl.md — new "Repair Recipes" section with two copy-pasteable python3 heredocs: "Replace a definition entry" (referenced by Debug row 188) and "Insert validator placeholders" (referenced by the new Debug row). 3. editing-operations-json.md — new "Edit Tooling" subsection prescribing the right mechanic per operation class (Edit / whole-file Write / python3 heredoc / jq), with one canonical heredoc recipe. Explicitly blesses python3 -c as a first-class authoring tool rather than an external escape hatch, since the CLI has no `node update` command.
…263) The prior commit (9aa783b) was based on an incomplete diagnosis that treated `[REQUIRED_FIELD] systemPrompt` as a registry/validator contradiction and prescribed inserting placeholder strings into `inputs.systemPrompt` / `inputs.userPrompt`. That workaround is actively harmful — flow-workbench's storage bridge (`packages/services/src/agent-storage/agent-fields.ts`: `inputsToStorage` / `storageToInputs`) round-trips between the node inputs and `agent.json.messages[]`, so placeholder strings overwrite the real prompts on the next save. Correct picture (with cli + flow-workbench in scope): - Canonical canvas write location for the inline-agent UUID is `model.source`, signaled by `model.source: true` in the manifest (`uipath-agent-autonomous/v1.0.ts:294`). - The validator's prompt hydration step (CLI: `flow-validate-service.ts:resolveAgentPrompts`) currently only reads `inputs.source` — that is the actual bug producing the `REQUIRED_FIELD` error. Tracked separately as a CLI-side fix. - `agent init --inline-in-flow` scaffolds `agent.json` with empty `messages[].content` by design — users must populate prompts before validate. Skill changes: - JSON Structure example uses `model.source` (canonical), `inputs: {}` (correct empty state for direct authoring), and a complete `model` block with serviceType / version / context. - Notes prose corrected: `model.source` is canonical, `inputs` is a storage-backed mirror (don't author there), prompts live in `agent.json.messages[]`. - `Add the node via CLI` correctly states `--source` populates `model.source` (matches `node-service.ts:535-545`). - Debug table: - Removed harmful "insert placeholder strings" row. - Added a `REQUIRED_FIELD systemPrompt` row that walks the actual diagnosis order: source-key location → subdir presence → `agent.json.messages[]` content. - Added a row about the storage-bridge round-trip clobbering inputs-side prompt edits. - "What NOT to Do": - Replaced harmful "do not put real prompt content; placeholders OK" bullet with two correct bullets: don't use `inputs.source`; don't author prompts on the node-side mirror. - Repair Recipes: - Removed harmful "Insert validator placeholders" recipe. - Replaced with a "Resolve REQUIRED_FIELD systemPrompt" walkthrough that diagnoses the source-key location, then directs the user to `agent.json` for prompt content. - Kept "Replace a definition entry" recipe — still useful for genuine definition rot. Tracked as MST-9263. Follow-up CLI / flow-workbench fixes on private branches.
…MST-9263) The prior commit (2625e1a) framed `model.source` as canonical and `inputs.source` as legacy. That's inverted. Per flow-workbench:packages/services/src/serialization/uipath-extension.ts:417-420 ("the agent's project UUID is stored as source in inputs (migrated from model). Fall back to element.model.source for legacy flows") and the comment at cli:packages/flow-tool/src/services/node-service.ts:532-534 ("flow-core 0.2.50 puts the source UUID in inputs.source — earlier versions used model.source"), inputs.source is the canonical post-migration location and model.source is the legacy shape kept for backwards compatibility. Bug surfaced by review feedback on the open PRs. Skill changes: - JSON Structure example uses `inputs.source` (canonical), drops the full `model` block on the instance (BPMN type/serviceType/version/ context all come from the definition; older `.flow` files may carry a partial model block from before the migration but new flows shouldn't). - Notes prose flipped: inputs.source canonical, model.source legacy fallback. New "No `model` block on the instance" note replaces the previous "model block carries BPMN type" framing. - "Add the node via CLI" now accurately documents that `node add` currently writes UUID to model.source (legacy) while canvas writes to inputs.source (canonical). The dual-key inconsistency between `node add` and the canvas is now flagged with a pointer to MST-9308. - Debug-table row for `[REQUIRED_FIELD] systemPrompt` rewritten to treat both keys as acceptable hydration inputs (canonical inputs.source preferred; model.source as legacy fallback). - Repair Recipe "Resolve REQUIRED_FIELD systemPrompt" rewritten: recipe #1 now adds inputs.source (canonical); the model.source-to-inputs.source migration recipe replaces the previous (wrong-direction) inputs-to-model recipe. - "What NOT to Do": - "Do not put UUID at inputs.source" bullet replaced with "Do not write UUID to a custom or invented key — set inputs.source." - "Do not put a model block on the instance" bullet now acknowledges that older flows carry it and that's tolerated as legacy compat. No content removed about the storage-bridge prompt-mirror behavior; that was correct and stays.
… impl note Address PR #517 review: - Replace `editing-operations-cli.md:158` line-number references with anchor links to the section heading (3 sites: investigation report, json reference, inline-agent impl) so they survive future reorganization. - Trim dense paragraph at inline-agent/impl.md following `node add` block: drop internal source-code citation and Jira ticket reference; surface the agent-actionable canonical-vs-legacy choice. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…l shape
- Drop docs/investigations/maestro-flow-python-script-gap.md (ephemeral
diagnosis artifact; both reviewers flagged it for removal pre-merge).
- Reframe inputs.source vs model.source: workbench manifest at
uipath-agent-autonomous/v1.0.0.ts declares model.source: true, so the
CLI and current canvas write model.source today. Document inputs.source
as the *skill convention* (planning.md, file-format.md already say so),
drop the "canonical post-flow-core-0.2.50" version-specific framing,
and acknowledge the unification refactor as a follow-up.
- Soften "no model block" to "no full model block" — the minimal
model: { source: <uuid> } shape is what the CLI writes today.
- Clarify agent.json.projectId notation (file-vs-path ambiguity) by
reading "the projectId field inside agent.json" everywhere.
17eaba5 to
a7c6c00
Compare
Address PR #517 review feedback from @andreibalas-uipath. The CLI PR UiPath/cli#1364 (merged 2026-05-05) makes `uip maestro flow node add ... --source <UUID>` write the projectId UUID to inputs.source and drop the model block entirely on inline-agent instances — matching Studio Web's persisted form. Updates: - Drop the dual-key "skill convention vs. runtime divergence" framing across all six sites in impl.md (line 75, 139, 173, 175, 202, 244, 284, 286). The CLI and Studio Web both write inputs.source now, so there is no divergence to document. - Reframe model.source as a legacy-fallback only — older .flow files may carry it; the validator still hydrates from there, but new authoring (CLI, canvas, direct-JSON) writes inputs.source. - "No model block on the instance" is now stated unconditionally (was: "no full model block; CLI writes minimal { source }"). - Repair Recipe step 1: prefer re-adding via CLI over hand-patching; legacy migration recipe (model.source → inputs.source) retained. - Remove the broken planning.md / file-format.md cross-reference (no longer load-bearing once the divergence framing is gone). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Review Response (round 3)Triaged @andreibalas-uipath's inline comment on 1. CLI now writes Fixed in a92481a. UiPath/cli#1364 (merged 2026-05-05) makes
🤖 Generated with Claude Code Co-Authored-By: Claude noreply@anthropic.com |
…low-python-script-gap # Conflicts: # skills/uipath-maestro-flow/references/author/references/plugins/inline-agent/impl.md
Summary
docs/investigations/maestro-flow-python-script-gap.md) tracing why an AI agent reached forpython3 <<'EOF'heredocs while authoring a.flowfor an inline-agent demo.editing-operations-json.mdblessingpython3/jqheredocs as the sanctioned mechanic for structural Direct-JSON mutations (since the CLI has nonode updatecommand — see MST-9303).inline-agent/impl.mdcovering the two scenarios that don't have a CLI shortcut today: replacing adefinitions[]entry, and resolving the[REQUIRED_FIELD] systemPromptvalidator error.inline-agent/impl.md: UUID atinputs.source(canonical post-flow-core-0.2.50), withmodel.sourcedocumented as a legacy fallback. Drops the verbosemodelblock from the JSON example since BPMN type / serviceType / version / context all come from the definition.Background
MST-9263. Updated diagnosis: https://uipath.atlassian.net/browse/MST-9263?focusedCommentId=3886871
Commits (in order)
49bc27fb— initial investigation report and root-cause writeup.9aa783bb— first attempt at skill fix; based on an incomplete diagnosis that prescribed inserting placeholder strings intoinputs.systemPrompt/inputs.userPrompt. Actively harmful — the storage bridge in flow-workbench'spackages/services/src/agent-storage/agent-fields.tsround-trips between the node andagent.json.messages[], so placeholders would have overwritten real prompts on the next save.2625e1ab— reverted the harmful guidance and prescribedmodel.sourceas canonical. Wrong direction;model.sourceis the LEGACY shape.d6a3034c— corrects the canonical/legacy framing per reviewer feedback. JSON example now usesinputs.source(canonical post-flow-core-0.2.50). Drops the verbosemodelblock from the example. Notes prose, "Add the node via CLI", Debug-table, Repair Recipe, and "What NOT to Do" all flipped to teachinputs.sourceas canonical andmodel.sourceas legacy fallback. Thenode addCLI quirk (still writesmodel.sourcetoday) is now flagged with a pointer to MST-9308.Kept the full commit history rather than squashing so the audit trail of corrections is preserved.
Test plan
→cross-references in the modified files resolve to existing anchors (verified withgrep -n)inline-agent/impl.mdmatches the canonical shape (UUID atinputs.source, nomodelblock on instance) — confirmed against canvas behavior at flow-workbenchserialization/uipath-extension.ts:417-420hooks/validate-skill-descriptions.shif the description field changed (it didn't — only body content)Out of scope
The CLI fix (read both source keys + enrich validator error) lives on
inline-agent-source-key-MST-9263in~/root/cli(UiPath/cli#1513). The flow-workbench docstring + regression tests live on the same branch in~/root/flow-workbench(UiPath/flow-workbench#1339). Skill-side: this PR. Five strategic follow-ups filed under epic MST-8796 (MST-9303 / 9304 / 9306 / 9307 / 9308).