Skip to content

Conversation

@Vishesh-Paliwal
Copy link
Contributor

This PR aims to fix issue #3700

Problem :

The Agenta SDK's curly template formatter ({{var}} syntax) raises TemplateFormatError when a substituted input value contains the same {{variable_name}} patterns used in the template itself. The SDK performs a post-substitution validation that detects these patterns in the final text and treats them as unreplaced variables.

Proposed Solution :

Instead of post-substitution validation , I am proposing we keep two sets

  • replacements dict , which we already have
  • successfully replaced set containing keys which we were able to replace successfully

hence we will in first pass over the prompt , keep checking if our matched regex is in replacement dict , then we will add that key to successfully replaced set . Therefore true failures or truely_unreplaced keys = original_placeholders - successfully_replaced_placeholders .

Attaching the images for reference :

Old Flow :
Screenshot 2026-02-11 at 3 27 33 AM

New Flow :
Screenshot 2026-02-11 at 3 29 43 AM

@vercel
Copy link

vercel bot commented Feb 10, 2026

Someone is attempting to deploy a commit to the agenta projects Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Vishesh Paliwal seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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