Entropic 2.14.3
Local-first agentic inference engine
Loading...
Searching...
No Matches
empty_content_diagnosis.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
27#pragma once
28
29#include <string>
30
31namespace entropic {
32
41
69 bool produced_tokens,
70 const std::string& finish_reason,
71 bool has_tool_calls) {
75 } else if (has_tool_calls) {
77 } else if (finish_reason == "length") {
79 } else if (finish_reason == "stop") {
81 }
82 return cause;
83}
84
94 // The gh#137 case deliberately does NOT mention max_tokens: the model chose
95 // to stop, so more budget changes nothing and naming it misdirects.
96 static const std::string kBudget =
97 "The generation hit its token budget while still inside a reasoning "
98 "block, so no answer was ever produced and the content is empty. This "
99 "is a budget problem: raise max_tokens for this tier.";
100 static const std::string kStopped =
101 "The model ended the turn while still inside an unterminated reasoning "
102 "block, so the content is empty. finish_reason is 'stop', NOT 'length' "
103 "— this is not a budget problem and raising max_tokens will not help. "
104 "The prompt or tier configuration is not converging on an answer.";
105 // gh#159: NOT a fault. `apply_adapter_parse` moves tool calls out of
106 // content, so a well-behaved sequential turn arrives here looking
107 // exactly like gh#137's failure. Says nothing about reasoning blocks,
108 // max_tokens or convergence — a consumer ACTS on those words.
109 static const std::string kToolCallOnly =
110 "The turn's entire output was tool calls, which the adapter moved out "
111 "of the content — nothing was lost. This is the expected shape for a "
112 "sequential tool-call tier and needs no tuning.";
113 static const std::string kUnknown =
114 "The turn produced tokens but delivered no content, and the finish "
115 "reason does not explain why. This is not a parse error; report it "
116 "with the raw generation attached.";
117
118 std::string out;
120 out = kToolCallOnly;
122 out = kBudget;
124 out = kStopped;
125 } else if (cause == EmptyContentCause::unknown) {
126 out = kUnknown;
127 }
128 return out;
129}
130
131} // namespace entropic
Activate model on GPU (WARM → ACTIVE).
@ optional
optional: every escape asks the host's path approver
EmptyContentCause diagnose_empty_content(bool content_empty, bool produced_tokens, const std::string &finish_reason, bool has_tool_calls)
Classify an empty-content turn from what the decode reported.
std::string explain_empty_content(EmptyContentCause cause)
Operator-facing explanation for an empty-content turn.
EmptyContentCause
Why a turn produced tokens but delivered no content.
@ budget_truncated
finish_reason == "length": ran out of tokens.
@ unknown
Empty for a reason this rule cannot attribute.
@ not_empty
Content survived; nothing to explain.
@ tool_call_only
The whole turn was tool calls — normal (gh#159).
@ model_stopped
Model ended the turn while still reasoning.