One of the biggest challenges in observing AI agents is maintaining context across multiple API requests. When your agent makes a request to OpenAI or Anthropic, it is stateless. The model does not “remember” the previous request. Your agent framework (e.g., LangChain, AutoGen) maintains the conversation history and sends the entire array of messages back to the LLM. However, if you’re using a proxy like WhyOps, how do we know that Request B is a continuation of Request A?Documentation Index
Fetch the complete documentation index at: https://whyops.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
If you don’t explicitly pass a
traceId header, a proxy sees two separate requests. It doesn’t know they are part of the same agent execution.The WhyOps Solution: Invisible Signatures
WhyOps solves this natively by injecting Invisible Signatures into the LLM’s response before it reaches your application.How it works:
- Initial Request: Your agent sends a prompt to WhyOps. WhyOps generates a new
traceId(e.g.,1234-abcd). - Proxy to LLM: WhyOps forwards the request to the LLM provider (OpenAI, Anthropic).
- LLM Response: The LLM responds with a message (e.g.,
"The weather in Paris is 72°F."). - Signature Injection: Before WhyOps returns the response to your application, it encodes the
traceIdinto a sequence of zero-width Unicode characters (invisible to the human eye). It appends this invisible signature to the end of the LLM’s message content. - Next Request: Your agent receives the message (including the invisible signature) and stores it in its conversation history. When the agent makes its next request, it sends the entire history back to WhyOps.
- Signature Extraction: WhyOps scans the incoming request’s message history. It finds the invisible signature from the previous assistant message, decodes the
traceId, and uses it to link the new request to the existing trace.
Clean Execution
Crucially, WhyOps strips the invisible signature from the messages before sending them to the LLM. This ensures that:- The LLM does not see the invisible characters, preventing confusion or token waste.
- Your agent framework does not need to manage or pass trace IDs manually.
- The user experience is completely unaffected.
Example Flow (OpenAI /responses)
- Client sends a request to
/responses. - WhyOps proxy generates a
traceId. - Proxy passes request to OpenAI.
- OpenAI responds with
output[].content[].text. - WhyOps appends an encoded, zero-width string of the
traceIdto thetext. - Client stores the output text.
- Next request, client sends the history. WhyOps finds the zero-width string in
inputmessages, decodes thetraceId, strips it from the payload, and forwards it to OpenAI.
/chat/completions and /responses endpoints, as well as Anthropic’s /messages.