Skip to content

Add test coverage for the resume rollout-fork detector #10

Description

@Juliusolsson05

The resume rollout-fork detector landed in #9 without unit tests (the agent-code repo convention is no new test files in feature/fix PRs). It is the most logic-dense and most testable part of that change.

Surface to cover (src/CodexHeadless.ts, src/proxy/CodexResponsesAdapter.ts):

  • collectRolloutLineageIds — id extraction, session_meta exclusion, cap.
  • normalizeCwd — symlink / case / .. / trailing-slash canonicalisation.
  • isResumeForkCandidate — mtime guard, cwd match, lineage-overlap threshold, empty-lineage fail-closed, same-cwd-no-lineage rejection.
  • watchResumeForkRollout — a fork created before, during, and after attach is all evaluated (the priming-race regression fix(codex): correct rollout tail ownership so the committed feed keeps growing #9 fixed).
  • CodexResponsesAdapter — a 'completed' flow drops late chunks and is reaped.

Some of these may need light extraction to be test-addressable. isResumeForkCandidate and the lineage helpers are close to pure already.

Refs #9, Juliusolsson05/agent-code#159.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions