Repository navigation
AgentCore 0.15.0
Changed
-
Empty completion recovery now runs inside one logical
call_llminvocation in both chat and streaming modes.empty_completion_max_retries(default 2, also available to direct callers) supplies same-leg resamples independently of the genericmax_retriesallowance; the original logical/wall deadlines bound backoff and native fallback advances. Empty attempts are emitted as discarded/failed with reasonempty_completion, including separately identified failed tool-argument replays, and the loop stops withempty_completionafter terminal exhaustion. Native and nestedLLMFallbackChainrouting uses independent per-call cursors, preserves bindings and middleware, respects trigger barriers, and supports an explicitempty_completiontrigger. Direct fallback streams buffer candidate-empty deltas until a real signal commits the leg, preventing discarded tool-argument fragments from contaminating a fallback response. The cooldown wrapper detects blanks before applying its existing policy. Consumers relying on streaming retry counts, stop/error reasons or accepted-attempt metrics should adopt these unified semantics.LLMResponseandStreamDeltagain optionalusage_sourceprovenance; adapters mark provider reports, while wrappers should mark synthetic counts asestimatedor retainestimated: truein usage maps. Reported zero usage remains distinct from estimates. OpenAI Chat/Responses refusal fields and events are preserved, and explicit refusals/content filters now terminate under their own stop reasons even with a nudge policy, without executing accompanying tool calls. Product wrappers opting into native delayed-assembly failover must explicitly implementfor_logical_callandadvance_empty_completionwhile preserving themselves; dynamic attribute forwarding alone is not opt-in.Empty OpenAI refusal placeholders beside text, tool calls or reasoning are ignored. Streams infer an otherwise empty refusal only at normal EOF, including clean closes without a finish-reason chunk; exceptions and cancellation preserve their original failure semantics.
Streamed middleware now receives terminal usage/provenance, provider/model and rejection metadata plus named native tool calls. This restores streamed token/cost accounting and loop detection. Estimates stay diagnostic and do not charge real cost, task budgets or billing aggregates; canonical cache read/write fields preserve zeros and cache-only reported calls. Rate correction handles zero estimates and real zero usage against each limiter's actual capped reservation, while unknown/estimated usage keeps the reservation. Failed or consumer-closed tool proposals are excluded from repeat detection even when their authentic reported usage is accounted. Reported streaming usage/cost and budget consumption will increase from the old undercount; downstream budgets/alerts should be recalibrated. The legacy CostSink signature remains unchanged; cache-aware aggregators receive the separate read/write fields.
Fixed
- Retry Anthropic and OpenAI-compatible streams that close before a completion signal, preventing partial responses from silently ending an agent run. Truncated streams are classified
truncated_stream: resampled on the same key, or advanced to the next provider when a fallback chain is active. The Chat Completions[DONE]check reads decoded bytes, so gzip/deflate-encoded event streams are handled. Responseserrorevents now surface their code and message.AGENT_CORE_STREAM_REQUIRE_TERMINATOR=0accepts unterminated streams with a warning, for gateways that never send a terminator.