[fix]: harden act variables prompt

Merged
SE
8mo ago
+17-17

why

  • models would sometimes respond with the variable name without wrapping it in percentage signs.
  • when this happens, the regex would fail to replace the variable name with the actual variable value

what changed

  • adjusted the prompting for the condition when variables are provided by the user
    • the updated prompting is more specific around what the variables are used for, and the required return shape.

test plan

  • existing act evals

Summary by cubic

Hardened the act variables prompt so models always return argument placeholders as %variableName%, preventing failed variable substitution. Also clarified the element ID format with concrete examples.

  • Bug Fixes

    • Added explicit, repeated guidance to use %variableName% in the arguments array when variables are provided.
    • Improved element ID schema description with examples like '0-76' and '16-21'.
  • Refactors

    • Introduced buildActVariablesPrompt() and reused it in both act and step-two prompts to keep messaging consistent and avoid duplication.