Skip to content

fix: implement chronological deduplication for branched conversations#58

Merged
ryoppippi merged 5 commits intoryoppippi:mainfrom
ben-vargas:fix/19-remove-duplicates-by-date
Jun 12, 2025
Merged

fix: implement chronological deduplication for branched conversations#58
ryoppippi merged 5 commits intoryoppippi:mainfrom
ben-vargas:fix/19-remove-duplicates-by-date

Conversation

@ben-vargas
Copy link
Copy Markdown
Contributor

@ben-vargas ben-vargas commented Jun 11, 2025

Fix: Implement Chronological Deduplication for Branched Conversations

Summary

This PR fixes issue #19 by implementing a chronologically-aware deduplication system that prevents double-counting of tokens and costs when conversations are branched in Claude Code.

Fixes #19

Problem

When users branch conversations in Claude Code (by editing a past message with Esc+Esc), the application creates a new conversation that includes duplicate entries from the original conversation. These duplicates have identical requestId and message.id values, causing:

  • Inflated token counts - The same API calls are counted multiple times
  • Incorrect cost calculations - Users see higher costs than actually incurred
  • Wrong date attribution - Costs may be attributed to the branch date instead of the original date

Root Cause

The current implementation processes JSONL files in an undefined order (filesystem-dependent). This means:

  1. A newer branched conversation file might be processed before the original
  2. Without deduplication, both files contribute to the totals
  3. Even with simple deduplication, processing order matters - the first processed entry "wins"

Solution

This PR implements a comprehensive deduplication solution that:

1. Chronological File Processing

  • Added getEarliestTimestamp() to extract the earliest timestamp from each JSONL file
  • Added sortFilesByTimestamp() to sort files by their earliest timestamp
  • Files are now processed oldest-first, ensuring original entries are preserved

2. Message Deduplication

  • Extended UsageDataSchema to include message.id and requestId fields
  • Added createUniqueHash() to generate unique identifiers from message+request IDs
  • Track processed hashes in a Set to skip duplicate entries
  • Implemented in both loadDailyUsageData() and loadSessionData()

3. Robust Implementation

  • Handles files without timestamps (placed at end of processing order)
  • Skips invalid JSON lines gracefully
  • Maintains backward compatibility with existing data

Testing

Added comprehensive test suite (data-loader-deduplication.test.ts) with 11 tests covering:

  • ✅ Hash creation from message and request IDs
  • ✅ Timestamp extraction from JSONL files
  • ✅ File sorting by timestamp
  • ✅ Deduplication in daily usage data
  • ✅ Deduplication in session data
  • ✅ Edge cases (missing IDs, invalid JSON, no timestamps)

All existing tests (117 total) continue to pass.

Code Changes

Modified Files:

  • src/data-loader.ts - Added deduplication logic and chronological processing
  • src/data-loader-deduplication.test.ts - New comprehensive test suite

Key Functions Added:

// Create unique identifier for deduplication
createUniqueHash(data: UsageData): string | null

// Extract earliest timestamp from JSONL file
getEarliestTimestamp(filePath: string): Promise<Date | null>

// Sort files chronologically
sortFilesByTimestamp(files: string[]): Promise<string[]>

Impact

  • Accurate Costs: Users will see correct token counts and costs
  • Proper Attribution: Usage is attributed to the original date, not branch date
  • No Data Loss: Only true duplicates are removed
  • Performance: Minimal overhead from sorting files before processing

Verification

Before this fix:

  • Branched conversations would show inflated costs
  • Same usage could appear on multiple dates

After this fix:

  • Each unique API call is counted exactly once
  • Usage appears only on the original date
  • Branched conversations no longer inflate costs

Breaking Changes

None. This change is backward compatible and transparent to users.

Future Considerations

This implementation uses a simple concatenation for the hash (messageId:requestId). If needed, this could be upgraded to use a proper hashing algorithm, though the current approach is sufficient for the use case.

Summary by CodeRabbit

  • New Features
    • Improved data loading by processing usage data files in chronological order.
    • Added deduplication to ensure duplicate messages are filtered out during data loading.
  • Bug Fixes
    • Prevented duplicate entries from affecting usage and session statistics.
  • Tests
    • Added comprehensive tests to verify deduplication and chronological processing of data files.

- Add deduplication logic that respects chronological order to fix issue #19
- Sort JSONL files by earliest timestamp before processing
- Track processed message+request ID combinations to skip duplicates
- Ensure original entries are kept and later duplicates are discarded
- Add comprehensive test suite for deduplication functionality

This prevents double-counting of tokens and costs when conversations
are branched, which creates duplicate entries with identical message
and request IDs. Files are now processed oldest-first to ensure costs
are attributed to the correct date.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 11, 2025

Walkthrough

Deduplication and chronological ordering have been added to the data loading logic. New functions generate unique hashes for messages using message and request IDs, sort files by their earliest timestamp, and filter out duplicate entries. The test suite verifies these behaviors, ensuring only unique messages are counted and processed in order.

Changes

File(s) Change Summary
src/data-loader.ts Added deduplication logic using unique hashes, chronological file sorting, and new helper functions.
src/data-loader-deduplication.test.ts Added comprehensive tests for deduplication, unique hash creation, timestamp extraction, and sorting.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant DataLoader
    participant FileSystem

    Client->>DataLoader: loadDailyUsageData/loadSessionData()
    DataLoader->>FileSystem: List JSONL files
    DataLoader->>FileSystem: Read each file for earliest timestamp
    DataLoader->>DataLoader: sortFilesByTimestamp(files)
    loop For each file in chronological order
        DataLoader->>FileSystem: Read file line by line
        loop For each line
            DataLoader->>DataLoader: createUniqueHash(message.id + requestId)
            alt Hash not seen
                DataLoader->>DataLoader: Process entry, add hash to seen set
            else Hash seen
                DataLoader->>DataLoader: Skip duplicate entry
            end
        end
    end
    DataLoader->>Client: Return deduplicated, chronologically processed data
Loading

Assessment against linked issues

