Skip to content

fix(pi): accept Pi >= 1.x system and bashExecution message roles - #28

Open
honlu wants to merge 1 commit into
xhluca:mainfrom
honlu:fix/pi-v1-message-roles
Open

honlu wants to merge 1 commit into
xhluca:mainfrom
honlu:fix/pi-v1-message-roles

Conversation

@honlu

@honlu honlu commented Oct 26, 2026

Copy link
Copy Markdown

Pi 1.x sessions store the harness preamble as a leading 'system' message and record commands the user runs from the pi prompt (e.g. an editor launch) as 'bashExecution' messages. The v3 validator only accepted user/assistant/toolResult, so every newer Pi session failed migration with 'Pi message entry has an unsupported role'.

  • validate 'system' and 'bashExecution' message roles
  • project 'system' as a privileged system event (dropped deliberately by targets that refuse privileged roles)
  • project 'bashExecution' as a user message ('[bash] (exit N)') so user-run command history survives migration
  • allow these roles to omit the 'content' field, as Pi does

Verified end-to-end against real Pi 1.4.0 session files that previously required manual sanitization.

Pi 1.x sessions store the harness preamble as a leading 'system' message
and record commands the user runs from the pi prompt (e.g. an editor
launch) as 'bashExecution' messages. The v3 validator only accepted
user/assistant/toolResult, so every newer Pi session failed migration
with 'Pi message entry has an unsupported role'.

- validate 'system' and 'bashExecution' message roles
- project 'system' as a privileged system event (dropped deliberately
  by targets that refuse privileged roles)
- project 'bashExecution' as a user message ('[bash] <cmd> (exit N)')
  so user-run command history survives migration
- allow these roles to omit the 'content' field, as Pi does

Verified end-to-end against real Pi 1.4.0 session files that
previously required manual sanitization.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🟢 Contributor eligibility requirements met for @honlu.

  • 🟢 Account created: 2017-05-20; age: 3446 days (required: at least six calendar months).
  • 🟢 Contributions dated on or before 2026-09-26: 104 or more (required: at least 100).

Pull request authors must have a GitHub account at least six calendar months old and at least 100 GitHub contributions dated on or before the date one calendar month before the check.

See the contributor eligibility policy.

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