Repository navigation
fix(band): keep readable subagent usage during partial imports - #1461
Merged
DietrichGebert merged 1 commit intoNov 22, 2026
Merged
DietrichGebert merged 1 commit into
DietrichGebert merged 1 commit into
Conversation
Owner
|
Thanks! Tested it, works. Merged, will be in the next release. |
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.
Fixes #1460
Problem
Band import reads all subagent transcripts inside one
flatMapassignment. If any transcript cannot be opened or read, the assignment never completes and the outer catch leaves the entire subagent list empty. The session is still imported, but the ledger silently loses the token usage and estimated cost of every readable subagent.Change
Handle a read failure inside each subagent file's callback. An unreadable subagent is skipped while other readable files continue through the existing message-ID deduplication and cost accounting. Directory enumeration failures retain the existing best-effort behavior.
The filesystem regression places a non-readable transcript entry between two valid subagent transcripts, runs the actual importer and verifies the saved total-token, output-token and cost columns. It also preserves the existing second-import deduplication check. Before the fix, the expected 14,850 tokens were recorded as 6,600 because both healthy subagents disappeared.
Validation
node --test tests/band-import.test.js: passed after the fix.npm test: 144 root tests and 30 pi-extension tests passed.node scripts/check-rule-copies.js,node scripts/check-versions.jsandgit diff --check: passed.Related history checked: #1196 handles malformed main-transcript cwd data, temporary-path matching and file-handle cleanup; it does not isolate failures while collecting subagent transcripts.
Unreadable transcript contents remain unavailable and cannot be recovered by this change. No live Claude Code session was imported; validation uses synthetic local transcript files through the real importer.