Objective Addressed Explanation
Deduplicate assistant messages globally by message id + request id (#19)
Ensure only unique assistant messages are counted, even across branched conversations (#19)
Process usage data files in chronological order to ensure earliest entries are retained for deduplication (#19)

Poem

In files where conversations grow,
A rabbit hops to and fro—
Deduplicates with careful hash,
Skips the twins in every stash.
Chronological, neat, and clean,
The data’s now as it should be seen!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @ben-vargas, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where branching conversations in Claude Code led to inflated token counts and incorrect cost attribution due to duplicate usage entries. The changes introduce a robust system that processes usage data files chronologically and deduplicates entries based on unique message and request identifiers, ensuring accurate reporting of usage and costs.

Highlights

  • Chronological File Processing: Implemented logic to read JSONL usage files in chronological order based on the earliest timestamp found within each file. This ensures that the original usage entry is processed before any potential duplicates created by branching.
  • Message-Level Deduplication: Introduced a deduplication mechanism that identifies unique API calls using a combination of message.id and requestId. A Set is used to track processed entries, skipping any subsequent occurrences of the same message+request ID combination.
  • Integration into Data Loading: Applied the new chronological sorting and deduplication logic to both loadDailyUsageData and loadSessionData functions, ensuring accurate token counts and cost calculations across different views.
  • Comprehensive Testing: Added a new test suite (data-loader-deduplication.test.ts) specifically for the deduplication and sorting functionality, covering various scenarios including missing IDs, invalid JSON, and files without timestamps.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configureGemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a robust solution for deduplicating usage data in branched conversations by implementing chronological file processing and message-level deduplication. The changes are well-reasoned, and the addition of a comprehensive test suite is excellent. The core logic for sorting files by timestamp and then using a hash of message.id and requestId to skip duplicates appears correct and effectively addresses the described problem.

My review includes a suggestion for structuring tests to improve maintainability and a minor point on error handling for consideration.

Comment on lines +66 to +119
let tempDir: string;

it('should extract earliest timestamp from JSONL file', async () => {
tempDir = await mkdtemp(path.join(tmpdir(), 'ccusage-test-'));
const testFile = path.join(tempDir, 'test.jsonl');

const content = [
JSON.stringify({ timestamp: '2025-01-15T12:00:00Z', message: { usage: {} } }),
JSON.stringify({ timestamp: '2025-01-10T10:00:00Z', message: { usage: {} } }),
JSON.stringify({ timestamp: '2025-01-12T11:00:00Z', message: { usage: {} } }),
].join('\n');

await writeFile(testFile, content);

const timestamp = await getEarliestTimestamp(testFile);
expect(timestamp).toEqual(new Date('2025-01-10T10:00:00Z'));

await rm(tempDir, { recursive: true });
});

it('should handle files without timestamps', async () => {
tempDir = await mkdtemp(path.join(tmpdir(), 'ccusage-test-'));
const testFile = path.join(tempDir, 'test.jsonl');

const content = [
JSON.stringify({ message: { usage: {} } }),
JSON.stringify({ data: 'no timestamp' }),
].join('\n');

await writeFile(testFile, content);

const timestamp = await getEarliestTimestamp(testFile);
expect(timestamp).toBeNull();

await rm(tempDir, { recursive: true });
});

it('should skip invalid JSON lines', async () => {
tempDir = await mkdtemp(path.join(tmpdir(), 'ccusage-test-'));
const testFile = path.join(tempDir, 'test.jsonl');

const content = [
'invalid json',
JSON.stringify({ timestamp: '2025-01-10T10:00:00Z', message: { usage: {} } }),
'{ broken: json',
].join('\n');

await writeFile(testFile, content);

const timestamp = await getEarliestTimestamp(testFile);
expect(timestamp).toEqual(new Date('2025-01-10T10:00:00Z'));

await rm(tempDir, { recursive: true });
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The setup and teardown of tempDir is repeated in each test within the describe('getEarliestTimestamp') block (and similarly in describe('sortFilesByTimestamp')). While this works, using beforeEach and afterEach (or beforeAll/afterAll if appropriate) can make the tests cleaner and reduce boilerplate, ensuring consistent setup/teardown logic.

For example:

describe('getEarliestTimestamp', () => {
    let tempDir: string;

    beforeEach(async () => {
        tempDir = await mkdtemp(path.join(tmpdir(), 'ccusage-test-'));
    });

    afterEach(async () => {
        if (tempDir) {
            // Adding force: true can be useful for cleanup, especially in CI environments
            await rm(tempDir, { recursive: true, force: true });
        }
    });

    it('should extract earliest timestamp from JSONL file', async () => {
        const testFile = path.join(tempDir, 'test.jsonl');
        // ... rest of the test, no need to call mkdtemp or rm here
    });

    // ... other tests in this describe block
});

This pattern helps centralize the temporary directory management for the test suite.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in commit 9e85d53.

Comment on lines +154 to +156
catch {
return null;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The broad catch { return null; } for the entire getEarliestTimestamp function is functional for the current use case, as it ensures files that can't be processed (due to read errors or being empty/all-invalid) are effectively ignored or sorted to the end.

However, for improved diagnostics, you might consider logging an error if readFile itself fails (e.g., due to permissions or file not found), as this is a different class of issue than a file simply not containing valid timestamps. This could be done by catching specific errors or by logging within this catch block before returning null.

For example:

catch (error) {
  console.error(`Error processing file ${filePath}:`, error);
  return null;
}

This is optional and depends on the desired level of verbosity for file processing errors. The current behavior of returning null is acceptable for the sorting logic.

	catch (error) {
    // Optional: Log the error for diagnostics if desired.
    // console.error(`Failed to get earliest timestamp for ${filePath}:`, error);
		return null;
	}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improved as recommended - commit c8d206b

- Import logger for diagnostic messages
- Log file access errors at debug level in getEarliestTimestamp()
- Helps distinguish between file access issues vs files without timestamps
- Maintains existing behavior while improving diagnostics
@ben-vargas
Copy link
Copy Markdown
Contributor Author

Curious to see how this runs for others... here's my macbook pro:

New Output:
CleanShot 2025-06-11 at 13 28 05@2x

Old Output:
CleanShot 2025-06-11 at 13 28 55@2x

- Add beforeEach/afterEach hooks for tempDir management
- Remove duplicate mkdtemp and rm calls from individual tests
- Add force: true to rm for more reliable cleanup
- Makes test code DRYer and ensures consistent cleanup
@ben-vargas ben-vargas marked this pull request as ready for review June 11, 2025 19:40
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/data-loader.ts (2)

108-118: Consider using a proper hashing algorithm for more robust deduplication.

The current implementation using simple concatenation works but could have edge cases if IDs contain colons. As mentioned in the PR objectives, using a proper hashing algorithm would be more robust.

+import { createHash } from 'node:crypto';

export function createUniqueHash(data: UsageData): string | null {
	const messageId = data.message.id;
	const requestId = data.requestId;

	if (messageId == null || requestId == null) {
		return null;
	}

-	// Create a hash using simple concatenation
-	return `${messageId}:${requestId}`;
+	// Create a hash using SHA-256 for collision resistance
+	return createHash('sha256')
+		.update(`${messageId}:${requestId}`)
+		.digest('hex');
}
🧰 Tools
🪛 ESLint

[error] 109-109: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 109-109: Unsafe member access .message on an error typed value.

(ts/no-unsafe-member-access)


[error] 110-110: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 110-110: Unsafe member access .requestId on an error typed value.

(ts/no-unsafe-member-access)


147-150: Remove unnecessary continue statement.

The continue statement in the catch block is redundant since it's the last statement in the loop iteration.

			catch {
				// Skip invalid JSON lines
-				continue;
			}
🧰 Tools
🪛 Biome (1.9.4)

[error] 149-149: Unnecessary continue statement

Unsafe fix: Delete the unnecessary continue statement

(lint/correctness/noUnnecessaryContinue)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85afe7b and 9e85d53.

📒 Files selected for processing (2)
  • src/data-loader-deduplication.test.ts (1 hunks)
  • src/data-loader.ts (8 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/data-loader-deduplication.test.ts (1)
src/data-loader.ts (5)
  • createUniqueHash (108-118)
  • getEarliestTimestamp (124-161)
  • sortFilesByTimestamp (167-191)
  • loadDailyUsageData (238-419)
  • loadSessionData (421-640)
src/data-loader.ts (2)
src/logger.ts (1)
  • logger (5-5)
src/pricing-fetcher.ts (1)
  • PricingFetcher (16-165)
🪛 ESLint
src/data-loader-deduplication.test.ts

[error] 13-13: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 14-14: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 15-15: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 29-29: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 29-29: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 29-29: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 32-32: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 45-45: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 45-45: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 45-45: Unsafe member access .toBeNull on an error typed value.

(ts/no-unsafe-member-access)


[error] 48-48: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 61-61: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 61-61: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 61-61: Unsafe member access .toBeNull on an error typed value.

(ts/no-unsafe-member-access)


[error] 65-65: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 68-68: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 69-69: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 69-69: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 69-69: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 69-69: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 69-69: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 72-72: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 74-74: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 78-78: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 79-79: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 79-79: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 79-79: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 87-87: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 89-89: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 90-90: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 90-90: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 90-90: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 93-93: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 94-94: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 94-94: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 94-94: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 101-101: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 103-103: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 104-104: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 104-104: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 104-104: Unsafe member access .toBeNull on an error typed value.

(ts/no-unsafe-member-access)


[error] 107-107: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 108-108: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 108-108: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 108-108: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 116-116: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 118-118: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 119-119: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 119-119: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 119-119: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 123-123: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 126-126: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 127-127: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 127-127: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 127-127: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 127-127: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 127-127: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 130-130: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 132-132: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 136-136: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 137-137: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 137-137: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 137-137: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 138-138: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 138-138: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 138-138: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 139-139: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 139-139: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 139-139: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 142-142: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 145-145: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 148-148: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 150-150: Unsafe argument of type any[] assigned to a parameter of type string[].

(ts/no-unsafe-argument)


[error] 152-152: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 152-152: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 152-152: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 155-155: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 156-156: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 156-156: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 156-156: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 157-157: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 157-157: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 157-157: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 158-158: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 158-158: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 158-158: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 160-160: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 161-161: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 162-162: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 164-164: Unsafe argument of type any[] assigned to a parameter of type string[].

(ts/no-unsafe-argument)


[error] 166-166: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 166-166: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 166-166: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 170-170: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 173-173: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 174-174: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 174-174: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 174-174: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 174-174: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 174-174: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 175-175: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 175-175: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 175-175: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 176-176: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 176-176: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 176-176: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 177-177: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 177-177: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 177-177: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 179-179: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 180-180: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 180-180: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 180-180: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 194-194: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 195-195: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 195-195: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 195-195: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 214-214: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 214-214: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 214-214: Unsafe member access .toHaveLength on an error typed value.

(ts/no-unsafe-member-access)


[error] 215-215: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 215-215: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 215-215: Unsafe member access .date on an error typed value.

(ts/no-unsafe-member-access)


[error] 215-215: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 216-216: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 216-216: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 216-216: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 216-216: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 217-217: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 217-217: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 217-217: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 217-217: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 219-219: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 222-222: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 223-223: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 223-223: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 223-223: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 223-223: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 223-223: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 224-224: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 224-224: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 224-224: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 227-227: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 227-227: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 227-227: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 228-228: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 228-228: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 228-228: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 231-231: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 232-232: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 246-246: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 265-265: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 265-265: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 265-265: Unsafe member access .toHaveLength on an error typed value.

(ts/no-unsafe-member-access)


[error] 266-266: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 266-266: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 266-266: Unsafe member access .date on an error typed value.

(ts/no-unsafe-member-access)


[error] 266-266: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 267-267: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 267-267: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 267-267: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 267-267: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 268-268: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 268-268: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 268-268: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 268-268: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 270-270: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 274-274: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 277-277: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 278-278: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 278-278: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 278-278: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 278-278: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 278-278: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 279-279: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 279-279: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 279-279: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 280-280: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 280-280: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 280-280: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 281-281: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 281-281: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 281-281: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 283-283: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 284-284: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 284-284: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 284-284: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 298-298: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 299-299: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 299-299: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 299-299: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 318-318: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 318-318: Unsafe member access .sessionId on an error typed value.

(ts/no-unsafe-member-access)


[error] 319-319: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 319-319: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 319-319: Unsafe member access .toBeDefined on an error typed value.

(ts/no-unsafe-member-access)


[error] 320-320: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 320-320: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 320-320: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 320-320: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 321-321: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 321-321: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 321-321: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 321-321: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 324-324: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 324-324: Unsafe member access .sessionId on an error typed value.

(ts/no-unsafe-member-access)


[error] 326-326: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 326-326: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 326-326: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 326-326: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 327-327: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 327-327: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 327-327: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 327-327: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 331-331: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 331-331: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 331-331: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 334-334: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)

src/data-loader.ts

[error] 30-30: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 30-30: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 30-30: Unsafe member access .optional on an error typed value.

(ts/no-unsafe-member-access)


[error] 30-30: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 30-30: Unsafe member access .string on an error typed value.

(ts/no-unsafe-member-access)


[error] 32-32: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 32-32: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 32-32: Unsafe member access .optional on an error typed value.

(ts/no-unsafe-member-access)


[error] 32-32: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 32-32: Unsafe member access .number on an error typed value.

(ts/no-unsafe-member-access)


[error] 33-33: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 33-33: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 33-33: Unsafe member access .optional on an error typed value.

(ts/no-unsafe-member-access)


[error] 33-33: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 33-33: Unsafe member access .string on an error typed value.

(ts/no-unsafe-member-access)


[error] 109-109: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 109-109: Unsafe member access .message on an error typed value.

(ts/no-unsafe-member-access)


[error] 110-110: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 110-110: Unsafe member access .requestId on an error typed value.

(ts/no-unsafe-member-access)


[error] 126-126: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 126-126: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 127-127: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 127-127: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 127-127: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 127-127: Unsafe member access .trim on an error typed value.

(ts/no-unsafe-member-access)


[error] 127-127: Unsafe member access .split on an error typed value.

(ts/no-unsafe-member-access)


[error] 132-132: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 132-132: Unsafe member access .trim on an error typed value.

(ts/no-unsafe-member-access)


[error] 137-137: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 158-158: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 158-158: Unsafe member access .debug on an error typed value.

(ts/no-unsafe-member-access)


[error] 253-253: Unsafe argument of type error typed assigned to a parameter of type string[].

(ts/no-unsafe-argument)


[error] 256-256: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 436-436: Unsafe argument of type error typed assigned to a parameter of type string[].

(ts/no-unsafe-argument)


[error] 439-439: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)

🪛 Biome (1.9.4)
src/data-loader.ts

[error] 149-149: Unnecessary continue statement

Unsafe fix: Delete the unnecessary continue statement

(lint/correctness/noUnnecessaryContinue)

🔇 Additional comments (6)
src/data-loader-deduplication.test.ts (1)

1-337: Comprehensive test coverage for deduplication functionality!

The test suite thoroughly covers all the new deduplication features including hash creation, timestamp extraction, file sorting, and deduplication in data loading. Good use of beforeEach/afterEach for test setup/cleanup as recommended in previous reviews.

🧰 Tools
🪛 ESLint

[error] 13-13: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 14-14: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 15-15: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 29-29: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 29-29: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 29-29: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 32-32: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 45-45: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 45-45: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 45-45: Unsafe member access .toBeNull on an error typed value.

(ts/no-unsafe-member-access)


[error] 48-48: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 61-61: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 61-61: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 61-61: Unsafe member access .toBeNull on an error typed value.

(ts/no-unsafe-member-access)


[error] 65-65: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 68-68: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 69-69: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 69-69: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 69-69: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 69-69: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 69-69: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 72-72: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 74-74: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 78-78: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 79-79: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 79-79: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 79-79: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 87-87: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 89-89: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 90-90: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 90-90: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 90-90: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 93-93: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 94-94: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 94-94: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 94-94: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 101-101: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 103-103: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 104-104: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 104-104: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 104-104: Unsafe member access .toBeNull on an error typed value.

(ts/no-unsafe-member-access)


[error] 107-107: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 108-108: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 108-108: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 108-108: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 116-116: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 118-118: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 119-119: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 119-119: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 119-119: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 123-123: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 126-126: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 127-127: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 127-127: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 127-127: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 127-127: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 127-127: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 130-130: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 132-132: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 136-136: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 137-137: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 137-137: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 137-137: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 138-138: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 138-138: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 138-138: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 139-139: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 139-139: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 139-139: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 142-142: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 145-145: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 148-148: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 150-150: Unsafe argument of type any[] assigned to a parameter of type string[].

(ts/no-unsafe-argument)


[error] 152-152: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 152-152: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 152-152: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 155-155: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 156-156: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 156-156: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 156-156: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 157-157: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 157-157: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 157-157: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 158-158: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 158-158: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 158-158: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 160-160: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 161-161: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 162-162: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 164-164: Unsafe argument of type any[] assigned to a parameter of type string[].

(ts/no-unsafe-argument)


[error] 166-166: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 166-166: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 166-166: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 170-170: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 173-173: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 174-174: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 174-174: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 174-174: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 174-174: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 174-174: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 175-175: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 175-175: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 175-175: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 176-176: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 176-176: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 176-176: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 177-177: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 177-177: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 177-177: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 179-179: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 180-180: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 180-180: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 180-180: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 194-194: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 195-195: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 195-195: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 195-195: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 214-214: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 214-214: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 214-214: Unsafe member access .toHaveLength on an error typed value.

(ts/no-unsafe-member-access)


[error] 215-215: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 215-215: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 215-215: Unsafe member access .date on an error typed value.

(ts/no-unsafe-member-access)


[error] 215-215: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 216-216: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 216-216: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 216-216: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 216-216: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 217-217: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 217-217: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 217-217: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 217-217: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 219-219: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 222-222: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 223-223: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 223-223: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 223-223: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 223-223: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 223-223: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 224-224: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 224-224: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 224-224: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 227-227: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 227-227: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 227-227: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 228-228: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 228-228: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 228-228: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 231-231: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 232-232: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 246-246: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 265-265: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 265-265: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 265-265: Unsafe member access .toHaveLength on an error typed value.

(ts/no-unsafe-member-access)


[error] 266-266: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 266-266: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 266-266: Unsafe member access .date on an error typed value.

(ts/no-unsafe-member-access)


[error] 266-266: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 267-267: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 267-267: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 267-267: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 267-267: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 268-268: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 268-268: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 268-268: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 268-268: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 270-270: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 274-274: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 277-277: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 278-278: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 278-278: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 278-278: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 278-278: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 278-278: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 279-279: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 279-279: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 279-279: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 280-280: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 280-280: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 280-280: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 281-281: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 281-281: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 281-281: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 283-283: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 284-284: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 284-284: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 284-284: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 298-298: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 299-299: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 299-299: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 299-299: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 318-318: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 318-318: Unsafe member access .sessionId on an error typed value.

(ts/no-unsafe-member-access)


[error] 319-319: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 319-319: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 319-319: Unsafe member access .toBeDefined on an error typed value.

(ts/no-unsafe-member-access)


[error] 320-320: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 320-320: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 320-320: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 320-320: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 321-321: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 321-321: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 321-321: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 321-321: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 324-324: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 324-324: Unsafe member access .sessionId on an error typed value.

(ts/no-unsafe-member-access)


[error] 326-326: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 326-326: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 326-326: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 326-326: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 327-327: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 327-327: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 327-327: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 327-327: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 331-331: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 331-331: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 331-331: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 334-334: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)

src/data-loader.ts (5)

30-33: Schema changes support deduplication while maintaining backward compatibility.

The addition of optional id and requestId fields enables unique identification of messages for deduplication without breaking existing data structures.

🧰 Tools
🪛 ESLint

[error] 30-30: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 30-30: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 30-30: Unsafe member access .optional on an error typed value.

(ts/no-unsafe-member-access)


[error] 30-30: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 30-30: Unsafe member access .string on an error typed value.

(ts/no-unsafe-member-access)


[error] 32-32: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 32-32: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 32-32: Unsafe member access .optional on an error typed value.

(ts/no-unsafe-member-access)


[error] 32-32: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 32-32: Unsafe member access .number on an error typed value.

(ts/no-unsafe-member-access)


[error] 33-33: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 33-33: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 33-33: Unsafe member access .optional on an error typed value.

(ts/no-unsafe-member-access)


[error] 33-33: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 33-33: Unsafe member access .string on an error typed value.

(ts/no-unsafe-member-access)


167-191: Efficient chronological file sorting with proper null handling.

Good use of Promise.all for concurrent timestamp extraction and clear sorting logic that ensures files without timestamps don't interfere with chronological processing.


252-293: Deduplication implementation correctly prevents double-counting of branched conversations.

The chronological file processing combined with hash-based deduplication ensures that original entries are preserved while duplicates from branched conversations are filtered out. This effectively solves the inflated token count issue.

🧰 Tools
🪛 ESLint

[error] 253-253: Unsafe argument of type error typed assigned to a parameter of type string[].

(ts/no-unsafe-argument)


[error] 256-256: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 268-268: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 268-268: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 269-272: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 269-272: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 269-271: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 269-270: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 270-270: Unsafe member access .trim on an error typed value.

(ts/no-unsafe-member-access)


[error] 271-271: Unsafe member access .split on an error typed value.

(ts/no-unsafe-member-access)


[error] 272-272: Unsafe member access .filter on an error typed value.

(ts/no-unsafe-member-access)


[error] 272-272: Unsafe member access .length on an any value.

(ts/no-unsafe-member-access)


[error] 276-276: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 277-277: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 277-277: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 277-277: Unsafe member access .safeParse on an error typed value.

(ts/no-unsafe-member-access)


[error] 278-278: Unexpected any value in conditional. An explicit comparison or type conversion is required.

(ts/strict-boolean-expressions)


[error] 278-278: Unsafe member access .success on an error typed value.

(ts/no-unsafe-member-access)


[error] 281-281: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 281-281: Unsafe member access .output on an error typed value.

(ts/no-unsafe-member-access)


435-494: Consistent deduplication pattern ensures session data accuracy.

The implementation mirrors the approach used in loadDailyUsageData, maintaining consistency across the codebase and ensuring session-level data is also protected from duplication issues.

🧰 Tools
🪛 ESLint

[error] 436-436: Unsafe argument of type error typed assigned to a parameter of type string[].

(ts/no-unsafe-argument)


[error] 439-439: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 460-460: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 460-460: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 460-460: Unsafe member access .relative on an error typed value.

(ts/no-unsafe-member-access)


[error] 461-461: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 461-461: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 461-461: Unsafe member access .split on an error typed value.

(ts/no-unsafe-member-access)


[error] 461-461: Unsafe member access .sep on an error typed value.

(ts/no-unsafe-member-access)


[error] 464-464: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 464-464: Unsafe member access [parts.length - 2] on an error typed value.

(ts/no-unsafe-member-access)


[error] 464-464: Unsafe member access .length on an error typed value.

(ts/no-unsafe-member-access)


[error] 466-466: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 466-466: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 466-466: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 466-466: Unsafe member access .slice on an error typed value.

(ts/no-unsafe-member-access)


[error] 466-466: Unsafe member access .join on an error typed value.

(ts/no-unsafe-member-access)


[error] 466-466: Unsafe member access .sep on an error typed value.

(ts/no-unsafe-member-access)


[error] 467-467: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 467-467: Unsafe member access .length on an error typed value.

(ts/no-unsafe-member-access)


[error] 469-469: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 469-469: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 470-473: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 470-473: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 470-472: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 470-471: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 471-471: Unsafe member access .trim on an error typed value.

(ts/no-unsafe-member-access)


[error] 472-472: Unsafe member access .split on an error typed value.

(ts/no-unsafe-member-access)


[error] 473-473: Unsafe member access .filter on an error typed value.

(ts/no-unsafe-member-access)


[error] 473-473: Unsafe member access .length on an any value.

(ts/no-unsafe-member-access)


[error] 477-477: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 478-478: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 478-478: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 478-478: Unsafe member access .safeParse on an error typed value.

(ts/no-unsafe-member-access)


[error] 479-479: Unexpected any value in conditional. An explicit comparison or type conversion is required.

(ts/strict-boolean-expressions)


[error] 479-479: Unsafe member access .success on an error typed value.

(ts/no-unsafe-member-access)


[error] 482-482: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 482-482: Unsafe member access .output on an error typed value.

(ts/no-unsafe-member-access)


9-9: Good use of debug logging for diagnostics.

The logger import and debug message in getEarliestTimestamp provide helpful diagnostics without cluttering normal output, following the pattern established in previous reviews.

Also applies to: 158-158

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Jun 11, 2025

Open in StackBlitz

npm i https://pkg.pr.new/ryoppippi/ccusage@58

commit: e924236

@ryoppippi
Copy link
Copy Markdown
Owner

Thank you for implementing
can you review this @Richard-Weiss

@ryoppippi ryoppippi requested a review from Copilot June 11, 2025 21:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment on lines +65 to +67
describe('getEarliestTimestamp', () => {
let tempDir: string;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use fs-fixture for mocking files

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, refactored in b5e8b35

Copy link
Copy Markdown
Owner

@ryoppippi ryoppippi Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh refer how to use fs-fixture in other test file. you can use await using syntax
instead of using afterEach beforeEach

https://github.com/privatenumber/fs-fixture/tree/master?tab=readme-ov-file#using-keyword-explicit-resource-management

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await using fixture = await createFixture({
'test.jsonl': JSON.stringify({
timestamp: '2024-01-01T12:00:00Z',
costUSD: 0.00015, // 50 * 0.000003 = 0.00015 (matches calculated)
version: '1.0.0',
message: {
model: 'claude-sonnet-4-20250514',
usage: {
input_tokens: 50,
output_tokens: 0,
},
},
}),
});
const stats = await detectMismatches(fixture.path);
expect(stats.totalEntries).toBe(1);
expect(stats.entriesWithBoth).toBe(1);
expect(stats.matches).toBe(1);
expect(stats.mismatches).toBe(0);
expect(stats.discrepancies).toHaveLength(0);
});

Replace manual temporary directory creation with fs-fixture for cleaner and more maintainable test setup. This change addresses PR review feedback from @ryoppippi.

Changes:
- Remove manual filesystem imports (mkdir, mkdtemp, rm, writeFile)
- Use createFixture from fs-fixture package
- Simplify test setup/teardown with fixture lifecycle methods
- Improve readability with declarative directory structure creation
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
src/data-loader-deduplication.test.ts (4)

1-9: Prefer extension-less relative import for first-party modules

./data-loader.ts works when the runner understands .ts extensions, but omitting the extension ('./data-loader') is more portable across Node, Bun & Jest setups and avoids redundant file-path churn during emits.

-import {
-    createUniqueHash,
-    // …
-} from './data-loader.ts';
+import {
+    createUniqueHash,
+    // …
+} from './data-loader';

74-84: Terminate the generated JSONL string with a newline

Some JSONL readers rely on a trailing newline to treat the last line as a full record.
Appending \n makes the fixture closer to real files and guards against edge-case regressions.

-].join('\n');
+].join('\n') + '\n';
🧰 Tools
🪛 ESLint

[error] 74-74: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 81-81: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 81-81: Unsafe member access .writeFile on an error typed value.

(ts/no-unsafe-member-access)


[error] 83-83: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 83-83: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 83-83: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 84-84: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 84-84: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 84-84: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


167-213: Also assert monetary cost to fully exercise deduplication

The test currently validates token counts but ignores the costUSD field, even though cost inflation was a key issue (#19).
Adding a simple expectation ensures the deduplication logic updates every derived metric.

 expect(data[0]?.outputTokens).toBe(50);
+expect(data[0]?.costUSD).toBe(0.001);
🧰 Tools
🪛 ESLint

[error] 167-167: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 168-201: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 168-168: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 204-204: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 204-204: Unsafe member access .path on an error typed value.

(ts/no-unsafe-member-access)


[error] 209-209: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 209-209: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 209-209: Unsafe member access .toHaveLength on an error typed value.

(ts/no-unsafe-member-access)


[error] 210-210: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 210-210: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 210-210: Unsafe member access .date on an error typed value.

(ts/no-unsafe-member-access)


[error] 210-210: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 211-211: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 211-211: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 211-211: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 211-211: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 212-212: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 212-212: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 212-212: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 212-212: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


315-323: Avoid branching expectations; assert the single expected outcome

The conditional makes the test pass in two different scenarios, reducing its diagnostic value.
Since the deduplication should drop the newer duplicate entirely, assert the authoritative path:

-const session2 = sessions.find(s => s.sessionId === 'session2');
-expect(session2).toBeUndefined();
-expect(sessions).toHaveLength(1);
+expect(sessions.find(s => s.sessionId === 'session2')).toBeUndefined();
+expect(sessions).toHaveLength(1);

This keeps the test focused and ensures regressions are caught early.

🧰 Tools
🪛 ESLint

[error] 315-315: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 315-315: Unsafe member access .sessionId on an error typed value.

(ts/no-unsafe-member-access)


[error] 317-317: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 317-317: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 317-317: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 317-317: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 318-318: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 318-318: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 318-318: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 318-318: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 322-322: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 322-322: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 322-322: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9e85d53 and b5e8b35.

📒 Files selected for processing (1)
  • src/data-loader-deduplication.test.ts (1 hunks)
🧰 Additional context used
🪛 ESLint
src/data-loader-deduplication.test.ts

[error] 11-11: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 12-12: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 13-13: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 27-27: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 27-27: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 27-27: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 30-30: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 43-43: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 43-43: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 43-43: Unsafe member access .toBeNull on an error typed value.

(ts/no-unsafe-member-access)


[error] 46-46: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 59-59: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 59-59: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 59-59: Unsafe member access .toBeNull on an error typed value.

(ts/no-unsafe-member-access)


[error] 63-63: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 66-66: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 67-67: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 67-67: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 70-70: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 71-71: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 71-71: Unsafe member access .rm on an error typed value.

(ts/no-unsafe-member-access)


[error] 74-74: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 81-81: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 81-81: Unsafe member access .writeFile on an error typed value.

(ts/no-unsafe-member-access)


[error] 83-83: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 83-83: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 83-83: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 84-84: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 84-84: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 84-84: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 87-87: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 93-93: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 93-93: Unsafe member access .writeFile on an error typed value.

(ts/no-unsafe-member-access)


[error] 95-95: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 95-95: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 95-95: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 96-96: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 96-96: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 96-96: Unsafe member access .toBeNull on an error typed value.

(ts/no-unsafe-member-access)


[error] 99-99: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 106-106: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 106-106: Unsafe member access .writeFile on an error typed value.

(ts/no-unsafe-member-access)


[error] 108-108: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 108-108: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 108-108: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 109-109: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 109-109: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 109-109: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 113-113: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 116-116: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 117-117: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 117-117: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 120-120: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 121-121: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 121-121: Unsafe member access .rm on an error typed value.

(ts/no-unsafe-member-access)


[error] 124-124: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 126-126: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 126-126: Unsafe member access .writeFile on an error typed value.

(ts/no-unsafe-member-access)


[error] 129-129: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 129-129: Unsafe member access .writeFile on an error typed value.

(ts/no-unsafe-member-access)


[error] 132-132: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 132-132: Unsafe member access .writeFile on an error typed value.

(ts/no-unsafe-member-access)


[error] 134-134: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 134-134: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 134-134: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 135-135: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 135-135: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 135-135: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 136-136: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 136-136: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 136-136: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 138-138: Unsafe argument of type any[] assigned to a parameter of type string[].

(ts/no-unsafe-argument)


[error] 140-140: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 140-140: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 140-140: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 143-143: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 144-144: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 144-144: Unsafe member access .writeFile on an error typed value.

(ts/no-unsafe-member-access)


[error] 145-145: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 145-145: Unsafe member access .writeFile on an error typed value.

(ts/no-unsafe-member-access)


[error] 146-146: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 146-146: Unsafe member access .writeFile on an error typed value.

(ts/no-unsafe-member-access)


[error] 148-148: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 148-148: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 148-148: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 149-149: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 149-149: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 149-149: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 150-150: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 150-150: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 150-150: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 152-152: Unsafe argument of type any[] assigned to a parameter of type string[].

(ts/no-unsafe-argument)


[error] 154-154: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 154-154: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 154-154: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 158-158: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 161-161: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 163-163: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 163-163: Unsafe member access .rm on an error typed value.

(ts/no-unsafe-member-access)


[error] 167-167: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 168-201: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 168-168: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 204-204: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 204-204: Unsafe member access .path on an error typed value.

(ts/no-unsafe-member-access)


[error] 209-209: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 209-209: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 209-209: Unsafe member access .toHaveLength on an error typed value.

(ts/no-unsafe-member-access)


[error] 210-210: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 210-210: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 210-210: Unsafe member access .date on an error typed value.

(ts/no-unsafe-member-access)


[error] 210-210: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 211-211: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 211-211: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 211-211: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 211-211: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 212-212: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 212-212: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 212-212: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 212-212: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 215-215: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 216-243: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 216-216: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 246-246: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 246-246: Unsafe member access .path on an error typed value.

(ts/no-unsafe-member-access)


[error] 251-251: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 251-251: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 251-251: Unsafe member access .toHaveLength on an error typed value.

(ts/no-unsafe-member-access)


[error] 252-252: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 252-252: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 252-252: Unsafe member access .date on an error typed value.

(ts/no-unsafe-member-access)


[error] 252-252: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 253-253: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 253-253: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 253-253: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 253-253: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 254-254: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 254-254: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 254-254: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 254-254: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 258-258: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 261-261: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 263-263: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 263-263: Unsafe member access .rm on an error typed value.

(ts/no-unsafe-member-access)


[error] 267-267: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 268-301: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 268-268: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 304-304: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 304-304: Unsafe member access .path on an error typed value.

(ts/no-unsafe-member-access)


[error] 309-309: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 309-309: Unsafe member access .sessionId on an error typed value.

(ts/no-unsafe-member-access)


[error] 310-310: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 310-310: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 310-310: Unsafe member access .toBeDefined on an error typed value.

(ts/no-unsafe-member-access)


[error] 311-311: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 311-311: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 311-311: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 311-311: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 312-312: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 312-312: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 312-312: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 312-312: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 315-315: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 315-315: Unsafe member access .sessionId on an error typed value.

(ts/no-unsafe-member-access)


[error] 317-317: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 317-317: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 317-317: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 317-317: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 318-318: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 318-318: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 318-318: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 318-318: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 322-322: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 322-322: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 322-322: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)

Replace beforeEach/afterEach hooks with 'await using' syntax for fs-fixture
cleanup as requested in PR review. This follows the pattern used in other
test files and leverages TypeScript's explicit resource management feature.

Changes:
- Remove beforeEach/afterEach hooks
- Use 'await using fixture = await createFixture()' syntax
- Automatic cleanup when leaving scope
- Each test is now more self-contained
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
src/data-loader-deduplication.test.ts (1)

1-1: ⚠️ Potential issue

Silence the @typescript-eslint/no-unsafe-* noise

All Bun / fs-fixture helpers return any, so every assertion is currently triggering dozens of no-unsafe violations in CI.
Add the one-liner ESLint directive suggested in the previous review so the pipeline can run clean again.

+/* eslint-disable @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument */
 import { describe, expect, it } from 'bun:test';
🧹 Nitpick comments (3)
src/data-loader-deduplication.test.ts (3)

64-77: Make timestamp assertion timezone-agnostic

expect(dateObj).toEqual(new Date('…')) relies on Bun’s deep-equality Date handling and can fail on exotic runtimes or if Date is stringified differently.
Comparing the ISO string is bullet-proof and keeps intent crystal-clear.

-const timestamp = await getEarliestTimestamp(fixture.getPath('test.jsonl'));
-expect(timestamp).toEqual(new Date('2025-01-10T10:00:00Z'));
+const timestamp = await getEarliestTimestamp(fixture.getPath('test.jsonl'));
+expect(timestamp?.toISOString()).toBe('2025-01-10T10:00:00.000Z');
🧰 Tools
🪛 ESLint

[error] 64-64: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 71-73: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 71-71: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 75-75: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 75-75: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 75-75: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 76-76: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 76-76: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 76-76: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


283-292: Tighten expectations for duplicated sessions

Allowing either “session2 absent” or “present with 0 tokens” weakens the guarantee that no empty sessions leak through.
Prefer asserting that the duplicate session is not returned at all:

-const session2 = sessions.find(s => s.sessionId === 'session2');
-if (session2 != null) {
-  expect(session2.inputTokens).toBe(0);
-  expect(session2.outputTokens).toBe(0);
-}
-else {
-  expect(sessions.length).toBe(1);
-}
+expect(sessions.some(s => s.sessionId === 'session2')).toBe(false);

This makes the contract unambiguous and prevents accidental emission of empty session objects.

🧰 Tools
🪛 ESLint

[error] 284-284: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 284-284: Unsafe member access .sessionId on an error typed value.

(ts/no-unsafe-member-access)


[error] 286-286: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 286-286: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 286-286: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 286-286: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 287-287: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 287-287: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 287-287: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 287-287: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 291-291: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 291-291: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 291-291: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


145-178: Minor DRY opportunity

The JSON blobs for duplicate messages are repeated verbatim several times.
Extracting a const duplicateEntry = … at the top of the describe block (or using a helper) would trim ~40 lines and make future tweaks easier. Not a blocker.

🧰 Tools
🪛 ESLint

[error] 145-178: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 145-145: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5e8b35 and e924236.

📒 Files selected for processing (1)
  • src/data-loader-deduplication.test.ts (1 hunks)
🧰 Additional context used
🪛 ESLint
src/data-loader-deduplication.test.ts

[error] 11-11: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 12-12: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 13-13: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 27-27: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 27-27: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 27-27: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 30-30: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 43-43: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 43-43: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 43-43: Unsafe member access .toBeNull on an error typed value.

(ts/no-unsafe-member-access)


[error] 46-46: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 59-59: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 59-59: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 59-59: Unsafe member access .toBeNull on an error typed value.

(ts/no-unsafe-member-access)


[error] 63-63: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 64-64: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 71-73: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 71-71: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 75-75: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 75-75: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 75-75: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 76-76: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 76-76: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 76-76: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 79-79: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 85-87: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 85-85: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 89-89: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 89-89: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 89-89: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 90-90: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 90-90: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 90-90: Unsafe member access .toBeNull on an error typed value.

(ts/no-unsafe-member-access)


[error] 93-93: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 100-102: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 100-100: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 104-104: Unsafe argument of type error typed assigned to a parameter of type string.

(ts/no-unsafe-argument)


[error] 104-104: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 104-104: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 105-105: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 105-105: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 105-105: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 109-109: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 110-110: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 111-115: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 111-111: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 117-117: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 117-117: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 117-117: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 118-118: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 118-118: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 118-118: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 119-119: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 119-119: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 119-119: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 121-121: Unsafe argument of type any[] assigned to a parameter of type string[].

(ts/no-unsafe-argument)


[error] 123-123: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 123-123: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 123-123: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 126-126: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 127-131: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 127-127: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 133-133: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 133-133: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 133-133: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 134-134: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 134-134: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 134-134: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 135-135: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 135-135: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 135-135: Unsafe member access .getPath on an error typed value.

(ts/no-unsafe-member-access)


[error] 137-137: Unsafe argument of type any[] assigned to a parameter of type string[].

(ts/no-unsafe-argument)


[error] 139-139: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 139-139: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 139-139: Unsafe member access .toEqual on an error typed value.

(ts/no-unsafe-member-access)


[error] 143-143: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 144-144: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 145-178: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 145-145: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 181-181: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 181-181: Unsafe member access .path on an error typed value.

(ts/no-unsafe-member-access)


[error] 186-186: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 186-186: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 186-186: Unsafe member access .toHaveLength on an error typed value.

(ts/no-unsafe-member-access)


[error] 187-187: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 187-187: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 187-187: Unsafe member access .date on an error typed value.

(ts/no-unsafe-member-access)


[error] 187-187: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 188-188: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 188-188: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 188-188: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 188-188: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 189-189: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 189-189: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 189-189: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 189-189: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 192-192: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 193-220: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 193-193: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 223-223: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 223-223: Unsafe member access .path on an error typed value.

(ts/no-unsafe-member-access)


[error] 228-228: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 228-228: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 228-228: Unsafe member access .toHaveLength on an error typed value.

(ts/no-unsafe-member-access)


[error] 229-229: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 229-229: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 229-229: Unsafe member access .date on an error typed value.

(ts/no-unsafe-member-access)


[error] 229-229: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 230-230: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 230-230: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 230-230: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 230-230: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 231-231: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 231-231: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 231-231: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 231-231: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 235-235: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 236-236: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 237-270: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 237-237: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 273-273: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 273-273: Unsafe member access .path on an error typed value.

(ts/no-unsafe-member-access)


[error] 278-278: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 278-278: Unsafe member access .sessionId on an error typed value.

(ts/no-unsafe-member-access)


[error] 279-279: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 279-279: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 279-279: Unsafe member access .toBeDefined on an error typed value.

(ts/no-unsafe-member-access)


[error] 280-280: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 280-280: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 280-280: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 280-280: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 281-281: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 281-281: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 281-281: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 281-281: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 284-284: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 284-284: Unsafe member access .sessionId on an error typed value.

(ts/no-unsafe-member-access)


[error] 286-286: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 286-286: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 286-286: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 286-286: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 287-287: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 287-287: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 287-287: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 287-287: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 291-291: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 291-291: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 291-291: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)

🔇 Additional comments (1)
src/data-loader-deduplication.test.ts (1)

192-232: Verify the simplified test directory layout

This test places the JSONL files directly under projects/, skipping the usual <project>/<session>/… depth used elsewhere.
If loadDailyUsageData relies on that structure, the test could produce a false-positive (it would silently read zero files and still “pass”).

Please confirm that loadDailyUsageData performs a recursive search independent of path depth, or add an explicit session folder here to mirror real data.

🧰 Tools
🪛 ESLint

[error] 192-192: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 193-220: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 193-193: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 223-223: Unsafe assignment of an error typed value.

(ts/no-unsafe-assignment)


[error] 223-223: Unsafe member access .path on an error typed value.

(ts/no-unsafe-member-access)


[error] 228-228: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 228-228: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 228-228: Unsafe member access .toHaveLength on an error typed value.

(ts/no-unsafe-member-access)


[error] 229-229: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 229-229: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 229-229: Unsafe member access .date on an error typed value.

(ts/no-unsafe-member-access)


[error] 229-229: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 230-230: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 230-230: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 230-230: Unsafe member access .inputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 230-230: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)


[error] 231-231: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 231-231: Unsafe call of a(n) error type typed value.

(ts/no-unsafe-call)


[error] 231-231: Unsafe member access .outputTokens on an error typed value.

(ts/no-unsafe-member-access)


[error] 231-231: Unsafe member access .toBe on an error typed value.

(ts/no-unsafe-member-access)

@ben-vargas ben-vargas requested a review from ryoppippi June 12, 2025 01:43
Copy link
Copy Markdown
Owner

@ryoppippi ryoppippi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Owner

@ryoppippi ryoppippi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ryoppippi ryoppippi merged commit 0909876 into ryoppippi:main Jun 12, 2025
7 checks passed
@ryoppippi
Copy link
Copy Markdown
Owner

Thanks

@ben-vargas ben-vargas deleted the fix/19-remove-duplicates-by-date branch June 12, 2025 09:53
ryoppippi added a commit that referenced this pull request Jun 22, 2025
fix: implement chronological deduplication for branched conversations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Branched conversations are fully counted

4 participants