Your AI summarizer is leaking its own chain-of-thought. Here's the 30-line fix.
Dev.to AI
•
Generative AI
I caught my own production summarization API doing something embarrassing today, and I think yours might be doing it too. I sent it this: Quick test: Anthropic released Claude Opus 4 with extended thinking and a new agent SDK. It has 200k context and improved coding. It sent me back this: "summary": " \n Okay, the user wants a concise summary of the given text in 2-3 sentences. Let me read the original text again: \" Quick test: Anthropic released Claude Opus 4. \"\n\n First, I need to identify the key points.