Skip to content

fix(core): ignore exported Pi subagent artifacts - #147

Open
kongtou20070406 wants to merge 1 commit into
tommy0103:mainfrom
kongtou20070406:fix/pi-ignore-subagent-artifacts
Open

fix(core): ignore exported Pi subagent artifacts#147
kongtou20070406 wants to merge 1 commit into
tommy0103:mainfrom
kongtou20070406:fix/pi-ignore-subagent-artifacts

Conversation

@kongtou20070406

Copy link
Copy Markdown

Summary

  • skip subagent-artifacts directories while discovering Pi JSONL sessions
  • keep malformed files elsewhere fail-closed as before
  • add a focused discovery regression

Evidence

A real Pi root contained a 250 KB exported Luna worker transcript whose first record uses the subagent artifact contract, not Pi's required type: "session" header. Before this change every incremental build retried it and reported complete: false.

After the change, 20 repeated real-root Pi builds were complete with p95 35.09 ms. A combined Claude/Codex/Pi run was complete with p95 592.90 ms. The focused regression passes.

Copilot AI lite review requested due to automatic review settings September 3, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is narrowly scoped to discovery traversal, aligns with the stated behavior, and includes a targeted regression test covering the new ignore rule.

Pull request overview

This PR updates the Pi provider’s session discovery logic to skip exported subagent transcript directories (subagent-artifacts) so that non-Pi JSONL files in those locations don’t cause repeated fail-closed discovery behavior during incremental builds.

Changes:

  • Exclude directories named subagent-artifacts (case-insensitive) from Pi JSONL discovery traversal.
  • Add a regression test ensuring exported subagent transcript JSONL files under subagent-artifacts are ignored while valid Pi sessions are still discovered.
File summaries
File Description
tests/pi-parse.test.mjs Adds a focused regression asserting subagent-artifacts exports do not affect Pi discovery.
packages/core/src/providers/pi.ts Skips traversing subagent-artifacts directories during JSONL file inventory discovery.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants