fix: add variable substitution to keys tool
Closed
TR
7mo ago+16+16+01234567890123456789-9-9-0123456789
- Check the documentation for relevant information
- Search existing issues to avoid duplicates
Fixes #1776
Fix
- Accept
variablesparameter inkeysTool(matchingtypeTool) - Call
substituteVariables()beforepage.type()in themethod === "type"branch - Pass
variablestokeysToolincreateAgentTools - Return original token in result to avoid exposing sensitive values to LLM
Summary by cubic
Fixes variable substitution in the keys tool when method="type" so %variableName% tokens are resolved before typing. Aligns behavior with the type tool and prevents secret leakage in tool outputs.
- Bug Fixes
- Substitute %variableName% in keys(method="type") via substituteVariables before page.type().
- Accept and pass variables to keysTool; update input schema to list available variables so the agent knows %var% syntax.
- Return the original token string in the tool result to avoid exposing substituted secrets.