Skip to content

fix(compaction): do not forward agent tools to summarization - #1069

Open
leeseunguk wants to merge 1 commit into
code-yeongyu:mainfrom
leeseunguk:fix/compaction-summarization-no-tools
Open

fix(compaction): do not forward agent tools to summarization#1069
leeseunguk wants to merge 1 commit into
code-yeongyu:mainfrom
leeseunguk:fix/compaction-summarization-no-tools

Conversation

@leeseunguk

@leeseunguk leeseunguk commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Summarization copied the live agent tool list into the summarizer request. Tool-preferring models (observed: openai-codex/gpt-5.6-sol) then ended the summary with stopReason: toolUse and no text. senpi treats that as empty-summary, rejects compaction, and leaves the session above the threshold.

This makes getSummarizationTools() return []. Summarization is a prose-only call.

Fixes #1067

Test plan

  • bun test test/compaction/summarization-no-tools.test.ts
  • Reproduce: compact a large session on a tool-preferring model; summarizer must not emit stopReason: toolUse / empty-summary.

Summary by cubic

Prevents tool-only summaries during compaction by not forwarding agent tools to the summarizer. Previously we copied the live tool list; now getSummarizationTools() returns [], so tool‑preferring models no longer stop with toolUse and empty text, and compaction can proceed.

  • Replaces inline tool forwarding with compactionSummarizationTools() that always returns [] and wires it into getSummarizationTools().
  • Adds a unit test ensuring no tools are forwarded even when the live list is non‑empty, and documents the change in changes.md.

Written for commit 35d9f06. Summary will update on new commits.

Review in cubic

Summarization is a prose-only call. Copying pi.getActiveTools() into
snapshot.tools lets tool-preferring models end the summary with
stopReason: toolUse and no text, which senpi rejects as empty-summary
and leaves the session above the compaction threshold.

Fixes code-yeongyu#1067
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.

Compaction summarization forwards agent tools and dies with empty-summary (stopReason: toolUse)

1 participant