REQ-INFER-026: A prompt that cannot fit the tier context is refused, never decoded

← Requirements

What it requires

  1. Given a prompt at or beyond context_length, When a turn is generated, Then the result carries ENTROPIC_ERROR_EVAL_CONTEXT_FULL, zero prefill tokens are decoded and no KV cache is cleared.
  2. Given a prompt one token short of the window, Then it is admitted.
  3. Given context_length unset (0), Then nothing is refused.
  4. Given the refusal reaches the agent loop, Then the run ends in AgentState::ERROR after exactly one generate call.
tier
NOT_RUN

Where it lives

  • src/inference6
  • src/core2

See it on the map

How it is met

implemented byresults (94 tests)context_fit_breakdowncontext_fit_overflowscontext_overflow_messagegenerate_batchhandle_terminal_finish_reasonsprefill_errorrefuse_over_contextrun_prefill_cached94 absent94 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (94)

Reached through calls

94 tests: 94 absent

testresultlinked byimplementers exercisedcalls away
the refusal names every number an operator needsabsentinferred2 of 8: context_fit_breakdown, context_overflow_message1
context_fit_overflows refuses only what genuinely cannot fitabsentinferred1 of 8: context_fit_overflows1
Basic response contains no special tokensabsentinferred1 of 8: handle_terminal_finish_reasons6
Batch generation worksabsentinferred1 of 8: handle_terminal_finish_reasons6
Budget-exhausted forced complete sets terminal_reason metadataabsentinferred1 of 8: handle_terminal_finish_reasons6
Circuit breaker limits tool calls per turnabsentinferred1 of 8: handle_terminal_finish_reasons6
Compaction fires when context exceeds thresholdabsentinferred1 of 8: handle_terminal_finish_reasons6
Compaction triggers at thresholdabsentinferred1 of 8: handle_terminal_finish_reasons6
Context accumulates across turnsabsentinferred1 of 8: handle_terminal_finish_reasons6
Context anchors persist across runsabsentinferred1 of 8: handle_terminal_finish_reasons6
Delegation directive triggers child loopabsentinferred1 of 8: handle_terminal_finish_reasons6
Delegation wiring fires on_delegation_start callbackabsentinferred1 of 8: handle_terminal_finish_reasons6
Dynamic identity creation and generation through engine loopabsentinferred1 of 8: handle_terminal_finish_reasons6
Empty response handled gracefullyabsentinferred1 of 8: handle_terminal_finish_reasons6
Engine state transitions include PLANNING and EXECUTINGabsentinferred1 of 8: handle_terminal_finish_reasons6
Finish reason length continues loopabsentinferred1 of 8: handle_terminal_finish_reasons6
Generate is called exactly once per iterationabsentinferred1 of 8: handle_terminal_finish_reasons6
Hooks fire in correct order during a generation cycleabsentinferred1 of 8: handle_terminal_finish_reasons6
Interrupt stops loopabsentinferred1 of 8: handle_terminal_finish_reasons6
MCP authorization denial propagates through engineabsentinferred1 of 8: handle_terminal_finish_reasons6
Max iterations stops loopabsentinferred1 of 8: handle_terminal_finish_reasons6
Metrics accurate after runabsentinferred1 of 8: handle_terminal_finish_reasons6
Multi-turn engine calls retain contextabsentinferred1 of 8: handle_terminal_finish_reasons6
Root conversation created at run() init when storage wired (gh#48)absentinferred1 of 8: handle_terminal_finish_reasons6
Route callback is invoked for tier selectionabsentinferred1 of 8: handle_terminal_finish_reasons6
Routing fires on_tier_selected callbackabsentinferred1 of 8: handle_terminal_finish_reasons6
Single iteration completesabsentinferred1 of 8: handle_terminal_finish_reasons6
Single-turn engine loop produces coherent responseabsentinferred1 of 8: handle_terminal_finish_reasons6
State transitions IDLE->PLANNING->EXECUTING->COMPLETEabsentinferred1 of 8: handle_terminal_finish_reasons6
Streaming generation worksabsentinferred1 of 8: handle_terminal_finish_reasons6
Streaming interrupt propagates to backend cancel chain absentinferred1 of 8: handle_terminal_finish_reasons6
Tier routing fires callbackabsentinferred1 of 8: handle_terminal_finish_reasons6
Tool call cycle: generate, parse, execute, generateabsentinferred1 of 8: handle_terminal_finish_reasons6
Tool call cycle: generate, parse, execute, regenerateabsentinferred1 of 8: handle_terminal_finish_reasons6
True end-to-end: real prompts, real engine, real modelabsentinferred1 of 8: handle_terminal_finish_reasons6
a context-overflow refusal fails the turn instead of retrying itabsentinferred1 of 8: handle_terminal_finish_reasons6
auto_chain child sets COMPLETE at depth > 0absentinferred1 of 8: handle_terminal_finish_reasons6
auto_chain does not fire without configabsentinferred1 of 8: handle_terminal_finish_reasons6
auto_chain root fires tier change at depth 0absentinferred1 of 8: handle_terminal_finish_reasons6
budget_exhausted child is relayed partial to lead (E2)absentinferred1 of 8: handle_terminal_finish_reasons6
delegation guards reject depth/cycle/repeat/pipeline-depthabsentinferred1 of 8: handle_terminal_finish_reasons6
delegation snapshot + per-tier metrics accumulationabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#105: constitutional validator's toolless render must NOT clobber absentinferred1 of 8: handle_terminal_finish_reasons6
gh#111: a delegation whose child produces raw UTF-8 content does not absentinferred1 of 8: handle_terminal_finish_reasons6
gh#111: a tool call whose arg carries raw UTF-8 is preserved, not absentinferred1 of 8: handle_terminal_finish_reasons6
gh#111: raw UTF-8 in backend-cleaned content is sanitized before it absentinferred1 of 8: handle_terminal_finish_reasons6
gh#119: delegation auto-complete folds child summary into lead's absentinferred1 of 8: handle_terminal_finish_reasons6
gh#121: zero-tool-call correction names tier's actual toolsabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#123 part 1: zero-tool-call counter resets after genuine tool call progressabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#123 part 2: zero-tool-call ceiling is per-tier configurableabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#123 part 3: prose-only nudge turn does NOT set failure_reason in metadataabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#123 part 4: ChildContextInfo.max_consecutive_empty_turns_override wired through engineabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#158: two concurrent runs accumulate metrics safelyabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#160: an isolated delegation never writes the project, and absentinferred1 of 8: handle_terminal_finish_reasons6
gh#162: a delegate seeded with context answers from the named absentinferred1 of 8: handle_terminal_finish_reasons6
gh#162: resume by target picks that tier's latest delegationabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#169: a capped loop carries its last real content, annotatedabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#169: a capped loop that produced nothing stays distinguishableabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#169: the parent relay receives the capped child's real workabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#181: a hard cut with nothing substantive stays distinguishableabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#181: a thinking-budget hard cut carries the run's real contentabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#181: the parent relay receives the hard-cut child's real workabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#183: a fresh top-level run still clears a stale interruptabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#183: a tier's identity overrides reach a top-level runabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#209/#212: a turn that ends in ERROR records why, for the callerabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#77: entropic.complete is terminal when emitted with sibling pipelineabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#80: a tool call resets the budget windowabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#80: budget off (default) does not gate a tool-call-free spiralabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#80: tokens budget nudges then hard-cuts a tool-call-free spiralabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#81: interrupt during tool processing halts before pending dispatchabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#81: run_loop(inherit_interrupt=false) clears a stale interruptabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#81: run_loop(inherit_interrupt=true) preserves a pre-set interruptabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#84 combined: should_stop halts the loop when the duplicate absentinferred1 of 8: handle_terminal_finish_reasons6
gh#84: a successful tool call DOES reset the budgetabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#84: rejected-duplicate tool calls do NOT reset the budgetabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#88 combined: process_tool_results defangs a meta {action} absentinferred1 of 8: handle_terminal_finish_reasons6
gh#88: a gemma multi-turn session never accumulates a parrotable absentinferred1 of 8: handle_terminal_finish_reasons6
hook dispatch: info / PRE_GENERATE cancel / POST_GENERATE rewrite / ON_ERRORabsentinferred1 of 8: handle_terminal_finish_reasons6
last_loop_metrics populated after runabsentinferred1 of 8: handle_terminal_finish_reasons6
max_iterations override caps loop before global limitabsentinferred1 of 8: handle_terminal_finish_reasons6
misc accessors: pause / context_usage / idle / project_dirabsentinferred1 of 8: handle_terminal_finish_reasons6
queue capacity / cap mutation / clear / observer / state slotabsentinferred1 of 8: handle_terminal_finish_reasons6
resume_delegation failure paths surface typed errorsabsentinferred1 of 8: handle_terminal_finish_reasons6
set_storage wiring covers init_session_conversation pathsabsentinferred1 of 8: handle_terminal_finish_reasons6
should_auto_chain false when no locked tierabsentinferred1 of 8: handle_terminal_finish_reasons6
v2.14.6: a lead that answers in prose is nudged, and its forced absentinferred1 of 8: handle_terminal_finish_reasons6
v2.14.6: after a nudge, a tier that owes a tool call is forced to make oneabsentinferred1 of 8: handle_terminal_finish_reasons6
v2.14.6: an empty turn is retried, never accepted as completeabsentinferred1 of 8: handle_terminal_finish_reasons6
v2.14.6: the model's own tool call stays in the history it is shownabsentinferred1 of 8: handle_terminal_finish_reasons6
v2.14.6: with thinking on, each loop turn ends in a real tool callabsentinferred1 of 8: handle_terminal_finish_reasons6
validation_provider variants are all non-fatalabsentinferred1 of 8: handle_terminal_finish_reasons6
zero-tool-call with explicit_completion halts within retry capabsentinferred1 of 8: handle_terminal_finish_reasons6
gh#182: a model-supplied max_turns bounds the delegated childabsentinferred1 of 8: handle_terminal_finish_reasons7
v2.14.6: after a prose answer is nudged, the forced retry may only absentinferred1 of 8: handle_terminal_finish_reasons7