Skip to content

feat: round conversational agent time for better prompt caching [JAR-10325] - #1971

Open
maxduu wants to merge 2 commits into
mainfrom
convo-time-truncation
Open

maxduu wants to merge 2 commits into
mainfrom
convo-time-truncation

Conversation

@maxduu

@maxduu maxduu commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Jira

Reduces the granularity of conversational agent's time prompt to the nearest hour. This is for better prompt-caching behavior - in the past, the system prompt would change every minute. The LLM providers, like Claude, caches byte-by-byte from tools -> system prompt -> messages and would thus not hit the caching of the messages (which consists of most of the LLM-costs due to the conversation history).

We made the tradeoff to reduce granularity to the hour - that way, the caching would generally save costs on most turns unless crossing over hour boundaries (if the user is active on the chat for a while). And we would still preserve much of the old behavior if customers were using conversational agents' date+hour for logic or tools.

@maxduu
maxduu requested review from andrewwan-uipath and a balanced review from Copilot October 30, 2026 21:01
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Oct 30, 2026
@maxduu
maxduu requested a review from tudormatei1 October 30, 2026 21:01

Copilot AI 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.

🟢 Approval recommended

No active review issues are reported for the hourly UTC timestamp change intended to improve prompt-cache reuse.

No open issues 🎉

What changed in this PR

Reduces time-driven changes to conversational agents’ system prompts to improve prompt-cache reuse while preserving the current UTC date and hour.

Changes:

  • Displays UTC time rounded down to the hour in a readable date format.
  • Updates the prompt wording to make the reduced precision explicit.
  • Adjusts the test to verify the hourly timestamp and exclude the original minutes.
File Description
packages/​uipath/​tests/​agent/​react/​test_conversational_prompts.py Verifies the new date format and hour-level precision.
packages/​uipath/​src/​uipath/​agent/​react/​conversational_prompts.py Formats timestamps at hour-level precision and updates prompt wording.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown

🚨 Heads up: uipath-integrations cross-tests are FAILING 🚨

Your changes may break one or more integrations in uipath-integrations-python:

  • uipath-openai-agents
  • uipath-google-adk
  • uipath-agent-framework
  • uipath-llamaindex
  • uipath-pydantic-ai

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

🚨 Heads up: uipath-langchain cross-tests are FAILING 🚨

Your changes may break the uipath-langchain-python integration.

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants