Skip to content

feat(middleware): add tool output summarizer - #1739

Open
bferanmi806-sketch wants to merge 2 commits into
RailtownAI:mainfrom
bferanmi806-sketch:contrib/tool-output-summarizer-1636
Open

bferanmi806-sketch wants to merge 2 commits into
RailtownAI:mainfrom
bferanmi806-sketch:contrib/tool-output-summarizer-1636

Conversation

@bferanmi806-sketch

@bferanmi806-sketch bferanmi806-sketch commented Oct 24, 2026 •

Copy link
Copy Markdown

Summary

  • Add a configurable model middleware that summarizes oversized text tool results before the next agent model call.
  • Bound summarizer input and output sizes, preserve tool call identity, and fall back to original output if summarization fails.
  • Document the prebuilt in the middleware catalog.

Related to #1636
Closes #1740

Verification

  • Focused tests: 7 passed.
  • Ruff check and format passed.
  • mypy passed for the new implementation.
  • uv run mkdocs build --strict passed.
  • Full unit-test collection is blocked by unrelated optional dependencies absent from this environment (FastAPI, DuckDB, NumPy, etc.).

This branch has not been deployed

No deployments
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.

Add a prebuilt tool-output summarizer middleware

1 participant