Repository navigation
fix(condenser): show the summarizer whole events, not their 500-char preview (v1.54.0 port) - #4
Conversation
…preview Port of a8babaa + 84b438a (fix/condenser-lossless-summary-input, the v1.44.1 line) onto ergatis-v1.54.0. This line still built the summarizer input from str(event), a display preview capped at N_CHAR_PREVIEW (500): - the previous summary was cut to its first 497 characters, so every condensation after the first dropped what the last one recorded; - an action rendered as its class name, with no command or arguments; - user messages and tool results lost everything past 500 characters. Measured on an Ergatis deployment: 142/142 summaries exceeded 500 characters; 107 condensations in 24 runs (57% of all agent actions) re-summarised a truncated summary. render_event_for_summary renders the previous summary whole, an action as tool + summary + thought + arguments, and results/messages/errors head and tail at max_event_length (10,000). The prompt (summarizing_system.j2 on this line) carries the previous summary forward and keeps user answers verbatim. A summarizer overflow retries with a cap that cuts the whole prompt by hard_context_reset_context_scaling, raising when nothing is left to cut; hard-reset retries use the same cap. The emitted summary is secret-masked (_mask_condensation), since the summarizer now sees raw tool arguments. Adapted to this line: generate()/agenerate() and the system/user prompt split; hard-reset shrinking measures the events it summarises (the leading SystemPromptEvent is preserved here).
|
Viper is reviewing this pull request — findings and a summary will be posted shortly. |
| other failure is raised at once. | ||
| """ | ||
| max_event_str_length: int | None = None | ||
| for _ in range(self.hard_context_reset_max_retries): |
There was a problem hiding this comment.
[Low] _summarize drives its shrink-and-retry loop with hard_context_reset_max_retries, a field documented as the number of hard context reset attempts. A user who lowers it to bound reset cost (e.g. to 1) now also caps summarizer shrink attempts at 1: the first context-window overflow computes a smaller cap but the loop has no second iteration, so it raises and forces the hard reset this PR is trying to avoid. Use a dedicated retry field (or at least document the shared meaning).
| "Summarizer context exceeded at every event length tried." | ||
| ) | ||
|
|
||
| async def _asummarize( |
There was a problem hiding this comment.
[Low] _asummarize is a line-for-line copy of _summarize (283-320) differing only in await self._agenerate_condensation, and the same overflow-shrink block is repeated in hard_context_reset (514-517) and ahard_context_reset (653-655). Extracting one helper keeps the retry/abort logic (including the <= 0 bail-out) from silently drifting between the four copies.
SummaryPorts the v1.44.1 condenser fix onto the v1.54.0 line so the summarizer consumes full events instead of 500-char display previews; the change is well-scoped and carries only non-blocking duplication/config findings. DescriptionReplaces the summarizer's input construction, which previously derived content from Walkthrough
Findings Overview
Narrative SummaryThis PR restores fidelity to the summarizer's input on the v1.54.0 line, where |
… condenser port
|
Viper is reviewing this pull request — findings and a summary will be posted shortly. |
SummaryThe production change is small and contained: DescriptionThis update ports the parallel MCP startup behavior: multi-server MCP configs no longer connect sequentially under a single caller timeout, so one unresponsive server cannot fail the entire Walkthrough
Findings OverviewAll findings are LOW severity and confined to
Narrative SummaryThis update ports concurrent multi-server MCP startup so a silent server no longer blocks every server’s tools, while preserving fastmcp’s mounting behavior and single-server path. The production change is narrowly scoped and no functional issues were identified. The remaining findings are test-quality issues: brittle timeout/timing assertions and a fixture ordering problem that can leak a server thread/port on slow startup. Prioritize fixing the fixture ordering first, then loosen the timing assertion to a stable message check. |
HUMAN:
AGENT:
Why
This ports #2 (the v1.44.1 line) onto
ergatis-v1.54.0. This line still builds the summarizer's input fromstr(event), a display preview capped at 500 characters:Measured on the Ergatis dev DB:
The full evidence is in #2 and Ergartis/ergatis#197.
Without this port, moving the Ergatis pin to the v1.54.0 line would silently drop the fix.
Summary
render_event_for_summaryrenders:The prompt (
summarizing_system.j2on this line) carries the previous summary forward.Overflow: a summarizer overflow retries with a cap that cuts the whole prompt by 20%, and raises when nothing is left to cut. The hard-reset retries use the same cap.
The emitted summary is secret-masked (
_mask_condensation).Adapted to v1.54.0:
generate()/agenerate();SystemPromptEventis preserved on this line.Issue Number
There is no issue in this fork. Related: #2, Ergartis/ergatis#197, and #1 / #3, now merged into the base.
How to Test
ergatis-v1.54.0(01b0de0e2: fix(mcp): connect multi-server MCP configs concurrently, with a per-server timeout (mirror of upstream #5720) #1 parallel MCP and test: make the retained Ergatis patch tests pass pre-commit (ruff, pyright) #3 pre-commit fixes), merged without a force-push.01b0de0e2alone it is 7,502 passed and the same 4 failed (OpenRouter model-catalog tests), so this adds 0 new failures.uv run pre-commit run --all-files: every hook passes.Type
Notes
cleanup-on-approvalfails on every PR in this fork (the upstream secret is missing).Validate PR descriptionneeds the human note above.ergatis-v1.54.0carries both fix(mcp): connect multi-server MCP configs concurrently, with a per-server timeout (mirror of upstream #5720) #1 and this PR, the Ergatis pin bump (Ergartis/ergatis#186) should point at that head.