Skip to content

fix(composer): expand template expressions in elicitation messages#4313

Merged
amirejaz merged 3 commits intostacklok:mainfrom
saschabuehrle:fix/issue-4312
Mar 25, 2026
Merged

fix(composer): expand template expressions in elicitation messages#4313
amirejaz merged 3 commits intostacklok:mainfrom
saschabuehrle:fix/issue-4312

Conversation

@saschabuehrle
Copy link
Copy Markdown
Contributor

Bug

#4312 — Template expressions like {{.params.owner}} in elicitation step message fields are passed through as raw placeholders instead of being expanded.

Fix

Adds template expansion for step.Elicitation.Message in executeElicitationStep() before passing it to RequestElicitation(). This mirrors how executeToolStep() already expands step.Arguments through the template expander (line ~404).

The expansion wraps the message string in a temporary map to reuse the existing public TemplateExpander.Expand() interface, keeping the change minimal and consistent with the established expansion pattern.

Testing

  • Added TestWorkflowEngine_ElicitationMessageTemplateExpansion integration test that verifies {{.params.repo}} and {{.params.env}} placeholders in an elicitation message are expanded to their resolved values before reaching the SDK elicitation requester.

Happy to address any feedback.

Greetings, saschabuehrle

Copy link
Copy Markdown
Contributor

@jerm-dro jerm-dro left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up! Two requests before merging: avoid mutating the step definition (use an immutable assignment pattern), and restructure the test as table-driven with a few more cases. Details in the inline comments.

@saschabuehrle
Copy link
Copy Markdown
Contributor Author

Thanks for the review — I’ve gone through the requested changes and queued follow-up updates. I’ll push the revision in a dedicated follow-up pass.

@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Mar 23, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

❌ Patch coverage is 58.33333% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.57%. Comparing base (344907c) to head (e06c625).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
pkg/vmcp/composer/workflow_engine.go 58.33% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4313      +/-   ##
==========================================
+ Coverage   69.53%   69.57%   +0.03%     
==========================================
  Files         480      480              
  Lines       48641    48675      +34     
==========================================
+ Hits        33823    33865      +42     
+ Misses      12215    12201      -14     
- Partials     2603     2609       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@saschabuehrle
Copy link
Copy Markdown
Contributor Author

Pushed an update for both points.

The step config stays immutable now (message expansion happens on a copied elicitation config), and the integration coverage is table-driven with both templated and plain message cases.

Greetings, saschabuehrle

@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Mar 24, 2026
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Mar 25, 2026
@amirejaz amirejaz merged commit 132c67f into stacklok:main Mar 25, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants