Skip to content

feat(cli): add Pi session support - #310

Open
NihaalManaf wants to merge 1 commit into
melagiri:masterfrom
NihaalManaf:feature/pi-session-support
Open

feat(cli): add Pi session support#310
NihaalManaf wants to merge 1 commit into
melagiri:masterfrom
NihaalManaf:feature/pi-session-support

Conversation

@NihaalManaf

Copy link
Copy Markdown

What does this PR do?

Adds Pi Coding Agent as a session source. The provider discovers ~/.pi/agent/sessions/**/*.jsonl, honors Pi's documented directory overrides, and normalizes prompts, assistant responses, thinking, tool calls/results, errors, compactions, token usage, and exact recorded costs.

It also adds Pi to CLI filters, telemetry detection, doctor validation, dashboard labels/colors, and user-facing documentation.

Type of change

  • Bug fix
  • New feature
  • Provider support (new source tool)
  • Documentation
  • Refactor / internal improvement

Related issue

Closes #309

Test plan

  • Ran pnpm test — 587 tests pass
  • Ran pnpm build — no build errors
  • Manually tested with real session data

Real-data validation discovered and parsed 405 Pi session files. The existing trivial-session filter imported 392 sessions and 45,620 messages. Database validation found globally unique message IDs and no session/message count mismatches. The dashboard, Pi source filter, stats, API response, and doctor provider check all worked.

Notes for reviewer

  • Pi entry IDs are short and forked sessions can copy parent entries. Message IDs are namespaced by session, and copied parent entries are excluded from child sessions to prevent collisions and double-counting.
  • Tool results are attached to their calling assistant message and truncated to the same bounded context style used by other providers.
  • Image blocks become [Image]; base64 image payloads are not copied into SQLite.
  • Pi compaction and branch-summary usage is included in aggregate token and cost totals.

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.

Add Pi Coding Agent session support

1 participant