AI Agent / Tools Agent does not expose token usage when no tool is called (Anthropic + OpenAI); “intermediate steps” miss initial LLM call

When using the AI Agent / Tools Agent with an attached Chat Model (e.g., Anthropic Chat Model – Claude 3.7 Sonnet), the node output does not include token usage if the agent doesn’t invoke any tool.
Even with Return Intermediate Steps enabled, the initial LLM call made by the agent is not surfaced in runData, so there is no usage/tokenUsageEstimate available to downstream nodes. This makes accurate cost metering impossible for many agent runs.

By contrast, calling the provider node directly (e.g., Anthropic/OpenAI Chat node) returns tokenUsage/tokenUsageEstimate as expected.

Environment

  • n8n version: 1.90.3

  • Deployment: Docker

  • Anthropic Chat Model node version: 1.3

  • Model: Claude 3.7 Sonnet

  • Streaming: OFF

  • “Return Intermediate Steps”: ON

Steps to Reproduce

  1. Add Anthropic Chat Model (Claude 3.7 Sonnet). Leave defaults.

  2. Add AI Agent / Tools Agent.

    • Agent = Tools Agent

    • Return Intermediate Steps = ON

    • No tools configured or tools configured but not used by the prompt.