Skip to content

feat: support conversational runtime prompts - #1029

Open
radu-mocanu wants to merge 1 commit into
mainfrom
feat/conversational-runtime-prompt
Open

feat: support conversational runtime prompts#1029
radu-mocanu wants to merge 1 commit into
mainfrom
feat/conversational-runtime-prompt

Conversation

@radu-mocanu

@radu-mocanu radu-mocanu commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • resolve conversational advanced system prompts from each exchange input
  • preserve custom inputs, user settings, history, aliases, and internal field collisions
  • preserve assistant attachments and existing static prompt behavior

Why

PR #1016 added runtime prompt interpolation for autonomous advanced agents. Conversational advanced agents need the same behavior so custom inputs and user settings are resolved for every turn.

Validation

  • full pytest suite
  • mypy across the repository
  • Ruff lint and format
  • two independent adversarial reviews

Copilot AI review requested due to automatic review settings August 7, 2026 09:36

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.

Pull request overview

Adds runtime system-prompt interpolation to conversational advanced agents, aligning their behavior with autonomous advanced agents so per-turn exchange inputs (custom inputs/user settings) can be resolved into a system prompt once per invocation and applied to each Deep Agents model request, while preserving backward compatibility for static prompts.

Changes:

  • Extend create_conversational_advanced_agent_graph to accept a callable system_prompt, resolve it from exchange inputs, and inject it via _RuntimeSystemPromptMiddleware with collision-safe state keys.
  • Introduce a dedicated conversational input base model to preserve alias handling and message contract behavior, including support for user-supplied input_schema without dropping conversation messages.
  • Add comprehensive tests covering callable vs static prompts, alias serialization, schema/message preservation, internal-field collision avoidance, and Deep Agents prompt composition.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/uipath_langchain/agent/advanced/agent.py Implements per-exchange runtime system prompt resolution for conversational graphs and injects it into Deep Agents requests via middleware with collision-safe state keys.
src/uipath_langchain/agent/advanced/types.py Adds a conversational input base model with alias/name validation config to support reliable prompt input serialization and wrapper state composition.
tests/agent/advanced/test_conversational_advanced_agent_graph.py Adds test coverage for runtime prompt resolution, alias handling, collision safety, and Deep Agents request augmentation.
pyproject.toml Bumps package version to 0.16.2.
uv.lock Updates lockfile to reflect version bump.

@radu-mocanu
radu-mocanu force-pushed the feat/conversational-runtime-prompt branch 4 times, most recently from 7b02dc6 to b4a40b5 Compare August 7, 2026 15:09
@radu-mocanu
radu-mocanu force-pushed the feat/conversational-runtime-prompt branch from b4a40b5 to 5e7b175 Compare August 7, 2026 15:15
@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

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