Skip to content

fix: all flows should respect model_metadata

What does this merge request do and why?

Closes #1581 (closed)

This change adds support for passing AI model information (like which specific AI model is being used) to the prompt system across multiple agent components.

Previously, when these components retrieved prompts from the prompt registry, they only passed basic information like prompt ID, version, and available tools. Now they also include the current model metadata (such as model name, provider, and display name) from a shared context.

This enhancement affects several types of agent components (Agent, OneOff, and HumanInput) across both experimental and production versions of the platform. The change allows prompts to be customized or optimized based on which AI model will be processing them.

The implementation safely handles cases where no model metadata is available by passing None instead. Comprehensive tests were added to verify that the model metadata is correctly passed from the context to the prompt registry, and that the system works properly when no metadata is present.

This is a foundational change that enables more sophisticated prompt management based on the specific AI model being used, potentially improving the quality and relevance of AI responses.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
  • If this change requires executor implementation: verified that issues/MRs exist for both Go executor and Node executor or confirmed that changes are backward-compatible and don't break existing executor functionality.

Closes #1581 (closed)

Merge request reports

Loading