Skip to content

test(model-onboarding): simple, tool-call, and file payloads per path#1007

Closed
denispetre wants to merge 6 commits into
mainfrom
feat/model-onboarding-payloads
Closed

test(model-onboarding): simple, tool-call, and file payloads per path#1007
denispetre wants to merge 6 commits into
mainfrom
feat/model-onboarding-payloads

Conversation

@denispetre

Copy link
Copy Markdown
Contributor

What

The model-onboarding testcase now exercises three capability payloads for every code path, not just file processing:

payload what it does
simple plain ainvoke; asserts a non-empty completion
tools full tool-calling round trip — bind get_weather, force the call, execute the tool, feed the ToolMessage back, assert the final answer uses the result
files/<name> one cell per selected file attachment (unchanged)

So azure_responses (for example) now produces simple, tools, files/image, files/pdf cells, all rolled into the single success boolean.

Notable

  • files may now be empty without losing coverage — simple + tools still run.
  • The tools payload is a full round trip (executes the tool and checks the final answer used the result), per request — stricter than a request-only check.
  • Backward compatible: input.json schema is unchanged; existing specs just gain the two new cell types.

Verification

Graph compiles and input.json validates against the updated schema. Round-trip logic verified with fake models covering happy path, no-tool-call, and ignored-result cases (all assert correctly). Live LLM runs happen in CI / on-demand dispatch (needs tenant auth).

…path

Previously each path only ran file-processing cells. Now every path runs
three capability payloads:

- simple: plain ainvoke, assert non-empty completion
- tools: full tool-calling round trip — bind get_weather, force the call,
  execute the tool, feed the ToolMessage back, and assert the final answer
  uses the result
- files/<name>: one cell per selected file attachment (unchanged behavior)

files can now be empty without losing coverage: simple + tools still run.
Round-trip logic verified with fake models (happy path, no-call, and
ignored-result all assert correctly). README updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 24, 2026 07:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

denispetre and others added 3 commits July 24, 2026 11:40
The vertex path relied on autodetection to reach the Google class, so the
GENERATE_CONTENT api_flavor was only covered by default, not by intent. Pin
vendor_type=VERTEXAI + api_flavor=GENERATE_CONTENT so the flavor is exercised
deterministically. Verified the path forwards both args to the factory.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ucture

Introduces testcases/model-onboarding/src/agents/ as a container for coded
(LangGraph) agents run by the onboarding matrix, so more agents can be added
as sibling subfolders and registered in AGENT_REGISTRY.

First agent: file_processing — reads a PDF/image and answers a task. It is the
coded equivalent of a low-code UiPath agent (FileProcessingAgent) built and
validated in Studio Web/Agent Builder; that low-code source of truth is kept
alongside under file_processing/lowcode/ (agent.json + Analyze Files tool).
No automated low-code->coded eject exists, so agent.py is a faithful
re-implementation with the system prompt kept in sync.

The file payload in main.py now routes through the coded agent. The agent
receives the model built from model_spec, so model + API flavor stay
configurable and the run.sh / input.json / model_spec Action contract is
unchanged. Verified: graph compiles, input.json validates, and `uipath init`
loads the graph (imports the agents subpackage) successfully.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…avor

Adds agents/is_tools: for each configured flavor the model under test binds
an Integration Service activity tool, is forced to call it, the activity
executes through a real IS connection, and the result feeds back into a
final answer (full round trip). Cells appear as is_tools/<flavor>.

Six flavors, built from live `uip is resources describe` output (paths,
query/path/multipart routing, required fields all verified): azure_openai,
openai, openai_v1, bedrock_converse, vertex, anthropic. Bedrock's IS
connector exposes only converse. Multipart activities (openai, bedrock,
vertex) use json_body_section="body"; azure carries modelId in query,
vertex modelName in path.

Config via model_spec.is_tools in input.json: flavors, per-flavor connection
id overrides, per-flavor vendor model overrides. Defaults target the
llm_gateway_automated_testing alpha tenant (connections verified Enabled via
ping). Live smoke: anthropic flavor invoked end to end through the real
gateway ("OK", end_turn); openai_v1 default model needs a Foundry deployment
name — documented as configurable.

