code-yeongyu / code-yeongyu/senpi
Compaction summarization forwards agent tools and dies with empty-summary (stopReason: toolUse)
- Dominant language
- TypeScript
- Stars
- 429
- Forks
- 98
- Avg merge
- 5h 3m
- Merged PRs (30d)
- 526
Description
## Bug
Compaction summarization copies the live agent tool list into the summarizer request (`getSummarizationTools()` → `snapshot.tools`). The summarizer is only allowed to return text. Models that prefer tools (observed: `openai-codex/gpt-5.6-sol`) end the summary turn with `stopReason: toolUse` and no text.
`getSummaryText()` only joins `content.type === "text"`, so the empty body becomes:
```
SummaryGenerationError("empty-summary", "summarization response contained no text (stopReason: toolUse)")
```
Core then rejects compaction (`Compaction rejected: …`). Tokens stay at the pre-compact size, so the next turn dies with `Context remains above the compaction threshold because compaction did not complete`, and any queued prompt is restored to the editor.
## Evidence
Session `01a01fae-c131-75dc-afcb-096fad433a6f`, 2026-08-21T07:44:21–07:44:30Z, `tokensBefore=257136`. Auto compact, retry, and manual `/compact` all rejected with the same empty-summary `toolUse`. `compaction/changes.md` (2026-07-21) already documents that forwarding tools can produce a bare tool call.
## Expected
Summarization requests send `tools: []`. A summary is prose, not an agent turn. Anthropic anti-distillation was the original reason to look like a normal agent request; that does not apply to GPT/Grok compact, and it makes compact fail closed.
## Environment
omo-ai 5.0.0-0.beta.11 / senpi 2026.8.18-3, also present on origin/main (`getActiveTools().flatMap` in `builtin/compaction/index.ts`).
Contributor guide
Research direction
Start in builtin/compaction/index.ts, especially the getActiveTools() and summarization path described in the issue, and read compaction/changes.md for context. Confirm the summarizer request sends an empty tools list and that the cited toolUse case produces prose rather than empty-summary; run the relevant compaction checks if available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100