ISSUE DESCRIPTION Deep-research / workflow subagent transcripts aren't discovered…
- User
ISSUE DESCRIPTION
Deep-research / workflow subagent transcripts aren't discovered (nested under subagents/workflows/)
What I was doing
Running Claude Code's
/deep-researcha few times, then looking for those sessions in agentsview. Each run fans out into ~100 subagents and leaves a large pile of per-agent transcripts on disk — exactly the kind of session history I'd want to browse and analyze in agentsview after the fact.What happened
None of the deep-research subagent transcripts show up in agentsview. The parent session imports fine; the ~100 subagents per run are invisible.
The cause is a path-depth assumption in discovery.
DiscoverClaudeSessionslooks for subagent transcripts exactly one level down:<project>/<session>/subagents/agent-<id>.jsonland in that loop it skips any directory entry:
// internal/parser/discovery.go ~L359 for _, sub := range subFiles { if sub.IsDir() { continue // ← never descends } name := sub.Name() if !strings.HasPrefix(name, "agent-") || !strings.HasSuffix(name, ".jsonl") { continue } ... }But deep-research (and Workflow-tool runs generally) write their subagent transcripts one level deeper, grouped by workflow id:
<project>/<session>/subagents/workflows/<wf_id>/agent-<id>.jsonlsubagents/here contains only theworkflows/directory, which the loop skips — so the entire tree underneath is never discovered. Each transcript carriesisSidechain: trueand an accompanyingagent-<id>.meta.jsonwhoseagentTypeisworkflow-subagent.Concretely, in one session three
/deep-researchruns produced 312agent-*.jsonlfiles undersubagents/workflows/, and zero directly undersubagents/. All 312 are currently dropped.Why it matters
Deep research is one of the highest-value things to capture: a single invocation can spawn a hundred subagents and burn a lot of tokens, and right now that whole tree is invisible in agentsview — no transcripts, no token/usage attribution, no way to review what the subagents actually did. As more people lean on workflow-style fan-out, this is a growing blind spot.
The fix looks small: walk
subagents/recursively (or specifically also descend intosubagents/workflows/<wf_id>/) instead of only reading its top level, and treatagent-*.jsonlfound anywhere beneath it the same way. The.meta.json(agentType: workflow-subagent) is available alongside each transcript if the workflow grouping is worth surfacing in the UI.ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /agentsview, current file: none) bash-$
Assistant
Let me start by understanding the repository structure and the issue at hand. The issue is about
DiscoverClaudeSessionsininternal/parser/discovery.gonot discovering subagent transcripts nested undersubagents/workflows/<wf_id>/agent-<id>.jsonl. Let me first explore the repository structure and then look at the specific file mentioned.Assistant
Let me look at the specific file mentioned in the issue:
internal/parser/discovery.go.Assistant
Let me look at the area around line 359 where the issue mentions the subagent discovery logic
Assistant
Let me try the correct format for goto.
Assistant
Now I can see the issue. Let me also look at the broader context to understand the full
DiscoverClaudeSessionsfunction and check if there are other places with similar path-depthAssistant
Now let me search the codebase for other potential places that might need updates — any references to "workflows", "subagents", or "agent-" patterns:
Assistant
Let me also search for "subagent" and "agent-" patterns to understand the full scope
Assistant
Let me look at the entire
DiscoverClaudeProjectsfunction and also search for otherDiscover*functions in the file that might have similar patterns:Assistant
Let me look at the engine.go to understand how paths are classified for subagents, and also at the discovery_test.go for the relevant tests:
Assistant
Let me look at the engine.go code around line 487 more carefully
Assistant
Let me go to line 461 and look at the engine.go path classification logic.
Assistant
Let me also look at the workbuddy.go discovery patterns and the engine.go area around line 5590 for the subagent path matching
Assistant
Let me look at all three places.
Assistant
Now let me look at line 5590.
Assistant
Let me also check the workbuddy.go discovery code:
Assistant
The open command only takes a file and an optional line number, not a range. Let me just view workbuddy.go.
Assistant
Now let me look at discovery_test.go to understand the test patterns and also to see if there are any existing tests for subagents or deep-nested subagents:
Assistant
Now I have a clear picture. Let me write a reproduce script to confirm the issue, then fix the code.
Assistant
The filename has "_test" in it which Go treats specially. Let me rename it.
Assistant
Let me set the GOCACHE environment variable.
Assistant
I need to add the
stringsimport to the script.Assistant
I've confirmed the issue. Now let me implement the fixes. Let me start with
discovery.go:Assistant
Now let me fix the
DiscoverClaudeProjectsfunction by replacing the flat subagent scanning with a recursive walkAssistant
Now let me fix the engine.go path classification. Let me first look at the exact lines more carefully and then fix them:
Assistant
Now let me fix the engine.go Claude subagent path classification:
Assistant
Now let me fix the WorkBuddy path classification at line 726 (which is now slightly shifted due to the edit). Let me find
Assistant
Now let me fix both remaining occurrences:
Assistant
Now fix line 5592 (WorkBuddy project
Assistant
Now let me fix the workbuddy.go
DiscoverWorkBuddySessionsas well for consistencyAssistant
Wait, the edit was applied to the wrong file! engine.go was open, not workbuddy.go. Let me check the damage and fix
Assistant
I've corrupted engine.go. Let me fix it. First, let me revert engine.go and then properly fix workbuddy.go
Assistant
Good. Now let me re-apply the engine.go fixes properly. First, let me confirm it's back to original:
Assistant
Good, engine.go is back to original. Now let me re-apply the three fixes to engine.go using `--file
Assistant
Now fix the WorkBuddy subagent classification at line 728
Assistant
Now fix line 5590 (WorkBuddy project
Assistant
Now let me fix workbuddy.go properly
Assistant
Now fix the workbuddy.go subagent discovery to walk recursively
Assistant
Let me verify the code compiles correctly
Assistant
Let me check the go environment and set up necessary paths
Assistant
Good, it compiles. Now let me run the relevant tests — the discovery tests and the engine tests related to sub
Assistant
Good, existing tests pass. Let me run more relevant tests — workbuddy and engine sub
Assistant
Let me run the full parser test suite to make sure nothing is
Assistant
That failing test is pre-existing and unrelated to our changes. Let me verify by running it on clean code:
Assistant
Confirmed — the test failure is pre-existing. Let me restore my changes:
Assistant
Let me now run the engine tests related to subagents
Assistant
Let me run the subagent-related engine integration tests
Assistant
Let me find the relevant engine integration test
Assistant
Let me run the subagent-related integration tests
Assistant
All relevant tests pass. Let me also run the workbuddy tests
Assistant
Let me also write a quick test to verify our fix works with an actual integration test case:
Assistant
Let me check the full diff to make sure everything looks correct:
Assistant
Let me also check if there's a
FindClaudeSourceFileor similar function that constructs paths for Claude subagentsAssistant
Let me look at
FindClaudeSourceFile:Assistant
I see
FindClaudeSourceFilealso has the same path-depth assumption for subagent lookup. Let me fix that too for consistencyAssistant
Let me verify compilation and run the relevant tests:
Assistant
Let me run the relevant tests:
Assistant
Let me run the full set of subagent-related integration tests one more time:
Assistant
All tests pass. Let me do a final review of all my changes:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →