Repository navigation
fix(sessions): classify nested subagent children by layout - #77
Merged
Conversation
pi-subagents 0.77.0 writes a parentSession header into nested child session files (#2763), so the generic fork branch shadowed the pi-subagents layout heuristic: children landed in the Sessions list with an empty family and the Agents tab disappeared. Check the nested layout first; legacy readSubagentRun metadata still resolves first.
dreadster3
deleted the
pi-subagents/worker-Fix-pi-web-subagent-classification-regression-in-home-dreadster-Documents-projec-ab741de4-6cf7c19-40ab-s0-t0
branch
October 11, 2026 19:44
This was referenced Oct 11, 2026
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.
Why:
parentSessionheader into nested child session files (changelog #2763).mapScannedSession(lib/session-reader.ts) tested that header before the pi-subagents layout heuristic, so nested children classified asrelation.kind: "fork": top-level Sessions rows, emptyfamily.subagents, and the Agents tab hidden byhasSubagentSessions.What:
piSubagentChildLayout/derivePiSubagentRelation) now outranks the genericparentSessionfork branch. LegacyreadSubagentRunmetadata still resolves first.lib/pi-subagents-relations.test.mjs: a nested child whose header carriesparentSessionyieldsrelation.kind === "subagent"and appears inlistSessionFamilies(...).subagents— for both therun-<N>and the detachedasync-<runId>layouts.docs/agents/sessions.mdanddocs/agents/subagents.md.Evidence — on-disk child header sample (
~/.pi/agent/sessions/<enc>/<parentBase>/<childUuid>/run-0/session.jsonl):{"type":"session","version":3,"id":"<childUuid>","cwd":"/path","timestamp":"...","parentSession":"/home/u/.pi/agent/sessions/<enc>/<parentBase>.jsonl"}Gates:
npx tsc --noEmitclean;eslintclean on changed files;npm testadds 1 passing test with no new failures (base main fails 101 tests identically: MCP/config/trust environment cases and the lib/skill-lock XDG case).