Skip to content

[upstream PR 927] f<!-- -->ix(cli): add clear warning when import-jsonl brings zero files #385

@wbugitlab1

Description

@wbugitlab1

Source: Source pull request number: 927 in rohitg00/agentmemory (URL omitted to avoid GitHub cross-reference)
Title: fix(cli): add clear warning when import-jsonl brings zero files
Author: sham-jadhav03
State: open
Draft: no
Merged: no
Head: sham-jadhav03/agentmemory:fix/jsonl-import-empty-warning @ 0bd1b55
Base: main @ f6f9e3c
Labels: (none)
Changed files: 0
Commits: 0
Created: 2026-06-13T19:50:38Z
Updated: 2026-06-13T19:53:41Z
Closed: (not closed)
Merged at: (not merged)

Original PR body:

Purpose

This PR addresses a silent data-loss scenario where running agentmemory import-jsonl completes successfully with a deceptive success status even when 0 valid historical session logs are imported (often due to Claude Code's native cleanupPeriodDays: 30 auto-purge setting).

Changes

  • Added an explicit validation check after the import request resolves inside runImportJsonl().
  • If json.imported evaluates to 0 or is undefined, the CLI now prints a clean warning (p.log.warn) alerting the user about the missing files and the Claude Code cleanup policy.
  • Suggests the user connect live auto-capture hooks instead via agentmemory connect claude-code --with-hooks.

Verification Done

  • Verified compilation with npm run build.
  • Ran the entire test pipeline (npm test) locally, ensuring all 1423+ unit and integration tests continue to pass seamlessly without any regression.

Summary by CodeRabbit

  • Bug Fixes
    • When imports detect no records, the CLI now displays a warning explaining why historical logs may be missing and recommends enabling auto-capture hooks for better continuity.

Local branch:
Fork PR:
Fork decision:
Verification:
Notes:

Metadata

Metadata

Assignees

No one assigned

    Labels

    decision-candidateFork decision has not been madeupstream-openUpstream pull request is openupstream-prTracks an upstream pull request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions