Skip to content

core(cache): apply %variables% substitution to goto tool + replay #2053

@BABTUNA

Description

@BABTUNA

Why

keys already supports %variableName% substitution in both live execution and cache replay, but goto currently uses raw URL text in both paths.

That causes variable-driven navigation instructions to drift between intent and execution, especially when cached runs replay navigation steps.

Gap

  • Live path: goto tool does not substitute %variable% tokens before page.goto(...).
  • Replay path: AgentCache does not substitute %variable% tokens when replaying cached goto steps.

Proposed fix

  • Add variable substitution in goto tool execution before navigation.
  • Keep recorded replay step URL tokenized (do not expand variables into cache records).
  • Apply variable substitution during AgentCache replay for goto steps.
  • Add focused unit tests for both live tool behavior and replay behavior.

Acceptance criteria

  • %variable% tokens in goto URLs are resolved before navigation.
  • Cached goto steps replay with variable substitution.
  • Existing goto behavior for non-variable URLs remains unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions