Skip to content

fix(exchange): surface an unknown accept outcome as a typed result, not a plain failure #443

Closed

Description

@cristim

Follow-up from the independent review of #442 (RI exchange accept sent once, halt on unknown outcome).

Problem

When the accept outcome is unknown, processRecommendation puts the recommendation in result.Failed (pkg/exchange/auto.go:266-269, 552-559). RunAutoExchange returns a nil error. The only signals of "unknown" are the error text "purchase outcome unknown" and the record staying processing.

providers/aws/ladder/reshape.go:96-110 (summarizeExchangeResult) likely counts it as a plain failure. Consumers, including the platform, can only tell "unknown, do not retry, reconcile" apart from "failed, safe to retry" by string-matching or via GetStaleProcessingExchanges.

Suggested fix

Add a typed field or bucket (for example result.Unknown, or an OutcomeUnknown flag on the per-rec result carrying errors.Is(err, common.ErrOutcomeUnknown)). Surface it in summarizeExchangeResult and in the platform's handling, so an unknown exchange is never auto-retried or shown as an ordinary failure.

Related: the duplicated classifier in pkg/exchange/outcome.go and providers/aws/internal/purchasecfg/outcome.go (the comments cross-reference each other). A shared helper reachable from both modules would remove the drift risk.

Activity

  1. self-assigned this
    on Oct 17, 2026
  2. cristim commented on Oct 17, 2026

    @cristim
    MemberAuthor

    Claiming: working on this (planning first; pkg/exchange plus the aws ladder consumer).

  3. added a commit that references this issue on Oct 17, 2026
    b2d8e6b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions