Skip to content

[pi-extension] Reflection Engine Improvements #33

Description

@codenamekt

Overview

Improve the reliability and quality of the session reflection feature.

Issues to Address

  • JSON parsing fails silently — extract JSON robustly (try multiple patterns, fallback to text extraction, log failures)
  • Hardcoded 4000 char slice — use token-aware truncation (~4 chars/token approximation)
  • No structured extraction metadata — extract richer info: project names, dates, decisions, follow-ups into memory metadata
  • No reflection model fallback — if primary model unavailable, try claude-haiku-4-20250514 as fallback before giving up
  • Reflection results not surfaced — show "N facts extracted, M stored" with option to review before saving (opt-in)

Acceptance Criteria

  • JSON parse failures logged with fallback text extraction
  • Token-aware truncation (approximate 4 chars/token)
  • Memory metadata includes extracted categories (project, decision, follow-up, etc.)
  • Model fallback chain: configured model → claude-haiku-4 → skip with warning
  • Optional review mode: show extracted facts before storing

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpi-extensionIssues related to the pi-extension integration

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions