Skip to content

Headroom proxy integration with AI session summaries and spend analytics#10

Merged
akhilsinghcodes merged 7 commits into
mainfrom
feature/headroom
Jun 17, 2026
Merged

Headroom proxy integration with AI session summaries and spend analytics#10
akhilsinghcodes merged 7 commits into
mainfrom
feature/headroom

Conversation

@akhilsinghcodes

Copy link
Copy Markdown
Owner

Summary

  • Headroom proxy routing: Added [headroom-shell] and [headroom-chat] session types that route Claude CLI and LiteLLM chat through the local Headroom context-compression proxy at http://localhost:8787
  • Token tracking fix: Fixed applyUsageTick guard to correctly strip the [headroom-shell]: command prefix before comparing, so in/out/cost stats are correctly tracked for headroom-shell sessions
  • AI session summaries: Added POST /api/sessions/:id/summary endpoint that calls gpt-4o-mini via LiteLLM to generate a title + 2–3 sentence summary; persisted as a session_summary artifact and surfaced as session_title in the session list sidebar
  • Headroom Spend Analytics tab: Replaced static Headroom card with a live iframe of the Headroom dashboard (/dashboard) plus a "Request Log" subtab that reads per-request data from data/headroom-requests.jsonl (written via --log-file flag)
  • Dev script fixes: Added port-kill-before-start for port 8787, suppressed PyTorch/tokenizer warnings, added --memory flag to enable cross-session context persistence, added inline torch install check with pip cache (non-blocking)
  • Session sidebar search: Added search box to filter sessions by command or title
  • Dashboard date/SQL fixes: UTC week alignment for date presets, AND command NOT IN ('zsh', 'bash') filter on all spend queries to exclude raw shell sessions
  • Docs: Added HEADROOM.md with setup guide and screenshots; updated README.md with all new features and 7 new screenshots

Test plan

  • Start dev with pnpm dev:one, confirm Headroom proxy launches on port 8787 without conflict
  • Create a [headroom-shell] session running claude, verify in/out/cost tokens update in real time
  • Open Spend Analytics → Headroom tab, confirm iframe loads and Request Log table populates after a few requests
  • Open any completed session → Artifacts → Generate Summary, verify title appears in sidebar
  • Restart the server, confirm Headroom dashboard retains lifetime stats from ~/.headroom/proxy_savings.json
  • Verify zsh/bash sessions are excluded from all spend analytics queries

@akhilsinghcodes akhilsinghcodes merged commit 5d1ed63 into main Jun 17, 2026
1 check passed
@akhilsinghcodes akhilsinghcodes deleted the feature/headroom branch June 17, 2026 09:41
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