An AI agent built on n8n, Redis, and LangChain, utilizing the DeepSeek V4 Pro model, encountered a recurring issue where it would stop responding to customer messages in Instagram Direct. The system, designed to manage CRM records in amoCRM, experienced failures where the model generated empty responses despite a 'success' status, leading to API errors during message delivery.

Investigation revealed that the agent’s system prompt, which grew to 6.4k tokens, contained strict deterministic constraints. When a user sent a message that did not trigger predefined scripts or tools, the model analyzed its potential responses against these prohibitions. Finding no compliant output, the model opted for silence as the safest path, resulting in 100% of tokens being spent on internal reasoning.

To resolve this, the developer introduced a 'Step 4: Small Talk' fallback in the system prompt, authorizing the model to generate polite, neutral responses when no specific task is identified. This change provides the model with a legal path to respond, preventing the 'Reasoning Lock' state where silence was previously the only compliant option.

Additionally, a validation layer was implemented in n8n using a code node. This validator detects empty content while verifying that tokens were consumed. If a failure is detected, the system triggers a retry mechanism with an expanded system prompt or, if that fails, sends a fallback message and logs the incident to Telegram for manual review.

The developer also configured the OpenRouter API to include reasoning tokens in logs using the 'include_reasoning' parameter. This allows for direct inspection of the model's internal decision-making process, helping to identify exactly which constraints triggered the silence. These updates have successfully eliminated empty responses for seven consecutive days.