Skip to content

Add CompressionFailurePolicy so a summarizer error no longer aborts the run#39

Merged
senamakel merged 2 commits into
tinyhumansai:mainfrom
M3gA-Mind:harness/summarizer-failure-policy
Jul 8, 2026
Merged

Add CompressionFailurePolicy so a summarizer error no longer aborts the run#39
senamakel merged 2 commits into
tinyhumansai:mainfrom
M3gA-Mind:harness/summarizer-failure-policy

Conversation

@M3gA-Mind

Copy link
Copy Markdown
Contributor

ContextCompressionMiddleware propagated a Summarizer error through before_model, aborting the whole run — precisely on the longest transcripts that reached the compaction threshold. The default ConcatSummarizer can't fail, so the gap was invisible in tests, but the trait allows Err.

This adds a CompressionFailurePolicy (Abort | FallbackTrim | PassThrough) on the middleware, defaulting to a deterministic front-drop trim to the policy's trigger budget (system messages preserved) and emitting a MiddlewareFailed diagnostic on fallback. Tests cover all three policies with a failing summarizer.

Commands run: cargo fmt, cargo test --lib (998 passed), cargo clippy --lib --tests -- -D warnings (clean for this change). Note: there is one pre-existing, unrelated clippy collapsible_if denial in src/harness/model/mod.rs from the current HEAD (#34), surfaced only by newer clippy; left untouched to keep this change focused.

Closes tinyhumansai/openhuman#4640

…he run

ContextCompressionMiddleware propagated a Summarizer error through
before_model, failing the whole run exactly on the longest transcripts
that reached the compaction threshold. Add a CompressionFailurePolicy
(Abort | FallbackTrim | PassThrough) on the middleware, defaulting to a
deterministic front-drop trim to the policy's trigger budget (system
messages preserved) and emitting a MiddlewareFailed diagnostic on
fallback. Add tests covering all three policies with a failing summarizer.
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9f6f9d82-1f32-4fb5-90a1-22b7a96384f6

📥 Commits

Reviewing files that changed from the base of the PR and between b1f0d82 and 1e9e515.

📒 Files selected for processing (5)
  • src/harness/middleware/library/context.rs
  • src/harness/middleware/test.rs
  • src/harness/middleware/types.rs
  • src/harness/model/mod.rs
  • src/harness/stream/mod.rs

Comment @coderabbitai help to get the list of available commands.

collapsible_if in StreamAccumulator::push_tool_chunk and a duplicated
#[cfg(test)] on the stream test module both fail CI's
cargo clippy --all-targets -- -D warnings under rust 1.96. Behavior-neutral.
@M3gA-Mind

Copy link
Copy Markdown
Contributor Author

CI guardian: the Rust SDK check was red on a pre-existing main clippy failure under stable rust 1.96 (a collapsible_if in StreamAccumulator::push_tool_chunk and a duplicated #[cfg(test)] on the stream test module), inherited by this branch. Pushed a behavior-neutral lint fix so CI can go green; no change to this PR's own logic.

@senamakel senamakel merged commit c18765b into tinyhumansai:main Jul 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TinyAgents][T2] Summarizer failure aborts the run — add CompressionFailurePolicy fallback

2 participants