REQ-COMPACT-002: Fill-gated tool-result pruning and persistent context anchors

← Requirements

What it requires

  1. Given context fill below warning_threshold_percent, When prune_old_tool_results runs, Then nothing is pruned; once fill crosses the threshold, TTL-aged results are stubbed.
  2. Given warning_threshold_percent = 0, Then pruning always engages.
  3. Given a pruned result, Then its original content is retained in metadata and a second prune pass leaves the stub untouched.
  4. Given a keep_recent count, When prune_tool_results runs, Then that many most recent results are left intact.
  5. Given an anchored message, When a second run() executes, Then the anchor is still present.
tier
NOT_RUN

Where it lives

  • src/core10

See it on the map

How it is met

implemented byresults (186 tests)begin_loop_preambledir_anchordir_pruneinject_context_warningprune_old_tool_resultsprune_tool_resultsreinject_context_anchorsremove_anchor_messagesrunrun_loop186 absent186 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (186)

Reached through calls

186 tests: 186 absent

testresultlinked byimplementers exercisedcalls away
gh#183: a tier's identity overrides reach a top-level runabsentinferred7 of 101
hook dispatch: info / PRE_GENERATE cancel / POST_GENERATE rewrite / ON_ERRORabsentinferred7 of 101
Basic response contains no special tokensabsentinferred6 of 101
Batch generation worksabsentinferred6 of 101
Budget-exhausted forced complete sets terminal_reason metadataabsentinferred6 of 101
Circuit breaker limits tool calls per turnabsentinferred6 of 101
Compaction fires when context exceeds thresholdabsentinferred6 of 101
Compaction triggers at thresholdabsentinferred6 of 101
Context accumulates across turnsabsentinferred6 of 101
Context anchors persist across runsabsentinferred6 of 101
Delegation directive triggers child loopabsentinferred6 of 101
Delegation wiring fires on_delegation_start callbackabsentinferred6 of 101
Dynamic identity creation and generation through engine loopabsentinferred6 of 101
Empty response handled gracefullyabsentinferred6 of 101
Engine state transitions include PLANNING and EXECUTINGabsentinferred6 of 101
Finish reason length continues loopabsentinferred6 of 101
Generate is called exactly once per iterationabsentinferred6 of 101
Hooks fire in correct order during a generation cycleabsentinferred6 of 101
Interrupt stops loopabsentinferred6 of 101
MCP authorization denial propagates through engineabsentinferred6 of 101
Max iterations stops loopabsentinferred6 of 101
Metrics accurate after runabsentinferred6 of 101
Multi-turn engine calls retain contextabsentinferred6 of 101
Root conversation created at run() init when storage wired (gh#48)absentinferred6 of 101
Route callback is invoked for tier selectionabsentinferred6 of 101
Routing fires on_tier_selected callbackabsentinferred6 of 101
Single iteration completesabsentinferred6 of 101
Single-turn engine loop produces coherent responseabsentinferred6 of 101
State transitions IDLE->PLANNING->EXECUTING->COMPLETEabsentinferred6 of 101
Streaming generation worksabsentinferred6 of 101
Streaming interrupt propagates to backend cancel chain absentinferred6 of 101
Tier routing fires callbackabsentinferred6 of 101
Tool call cycle: generate, parse, execute, generateabsentinferred6 of 101
Tool call cycle: generate, parse, execute, regenerateabsentinferred6 of 101
True end-to-end: real prompts, real engine, real modelabsentinferred6 of 101
a context-overflow refusal fails the turn instead of retrying itabsentinferred6 of 101
auto_chain child sets COMPLETE at depth > 0absentinferred6 of 101
auto_chain does not fire without configabsentinferred6 of 101
auto_chain root fires tier change at depth 0absentinferred6 of 101
budget_exhausted child is relayed partial to lead (E2)absentinferred6 of 101
delegation guards reject depth/cycle/repeat/pipeline-depthabsentinferred6 of 101
delegation snapshot + per-tier metrics accumulationabsentinferred6 of 101
gh#105: constitutional validator's toolless render must NOT clobber absentinferred6 of 101
gh#111: a delegation whose child produces raw UTF-8 content does not absentinferred6 of 101
gh#111: a tool call whose arg carries raw UTF-8 is preserved, not absentinferred6 of 101
gh#111: raw UTF-8 in backend-cleaned content is sanitized before it absentinferred6 of 101
gh#119: delegation auto-complete folds child summary into lead's absentinferred6 of 101
gh#121: zero-tool-call correction names tier's actual toolsabsentinferred6 of 101
gh#123 part 1: zero-tool-call counter resets after genuine tool call progressabsentinferred6 of 101
gh#123 part 2: zero-tool-call ceiling is per-tier configurableabsentinferred6 of 101
gh#123 part 3: prose-only nudge turn does NOT set failure_reason in metadataabsentinferred6 of 101
gh#123 part 4: ChildContextInfo.max_consecutive_empty_turns_override wired through engineabsentinferred6 of 101
gh#158: two concurrent runs accumulate metrics safelyabsentinferred6 of 101
gh#160: an isolated delegation never writes the project, and absentinferred6 of 101
gh#162: a delegate seeded with context answers from the named absentinferred6 of 101
gh#162: resume by target picks that tier's latest delegationabsentinferred6 of 101
gh#169: a capped loop carries its last real content, annotatedabsentinferred6 of 101
gh#169: a capped loop that produced nothing stays distinguishableabsentinferred6 of 101
gh#169: the parent relay receives the capped child's real workabsentinferred6 of 101
gh#181: a hard cut with nothing substantive stays distinguishableabsentinferred6 of 101
gh#181: a thinking-budget hard cut carries the run's real contentabsentinferred6 of 101
gh#181: the parent relay receives the hard-cut child's real workabsentinferred6 of 101
gh#183: a fresh top-level run still clears a stale interruptabsentinferred6 of 101
gh#209/#212: a turn that ends in ERROR records why, for the callerabsentinferred6 of 101
gh#77: entropic.complete is terminal when emitted with sibling pipelineabsentinferred6 of 101
gh#80: a tool call resets the budget windowabsentinferred6 of 101
gh#80: budget off (default) does not gate a tool-call-free spiralabsentinferred6 of 101
gh#80: tokens budget nudges then hard-cuts a tool-call-free spiralabsentinferred6 of 101
gh#81: interrupt during tool processing halts before pending dispatchabsentinferred6 of 101
gh#81: run_loop(inherit_interrupt=false) clears a stale interruptabsentinferred6 of 101
gh#81: run_loop(inherit_interrupt=true) preserves a pre-set interruptabsentinferred6 of 101
gh#84 combined: should_stop halts the loop when the duplicate absentinferred6 of 101
gh#84: a successful tool call DOES reset the budgetabsentinferred6 of 101
gh#84: rejected-duplicate tool calls do NOT reset the budgetabsentinferred6 of 101
gh#88 combined: process_tool_results defangs a meta {action} absentinferred6 of 101
gh#88: a gemma multi-turn session never accumulates a parrotable absentinferred6 of 101
last_loop_metrics populated after runabsentinferred6 of 101
max_iterations override caps loop before global limitabsentinferred6 of 101
misc accessors: pause / context_usage / idle / project_dirabsentinferred6 of 101
queue capacity / cap mutation / clear / observer / state slotabsentinferred6 of 101
resume_delegation failure paths surface typed errorsabsentinferred6 of 101
set_storage wiring covers init_session_conversation pathsabsentinferred6 of 101
should_auto_chain false when no locked tierabsentinferred6 of 101
v2.14.6: a lead that answers in prose is nudged, and its forced absentinferred6 of 101
v2.14.6: after a nudge, a tier that owes a tool call is forced to make oneabsentinferred6 of 101
v2.14.6: an empty turn is retried, never accepted as completeabsentinferred6 of 101
v2.14.6: the model's own tool call stays in the history it is shownabsentinferred6 of 101
v2.14.6: with thinking on, each loop turn ends in a real tool callabsentinferred6 of 101
validation_provider variants are all non-fatalabsentinferred6 of 101
zero-tool-call with explicit_completion halts within retry capabsentinferred6 of 101
gh#182: a model-supplied max_turns bounds the delegated childabsentinferred6 of 102
v2.14.6: after a prose answer is nudged, the forced retry may only absentinferred6 of 102
clear empties the queue without affecting capacityabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
concurrent enqueue + depth queries do not raceabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
gh#144: a second turn cannot start while one is in flightabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
gh#144: an unclaimed run_turn still reports itself runningabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
gh#144: exactly one of many racing claimants winsabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
gh#144: run_turn nested under an outer claim does not release itabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
gh#158: an unkeyed context read during a starting run cannot abortabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
gh#158: concurrent sessions are ON by defaultabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
gh#158: eight threads racing two keys yield exactly two winnersabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
gh#158: interrupt_session stops exactly one runabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
gh#158: the kill switch restores handle-wide serializationabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
gh#158: the run guard is scoped to the session keyabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
is_running false outside a turn, true inside run_turnabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
multiple queued messages drain in FIFO orderabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
queue rejects enqueue past capacityabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
queue starts empty and accepts enqueues up to capabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
queued message is consumed exactly at top-level COMPLETEabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
set_message_queue_capacity clamps negative to zeroabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
set_state_observer fires after set_callbacks shuffleabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
v2.14.0: cancelling one session's stream leaves other sessions runningabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages3
Configure with null JSON returns errorabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
Double-configure on one handle is refusedabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
Nemotron3-Nano-4B Q8 first inference does not crash (gh#66)absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
Three handles can coexistabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
Two GPU-resident handles can coexist (v2.2.8 target)absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
Two handles configure independentlyabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_configure called twice on the same handle returns ALREADY_CONFIGUREDabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_configure rejects NULL config_jsonabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_configure rejects NULL handleabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_configure_dir on /dev/null subpath returns an error, not an exceptionabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_configure_dir on a tmp dir runs the loader pathabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_configure_dir rejects NULL handleabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_configure_dir with empty string path returns an error code, not an exceptionabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_configure_from_file rejects NULL handleabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_configure_from_file rejects NULL pathabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_configure_from_file rejects missing fileabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_last_error reflects most-recent operation failureabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_last_error returns per-handle state (v2.2.6)absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_register_mcp_server on a configured handle absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_run_messages with console logging disabled still absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
entropic_seconds_since_last_activity returns 0 before any run absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#110: MTP engages through the real agent loop (entropic_run)absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#121 regression: configure populates engine's allowed_tools from identity frontmatterabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#144: concurrent bridge clients queue instead of racingabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#154 a tier grammar stem that cannot resolve YET still absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#154 a tier grammar stem that resolves still configuresabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#154 a tier with no grammar is unaffectedabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#154 entropic_metrics_json carries a generations arrayabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#156 a frontmatter-less app_context fails configure absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#156 a frontmatter-less constitution fails configure tooabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#156 a missing app_context path fails configureabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#156 a well-formed app_context file still configuresabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#156 app_context false still configuresabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#156 inline app_context content still configuresabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#158 entropic_interrupt_session targets exactly one runabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#163 entropic_configure carries app_context into ParsedConfigabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#163 entropic_configure_dir carries app_contextabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#163 entropic_configure_from_file carries app_contextabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#163 the object and false spellings survive configure_dir tooabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#164 entropic_release_model names an unknown tierabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#164 entropic_release_model refuses to unload mid-turnabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#165 entropic_session_context_set guards its preconditionsabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#165 entropic_session_context_set refuses the running sessionabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#165 entropic_session_context_set round-trips through the C ABIabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#175: a non-positive mcp.server_timeout_seconds is refused at configureabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#203: followup returns delegation_id and summary from real storageabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#204: an unservable http_port fails configure loudlyabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#95: identity grammar: field constrains that tier's outputabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
h1.run() after h2.configure() does not segfault (v2.2.6)absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages6
gh#158: interrupting one session leaves the other runningabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#158: metrics and context reads are safe during live runsabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#158: two concurrent sessions do not bleed into each otherabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#164: entropic_release_model frees VRAM through the C ABIabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#165 + gh#164: release the weights, keep the conversationabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#165: a dropped session restored from JSON keeps answeringabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#166: two workspaces on one handle do not read each other's absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#169: an iteration-capped delegate hands its parent the audit it absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#179: each workspace's sessions answer from its own app_context, absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#181: a delegate hard-cut by the thinking budget hands its absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#194: a plain generation publishes the prefill it performedabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#198: a deferred handle holds no GPU memory until it runsabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#204/gh#205: two HTTP clients, different session, workspace and absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#214: a prompt that does not fit fails the turn, typedabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#216: multi-byte text at the history cut does not poison later turnsabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#217: release is refused while another session is decodingabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#93: autoparser family parses a multi-parameter tool callabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#93: entropic_interrupt stops a long run early (cancel-bridge)absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#94: enable_thinking:false suppresses think blocks (facade)absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
gh#99: run_as emits each tier's grammar on a shared modelabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
outside-root optional: a real model's reads outside its root absentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
v2.14.1: a declared server serves each workspace from its own repositoryabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
v2.14.3: release frees the model over MCP and the conversation survivesabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
v2.14.4: a model's commit message with shell syntax is text, not a commandabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7
v2.14.5: a failed turn is an error carrying only its own textabsentinferred3 of 10: dir_anchor, reinject_context_anchors, remove_anchor_messages7