fix(ce-sessions): add Pi agent session discovery and parsing#824
fix(ce-sessions): add Pi agent session discovery and parsing#824xavivars wants to merge 3 commits into
Conversation
Pi stores sessions at ~/.pi/agent/sessions/<encoded-cwd>/*.jsonl with a distinct JSONL format not recognized by any of the three session scripts. - discover-sessions.sh: add discover_pi() for ~/.pi/agent/sessions/ - extract-metadata.py: add try_pi() detector (type='session' + cwd field) and Pi message parsing in keyword extraction (type='message' envelope) - extract-skeleton.py: add handle_pi() for Pi's message/toolCall/toolResult structure; update auto-detection to recognize Pi sessions first - SKILL.md: document Pi as a 4th platform throughout - tests: add pi-session.jsonl fixture and Pi coverage across all test suites
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfd45e32df
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 485a6216e1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| for block in (content if isinstance(content, list) else []): | ||
| if block.get("type") == "text": | ||
| texts.append(block.get("text", "")) | ||
| text = clean_text(" ".join(texts)) |
There was a problem hiding this comment.
Parse string Pi user messages when building skeletons
Pi UserMessage.content can be serialized as a plain string, but handle_pi only iterates content when it is a list, so string-form user prompts are silently dropped from the skeleton. In sessions that use string content, this yields extracted transcripts with little or no problem statement context, which can mis-rank or mis-summarize prior work even though metadata detection succeeded.
Useful? React with 👍 / 👎.
Pi stores sessions at ~/.pi/agent/sessions//*.jsonl with a distinct JSONL format not recognized by any of the three session scripts.
Fixes #823