Skip to content

pi: trim session overhead and surface context & full cost - #78

Merged
cmpadden merged 1 commit into
mainfrom
pi/session-efficiency
Dec 4, 2026
Merged

cmpadden merged 1 commit into
mainfrom
pi/session-efficiency

Conversation

@cmpadden

@cmpadden cmpadden commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Reduce per-turn prompt and tool overhead and surface token usage thresholds and full branch cost in the Pi status bar.

Changes

  • Remove rtk extension (pi/.pi/agent/extensions/rtk.ts): stops rewriting bash calls through rtk and avoids extra re-query turns when filtered output omits needed lines.
  • Disable agent-desktop by default (pi/.pi/agent/settings.json): excludes -extensions/agent-desktop/src/index.ts from startup loading while keeping the extension in the repo for on-demand use.
  • Surface token count, context thresholds, and full branch cost (pi/.pi/agent/packages/pi-minimal-prompt/extensions/editor.ts):
    • Displays compact token count alongside percentage (e.g. 142k (14%)) and handles null post-compaction usage safely.
    • Highlights context as warning at >= 150k tokens / 70% and error at >= 250k tokens / 90%.
    • Includes toolResult.usage.cost.total (such as delegated child runs) in the status bar cost total, with unit tests (pi/.pi/agent/packages/pi-minimal-prompt/tests/editor.test.ts).
  • Slim AGENTS.md (AGENTS.md, pi/.pi/agent/AGENTS.md): tightens instructions to reduce baseline context size and adds a gh pr diff pathspec reminder.

@cmpadden
cmpadden force-pushed the pi/session-efficiency branch from 92896b2 to 12f36d3 Compare December 4, 2026 17:53
@cmpadden cmpadden changed the title pi: trim session overhead, cap context, and surface full cost pi: trim session overhead and surface context & full cost Dec 4, 2026
@cmpadden
cmpadden merged commit 6b1096c into main Dec 4, 2026
1 check passed
@cmpadden
cmpadden deleted the pi/session-efficiency branch December 4, 2026 17:54
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.

1 participant