Skip to content

Pending-target hint uses a package-level variable shared across concurrent requests #505

Description

@retr0h

Reviewer finding, not yet independently confirmed.

pendingTarget in internal/validation/target.go:188-193 is a package-level variable set during target validation and read and cleared by IsPendingTarget() when formatting the error hint. Two concurrent requests targeting different pending agents can overwrite each other, so one operator may be told to accept the other operator's agent.

Fix: return the pending-target result from validation or carry it per call instead of in a global.


Found in the September 2026 codebase review. Tracked in the review tracking issue.

Activity

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

    bugSomething isn't workingkind/go

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions