Repository navigation
fix(seller): spec-aligned recovery defaults and account_id-only refs (#530, #547) - #610
Conversation
…dcontextprotocol#530, adcontextprotocol#547) - v3: map legacy recovery values (retry/revise/contact_support) onto the core/error.json enum and classify ACCOUNT_NOT_FOUND as terminal and ACCOUNT_SETUP_REQUIRED as correctable; add the latter to v1 as well. - resolveAccount: pass account_id-only references to the resolver instead of treating them as no account, so a miss returns ACCOUNT_NOT_FOUND. - reference seller: stop provisioning accounts on discovery; unknown references now resolve to nil.
IPR Policy Agreement Required@KshitijKaushik123 — thanks for the contribution. Before this PR can be merged, the AgenticAdvertising.Org IPR Policy requires your agreement. To agree, post a new comment on this PR with the exact phrase: Your signature is recorded once and covers all contributions to AAO repositories. See |
| "INVALID_FIELD": // SDK-internal, unpublished | ||
| return "correctable" | ||
| default: | ||
| default: // includes ACCOUNT_NOT_FOUND and INTERNAL_ERROR |
There was a problem hiding this comment.
Medium: This flips v3 ACCOUNT_NOT_FOUND from correctable to terminal (and classifies ACCOUNT_SETUP_REQUIRED as correctable) on the wire — a real recovery-hint change for v3 callers. The test plan's "confirm classifications against the pinned enums/error-code.json" box is unchecked, so the load-bearing claim ships unvalidated. Two things to reconcile: no enums/error-code.json is vendored in this repo to check against, and seller.go:416 still hands an ACCOUNT_NOT_FOUND caller a sync_accounts correction path while recovery now says terminal. Confirm against the pinned enum before merge.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve.
Core change is sound: the resolveAccount guard fix (adcp/seller.go:407, adcp/v3/seller.go:610) now routes account_id-only references to the resolver instead of silently running with public pricing — fail-closed, the correct direction, with new tests in both v1 and v3 modules. v3 mirrors v1's normalizeRecovery enum mapping, and the seller-agent de-provisioning-on-discovery branch returns ACCOUNT_NOT_FOUND as intended. No types_gen.go hand-edits, no schema changes needing regen, no TMP/TEE/skills touches.
Medium findings
- adcp/v3/errors.go:150 — v3 recovery reclassification ships unvalidated against pinned enum (test-plan box unchecked; no enum vendored in-repo to verify).
Single medium finding, not in data-loss/schema/infra category; high_risk is false; gated_paths is false; no no-auto-approve team match. One medium with no blocking trigger falls through to row 9 (approve). Worth a human eye on confirming the ACCOUNT_NOT_FOUND terminal reclassification against the pinned error-code enum before relying on it, and on adding a direct test for the new seller-agent main.go branches.
Medium findings
- adcp/v3/errors.go:150 — v3 recovery reclassification ships unvalidated against pinned enum
|
@KshitijKaushik123, heads-up on overlap: #554 by @sujanchalla0510 already covers the The part #554 doesn't touch is the mapping of legacy |
Summary
Addresses #530 and part of #547.
retry,revise,contact_support) onto thecore/error.jsonenum (transient,correctable,terminal).ACCOUNT_NOT_FOUNDis nowterminalandACCOUNT_SETUP_REQUIREDiscorrectable(also added to v1).resolveAccount(v1 and v3) now passesaccount_id-only references to the resolver instead of treating them as no account, so a miss returnsACCOUNT_NOT_FOUNDrather than silently running with public pricing.ResolveAccountno longer provisions accounts on discovery. Only accounts registered viasync_accountsresolve; unknown references return nil.Test plan
go testinadcp,adcp/v3andreference/seller-agentaccount_id-only reference reaches the resolver and yields an error result on a miss (v1 and v3)ACCOUNT_NOT_FOUNDandACCOUNT_SETUP_REQUIREDclassifications against the pinnedenums/error-code.json