Repository navigation
fix: file subagent transcripts under their real project, not "subagents" - #2
Merged
Merged
Conversation
Claude Code keeps subagent transcripts at <project>/<session>/subagents/agent-*.jsonl. sync.ts (index and summary paths) and parseConversationFile took the parent directory as the project, so every subagent exchange was indexed under "subagents" and fell out of project-scoped searches. - projectFromTranscriptPath() in paths.ts skips <session>/subagents/ when the file is an agent-*.jsonl; a real project named "subagents" keeps its name. - migrateSubagentProjects() repairs rows already indexed this way. It runs from migrateSchema and is a no-op once nothing needs fixing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Found while reviewing the index on 2026-10-10: 46 of our 466 exchanges (40 subagent transcripts) were filed under a project called
subagents.Cause: Claude Code keeps subagent transcripts at
<project>/<session>/subagents/agent-*.jsonl. Two places insync.ts(indexing and summarizing) andparseConversationFiletook the parent directory as the project name.indexer.tsandverify.tswere already correct.Fix:
projectFromTranscriptPath()inpaths.tsis now used at all three sites. It skips<session>/subagents/only when the file is also namedagent-*. My first version checked only the directory name, and the migration test caught it renaming a real project calledsubagentstounknown.migrateSubagentProjects()indb.tsrepairs rows that were already indexed this way. It runs frommigrateSchemaalongside the cascade migration, it's idempotent, and it leaves a genuinesubagentsproject alone.Tests: new
test/subagent-project.test.tswith 7 tests: the helper,parseConversationFile, a realsyncConversationsrun with mocked embeddings, and the migration. The parser and sync tests failed with"subagents"before the fix was wired in. Full suite: 376 passed / 8 skipped / 0 failed on Windows (369 before, plus these 7).dist/is rebuilt.Dry run on a copy of our real index: "Migrating 40 subagent transcript(s)…", leaving
d--Personal-Projectswith 463 andC--Users-drewtwith 3. Nosubagentsrows remain. The real index was not touched.After merge: reinstall the plugin from the local marketplace, since it runs from a cache copy. The migration then runs on the next start. That reinstall is also still pending for PR #1.
Not upstreamed. If you want it sent to obra/episodic-memory, that would be a separate step, under your name.
🤖 Generated with Claude Code