fix: add variable substitution to keys tool

Closed
TR
7mo ago
+16-9

Fixes #1776

Fix

  • Accept variables parameter in keysTool (matching typeTool)
  • Call substituteVariables() before page.type() in the method === "type" branch
  • Pass variables to keysTool in createAgentTools
  • 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.