fix(pi): skip unparseable session lines instead of failing the read#121
Open
akesling wants to merge 1 commit into
Open
fix(pi): skip unparseable session lines instead of failing the read#121akesling wants to merge 1 commit into
akesling wants to merge 1 commit into
Conversation
|
🔍 Preview deployed: https://ede30cbf.toolpath.pages.dev |
akesling
added a commit
that referenced
this pull request
Jul 8, 2026
Behavior-adding changes on this branch (pi metadata entries via events; opencode user model + snapshot-SHA events). The .1 patch numbers are claimed by sibling PRs #121/#122 currently in flight, so both crates skip to .2. All five sites updated: crate Cargo.toml, root workspace dependency, site/_data/crates.json, CHANGELOG top section, Cargo.lock. No path-cli / toolpath-cli / toolpath-convo bumps.
akesling
commented
Jul 10, 2026
| @@ -220,10 +220,12 @@ pub fn read_session_from_file(path: &Path) -> Result<PiSession> { | |||
| continue; | |||
| } | |||
| Err(_) => { | |||
Contributor
Author
There was a problem hiding this comment.
Shouldn't we print the actual error? Also, this reader isn't the right place to make the decision on whether to strictly skip or not, depending on the error. We should probably bubble the set of errors found up to the caller to make a decision as to how to handle it.
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.
Root cause
A crash-truncated final line (invalid JSON) in a Pi session JSONL hard-failed the entire session read in
read_session_from_file(crates/toolpath-pi/src/reader.rs). The session would still list fine (io.rsis tolerant), but refuse to load. Sibling cratetoolpath-codexalready documents skip-and-warn as the safe reader policy for exactly this scenario (toolpath-codex/src/reader.rs).Fix
The non-header entry-parse
Errarm now skips the unparseable line with a warning (path, line number, parse error) instead of returningErr— matching both the codex policy and Pi's own existing unknown-entry-type branch style. Header parsing is unchanged: a session without a parseable header still hard-fails (no identity without it).Tests
Three new tests in
reader.rs(TDD; first two red before the fix):Full workspace suite + clippy green.
toolpath-pibumped 0.6.0 → 0.6.1 (crate, workspace dep, crates.json, CHANGELOG, Cargo.lock).Notes
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.