Skip to content

fix(parser): map OMP parentSession header to ParentSessionID - #995

Merged
wesm merged 1 commit into
kenn-io:mainfrom
mjacobs:fix/omp-parentsession-lineage
Jul 4, 2026
Merged

fix(parser): map OMP parentSession header to ParentSessionID#995
wesm merged 1 commit into
kenn-io:mainfrom
mjacobs:fix/omp-parentsession-lineage

Conversation

@mjacobs

@mjacobs mjacobs commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

OMP (Oh My Pi) v3 session headers record branch lineage as parentSession — the parent's session ID — while upstream pi records branchedFrom, a file path. parsePiLikeSession only read branchedFrom, so branched OMP sessions never got a ParentSessionID and their lineage never resolved. Follow-up to #980, which made these sessions discoverable in the first place.

This maps header.parentSession to ParentSessionID as an OMP-only fallback when branchedFrom is absent, reusing the session's own ID prefix. Because a stored session ID is the ID prefix plus the header's session id, and parentSession carries the parent's raw session ID, the mapped value equals the parent's stored ID and lineage resolves with no extra lookup. branchedFrom still wins when present, and pi sessions never consult parentSession, so upstream pi behavior is unchanged.

Where to look: the branch-lineage block in internal/parser/pi.go; TestPiProviderOMPParentSessionMatchesParentID pins that a branched child's mapped ParentSessionID equals 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.

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-ci

roborev-ci Bot commented Jul 4, 2026

Copy link
Copy Markdown

roborev: Combined Review (d96bf2b)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 1m7s

@wesm
wesm merged commit 06f456e into kenn-io:main Jul 4, 2026
13 checks passed
@mjacobs
mjacobs deleted the fix/omp-parentsession-lineage branch July 6, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants