Back Home

GitHub Repo

Langflow Community Reports Prompt Caching Gap: Second-Level Timestamps May Block Reuse of Multi-Turn Conversation History

A Langflow community report on October 9 says a date field in the Agent’s default prompt injects a second-level timestamp on every run, which may prevent later turns from hitting the prompt cache. The report suggests using a date instead, but public performance measurements and verification of an official fix are still lacking.

Peo · CC BY-SA 3.0 · Image source
zh-Hant

On October 9, the Langflow GitHub community reported an issue with direct implications for agent costs: although the Agent’s default system prompt labels {current_date} as “today’s date,” the value actually injected is a UTC timestamp that includes hours, minutes, and seconds. The reporter identified Langflow 1.12.5 and a commit on the main branch as the relevant environments, and provided the code location and a way to inspect requests. The evidence currently consists mainly of code behavior analysis; no controlled cost or latency comparison was included. Original report

The issue stems from the ordering of the prompt. According to the implementation cited in the report, the tool-calling agent assembles the system prompt, conversation history, user message, and agent scratchpad in that order. When the second changes on the next run, the system prompt—which precedes the history—changes as well. Even if the history is identical, the old cached prefix containing that timestamp cannot be reused directly. The report also notes that steps within a single agent run still share a prompt, so the concern is cross-turn conversation reuse, not that every tool call necessarily misses the cache. Report and reproduction steps

This mechanism can be cross-checked against Anthropic’s official documentation: Claude prompt caching builds prefixes in the order of tools, system prompt, and messages, and a cache hit requires the corresponding content to match. Changes at the system level invalidate the cached messages that follow. However, tool cache entries established before the changing content may remain available, so the report should not be read to mean that all inputs are necessarily billed at full price. Claude prompt caching documentation

The reporter recommends having {current_date} output only the year, month, and day, with a separate optional field for the time. The engineering trade-off is that a date can keep the system prompt stable throughout the same day, while tasks that need the current time still require accurate information. Based on the cache-prefix behavior, teams could also consider placing volatile information after stable content. That is a design suggestion; teams still need to confirm whether the framework and model API support the required ordering.

Teams using Langflow to build long-running conversational agents should first compare the actual system prompts across consecutive requests, then monitor cache-read tokens and latency. To validate the effect, control for the model, prompt length, cache lifetime, and tool configuration so other causes of cache misses are not attributed to the timestamp. As of this review, there is no verified official fix or cross-provider measurement, so the actual savings remain unconfirmed.

Sources

  1. Agent current_date resolves to seconds precision, which breaks prompt-cache reuse for chat history
  2. Prompt caching