fix(parser): map OMP parentSession header to ParentSessionID - #995
Merged
Conversation
OMP (Oh My Pi) v3 session headers record branch lineage as parentSession (a session ID), while upstream pi uses branchedFrom (a file path). parsePiLikeSession only read branchedFrom, so ParentSessionID stayed empty for branched OMP sessions and their lineage never resolved. Map header.parentSession to ParentSessionID as an OMP-only fallback when branchedFrom is absent, reusing the session's own idPrefix. Because parentSession is the parent's raw session ID and a session's stored ID is idPrefix + its session id, the mapped value equals the parent's stored ID. branchedFrom still wins when present, so upstream pi is unchanged.
roborev: Combined Review (
|
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.
OMP (Oh My Pi) v3 session headers record branch lineage as
parentSession— the parent's session ID — while upstream pi recordsbranchedFrom, a file path.parsePiLikeSessiononly readbranchedFrom, so branched OMP sessions never got aParentSessionIDand their lineage never resolved. Follow-up to #980, which made these sessions discoverable in the first place.This maps
header.parentSessiontoParentSessionIDas an OMP-only fallback whenbranchedFromis absent, reusing the session's own ID prefix. Because a stored session ID is the ID prefix plus the header's session id, andparentSessioncarries the parent's raw session ID, the mapped value equals the parent's stored ID and lineage resolves with no extra lookup.branchedFromstill wins when present, and pi sessions never consultparentSession, so upstream pi behavior is unchanged.Where to look: the branch-lineage block in
internal/parser/pi.go;TestPiProviderOMPParentSessionMatchesParentIDpins that a branched child's mappedParentSessionIDequals its parent's stored ID.Limitation: other OMP-specific entry types observed in the same investigation (
title_change,mcp_tool_selection,custom,custom_message,fileMention) still fall through silently; they carry no lineage information and are deliberately left as-is.