Verified: graph compiles, input.json validates, all 6 builders produce
coherent shapes, mocked round trips pass for all flavors, failure modes
(no tool call / unknown flavor / IS exception) are legible.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@denispetre

Copy link
Copy Markdown
Contributor Author

Added a fourth payload: is_tools — IS activity tools per API flavor (commit e011df8)

Per flavor, the model under test binds an Integration Service activity tool, is forced to call it, the activity executes through a real IS connection, and the result feeds a final answer (full round trip). Cells: is_tools/<flavor>.

flavor connector / activity body style
azure_openai microsoft-azureopenai / generateChatCompletionConsolidated JSON + modelId query
openai openai-openai / v2::chat::completion multipart (body JSON part)
openai_v1 openai-openaiv1compliant / chatCompletion JSON
bedrock_converse aws-bedrock / completion::converse multipart + modelName query
vertex google-vertex / textCompletionUsingGemini multipart + modelName path
anthropic anthropic-claude / messages JSON

All shapes built from live uip is resources describe output; all six default connections verified Enabled via ping. Live smoke: the anthropic flavor ran end to end through the real gateway ("text": "OK"). Configurable via model_spec.is_tools (flavors / connections / models) — defaults target the llm_gateway_automated_testing alpha tenant; other orgs must override connections. Note: azure/foundry-backed flavors need connection-specific deployment names (a wrong one fails legibly with DeploymentNotFound, observed live).

Cost note: cells run per path × per flavor (each ≈2 model calls + 1 IS call) — trim flavors or paths in input.json for cheaper runs.

denispetre and others added 2 commits July 24, 2026 18:27
…ents

Both test agents are now the coded agents generated by Studio Web's "Clone
as Coded Agent" from their low-code twins, downloaded via `uip agent file
get` and adapted with exactly one structural change: the module-level
hardcoded llm becomes build_graph(llm, ...) so the testcase injects the
model built from model_spec (model + API flavor stay configurable). The
pristine generated sources are kept under each agent's coded-copy/ dir and
utils.py is the generated interpolation helper, verbatim.

file_processing: production ReAct stack (create_agent + Analyze Files
internal tool); the adapter uploads the test file as a real platform
attachment and invokes the generated graph.

is_tools: replaces the hand-rolled LLM-gateway flavor registry with the
generated Slack Send Message to Channel + Outlook 365 Send Email Activity
tools (create_integration_tool + AgentIntegrationToolResourceConfig).
IsToolsSpec becomes {connections: {slack, outlook}, prompt}; the cell is
skipped when no connections are configured because a run performs real
communication actions. Connection ids are injected into the generated tool
configs (typed attribute path); create_agent returns an uncompiled
StateGraph so adapters compile before invoking.

Verified: graph compiles, input.json validates, both build_graphs construct
(is_tools under stub auth env; create_integration_tool builds UiPath() at
tool-creation time), guards are legible, and `uipath init` loads the graph.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per review: the onboarding test only needs the model to produce the tool
call, not to execute it. run(model, prompt) now binds the generated Slack +
Outlook Activity tools, sends the exact production messages
(create_messages), and asserts >=1 well-formed tool call back: known bound
tool name (the factory underscores display names -> Send_Message_to_Channel,
Send_Email) and required args present (channel+messageToSend /
message.toRecipients). Tools are never executed, so no IS connections are
needed, nothing is sent, and the cell now runs on every onboarding pass.

IsToolsSpec drops connections (prompt only); build_graph(llm, connections)
remains for deliberate full executed runs. Verified all outcomes with fake
models: both-tools ✓ with names, missing-args ✗, unknown-tool ✗, no-call ✗;
graph compiles and input.json validates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@denispetre

Copy link
Copy Markdown
Contributor Author

Superseded by the clean-diff PR: same final state (four payloads incl. call-only is_tools, Studio Web coded-copy agents) without the intermediate churn. See the new PR referenced above.

@denispetre denispetre closed this Jul 24, 2026
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.

2 participants