Repository navigation
Description
⚠ Agent-generated: This issue was drafted by an AI agent, not a human. Facts were gathered from the installed bb app, provider bridges, and CLI; please verify details before acting on them.
Related
#448 “Please add a way to compact threads” (closed as completed) covered /compact working on Claude and not on Codex; the Codex case was fixed. The pi provider was not covered there and the maintainer’s working assumption — “You should be able to /compact” — does not hold for pi threads. This issue is the pi-specific gap.
Summary
BB exposes no way to manually compact a thread's context when the thread runs on the pi provider. Typing /compact in the BB composer does nothing on a pi thread — the text is forwarded to pi's headless agent as an ordinary user message, and pi's RPC mode explicitly does not execute built-in TUI commands sent as prompts. On a claude-code thread, the exact same /compact message does trigger real compaction, because the Claude CLI parses slash commands from any user input. The asymmetry is confusing and undocumented.
Environment
- bb version: 0.35.1
- provider / harness: pi (headless via
bb-pi-bridge,pi --mode rpc), version 0.83.0; claude-code 2.1.221 for the comparison - model (relevant): deepseek v4 flash (large context window — auto-compaction fires rarely)
Repro
- Create/open a BB thread with provider
pi. - Type
/compactin the composer and send it. - Observed: the model receives "/compact" as a prompt and answers conversationally; no "Context compacted" entry appears in the timeline.
Same steps on a claude-code thread: the Claude CLI executes its built-in /compact, and BB records a "Context compacted" timeline entry.
Expected vs actual
- Expected: a way to manually compact a pi thread (a
/compactcomposer action, a thread action, or abbCLI command), or at least consistent behavior across harnesses — including/compactautocomplete in the composer, which Please add a way to compact threads #448 noted is missing. - Actual:
/compactis silently inert on pi threads (not even autocompleted) and works on claude-code threads; the only manual workaround is forking/starting a new thread.
Evidence / root cause
- BB itself has no native compaction control. There is no composer action named compact for any provider (pi:
{kind:"skills"}only; claude-code/codex: skills +/plan+/goal), no thread action, nobbCLI command, and no server endpoint. The server only records provider-initiated compactions —thread/compactedevents andcontextCompactionitems — and renders them as "Compacting context" → "Context compacted" timeline entries (onCompactionBegin/onCompactionEndinserver/dist/start-server.js). - pi has the capability but BB never calls it. pi ships a first-class RPC
compactcommand ({"type": "compact"}inpi --mode rpc) plus auto-compaction (threshold/overflow). But pi's docs state built-in TUI commands like/compactare "handled only in interactive mode and would not execute if sent viaprompt" — which is exactly what happens when the text is typed in BB's composer. Thebb-pi-bridgenever sends the RPCcompactcommand. - claude-code works by accident of forwarding.
bb-claude-code-bridgepasses user messages verbatim to the Claude CLI (pushInput({type:"user", message:{role:"user", content}})); the CLI processes slash commands from any user input (disableSlashCommandsis false), so/compactreaches Claude's own compaction, surfaced to BB via itsPreCompact/PostCompacthooks.
Suggested fix
Add a manual compact surface for pi threads — e.g. a /compact composer action or a thread action that sends pi's RPC compact command through the bridge. The capability exists end-to-end; only the UI trigger is missing. Ideally make it generic per provider: pi → RPC compact; claude-code → send /compact (already works) or use an explicit SDK path; codex → verify what exists before implementing.
Impact
Users of pi-powered threads (e.g. deepseek models with large context windows) cannot manually compact long sessions; they must fork or start new threads or wait for automatic threshold/overflow compaction. Low severity, but a real confusion risk given the claude-code behavior works.
Activity
ymichael commentedon Aug 7, 2026
hi darren - thanks for reporting this! will fix!
Add manual context compaction across providers (get-bb#1152)
Add manual context compaction across providers (get-bb#1152)