feat: support runtime system prompt interpolation in advanced agents - #1016
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for runtime-interpolated system prompts in the advanced-agent wrapper graph by allowing system_prompt to be provided as a callable, resolving it once from invocation inputs, and injecting it into Deep Agents model requests via middleware while avoiding input-schema key collisions.
Changes:
- Accept callable
system_promptincreate_advanced_agent_graph, resolve it duringtransform_input, and carry it via a dynamically-extended graph state key. - Introduce
_RuntimeSystemPromptMiddlewareand_allocate_runtime_system_prompt_keyto prepend runtime prompts to each model request and avoid schema/alias collisions deterministically. - Update tests to cover runtime prompt resolution, collision avoidance, request prepending behavior, and async middleware handling; bump package version to
0.14.20.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/uipath_langchain/agent/advanced/agent.py |
Adds runtime system-prompt middleware, state-key allocation logic, and callable system-prompt support in the advanced agent wrapper graph. |
tests/agent/advanced/test_create_advanced_agent_graph.py |
Adds test coverage for callable system prompts, collision handling, middleware request prepending, and async paths. |
pyproject.toml |
Bumps project version to 0.14.20. |
uv.lock |
Updates locked package version to 0.14.20. |
andreitava-uip
enabled auto-merge (squash)
July 31, 2026 09:44
radu-mocanu
reviewed
Aug 3, 2026
radu-mocanu
reviewed
Aug 3, 2026
radu-mocanu
approved these changes
Aug 3, 2026
andreitava-uip
force-pushed
the
feat/advanced-system-prompt-interpolation
branch
from
August 3, 2026 13:11
6135fc2 to
70d971e
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
create_advanced_agent_graphand resolve them once from invocation inputsuipath__system_promptby default and selecting the first available deterministic suffixuipath-langchainto 0.14.20Verification
uv lock --check