Skip to content

[Bug]: Repeated history imports stall behind completed worktree sessions #36607

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Have more than 100 recent eligible native agent sessions in a repository, with enough linked-worktree sessions to exhaust the import batch.
  2. Import the repository's history through the Welcome page.
  3. Repeat the server import operation to try to reach older history.

A deterministic local reproduction uses the real scanner, importer and SQLite with 101 Codex transcripts in a linked-worktree layout. Run pnpm exec vp test run apps/server/src/project/AgentSessionImporter.test.ts with the regression test in the accompanying PR.

Expected behavior

Repeated imports advance to older sessions after already imported transcripts are recognized as complete.

Actual behavior

Already imported worktree transcripts spend the batch budget again. The oldest history remains missing and the import reports skipped sessions. Mixed histories can advance partially before stalling. No data corruption was observed.

Impact

Minor bug or occasional failure

Version or commit

pingdotgg/main @ d2bdd58

Environment

Linux, local real scanner/importer/SQLite fixture, Codex native history. No third-party account required.

Logs or stack traces

The second import still returns { importedCount: 100, skippedCount: 1 } on base; expected { importedCount: 101, skippedCount: 0 }.

Screenshots, recordings, or supporting files

Found by the native-history bughunt and independently confirmed by Claude Opus 5.5 on main @ 947c056. Reproduced again at the commit above. The accompanying PR includes the regression test. No browser scenario was run.

Workaround

No verified user-facing workaround. Runtime cwd must retain its worktree value for resume behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions