mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-13 04:01:43 +00:00
When the summarization LLM call returned an empty completion, compaction truncated the conversation anyway. `history.compact_from` discarded the summarized turns irreversibly, `CompactionCompleted` was emitted as if nothing had gone wrong, and the replacement system turn contained only the handoff preamble: "A different assistant began this task and produced the following summary" followed by nothing. The agent then continued with zero context while having been explicitly told a handoff summary existed. It presents to a user as the agent suddenly forgetting everything, and the only trace was a `debug!` line that is off by default, so there was nothing in production logs to correlate against. This is provider-independent. Any completion that comes back empty triggers it: a truncated stream, a reasoning model that spends its whole token budget on reasoning, or a rate-limit edge. Validate the summary before mutating history. A summary that is empty, whitespace-only, or shorter than 32 bytes after trimming is refused: the history is left fully intact and an error is returned instead. The threshold is deliberately far below any genuine summary — 32 bytes is shorter than a single source file path — because this guards against degenerate responses, not summary quality, and a false refusal would let the context keep growing. Structure is not validated, since a model may legitimately vary the requested section format. Returning `Err` is sufficient to surface the failure. `compact_if_needed` already converts it into an `AgentEvent::Error`, which lands in the run event stream and logs at ERROR via `AgentEvent::trace`, and the session continues rather than dying — behavior already covered by `compaction_failure_is_non_fatal`. The canned summary in `compaction_includes_structured_prompt_and_file_tracking` was 26 bytes, which the new guard rejects. That test verifies the summarization request prompt and file tracking, not minimum summary length, so its fixture is now a realistic summary. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| fabro-acp | ||
| fabro-agent | ||
| fabro-automation | ||
| fabro-checkpoint | ||
| fabro-dump | ||
| fabro-environment | ||
| fabro-github | ||
| fabro-graphviz | ||
| fabro-hooks | ||
| fabro-install | ||
| fabro-interview | ||
| fabro-llm | ||
| fabro-manifest | ||
| fabro-mcp | ||
| fabro-mcp-store | ||
| fabro-sandbox | ||
| fabro-slack | ||
| fabro-store | ||
| fabro-tool | ||
| fabro-tracker | ||
| fabro-validate | ||
| fabro-variable | ||
| fabro-workflow | ||