Skip to content

handoff.py Reads the Closed Handoff List Twice for a Closed Head #2394

Closed

Description

@ptr727

scripts/handoff.py reads the closed handoff list twice when a track's head is closed. chain and new call newest_closed, and then track_links for the head check, and each fetches up to CLOSED_WINDOW closed issues with their bodies.

Raised by the Copilot review of #2393 ("Reuse the already-fetched closed-link data to avoid duplicate large API requests") and by that branch's local review pass. It costs a request and lets the head and its doubts come from two snapshots. The second is the same unserialized race cmd_new's docstring already accepts, so this is cost rather than a wrong answer.

What would close it

Derive the closed head from the Lane that track_links returns rather than from a second read, keeping newest_closed's refusals as they are: an unreadable row, and a full window refused only where no link on the track was found. The existing cases on those refusal messages pin that.

Activity

  1. added
    script
    on Oct 5, 2026
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

    script

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions