fix(core): ignore exported Pi subagent artifacts - #147
Open
kongtou20070406 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
🟢 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-artifactsare 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
subagent-artifactsdirectories while discovering Pi JSONL sessionsEvidence
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 reportedcomplete: 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.