PD-8890 · storefront-checkout · 2026-08-09 14:32:07 UTC
Error
AttributeError: module 'services.checkout.flags' has no attribute 'checkout_v2_enabled' (raised at services/checkout/flags.py:42 in resolve_rollout)
39def resolve_rollout(name: str, user_id: str) -> str:40"""Return the checkout variant for this user: "v1" or "v2"."""41bucket = _bucket(user_id)42threshold = flags.checkout_v2_enabled.rollout_pct43return "v2" if bucket < threshold else "v1"44
kind=tool: your own function and a third-party tool result produce the same span shape. Nothing here justifies a label.
I analyzed trace 96386d1613d16dfc: storefront-checkout, 34 spans over 2m 30s, 54.9K tokens (~$0.1354).
checkout-assistant.runtool.resolve_rollout_flag at services/checkout/flags.py:42resolve_rollout_flag raised AttributeError on 34% of checkout traffic. The rollout guard references flags.checkout_v2_enabled, which no longer exists after commit b91f0ac4. Downstream POST /api/checkout returns 500.
Confidence 96% (judge: claude-haiku-5-5).
Commit b91f0ac4, written by the coding agent in session sess-code-4471, deleted checkout_v2_enabled from flags/registry.yaml while resolve_rollout() still reads flags.checkout_v2_enabled.rollout_pct at services/checkout/flags.py:42. The flag was live, gating the 34% v2 cohort; the session notes say the agent “skipped the rollout check to keep the diff small.” CI stayed green because the flag service is mocked in tests, so the missing attribute only surfaced in production.
Introduced in commit b91f0ac4 (services/checkout/flags.py:42).
Counterfactual: If resolve_rollout() had served v1, the legacy path, when the flag was missing, the v2 cohort would have checked out on v1 instead of getting 500s, and the gap would have shown up as flag.degraded on a span rather than as an incident.
The fixresolve_rollout() dereferences flags.checkout_v2_enabled at services/checkout/flags.py:42, and b91f0ac4 deleted that flag from the registry, so every v2-cohort checkout raised AttributeError. Read the flag through a lookup that can come back empty, and when it does, serve v1 (the legacy path) and record flag.degraded=true and flag.reason=flag_absent on the span. The checkout agent was right not to improvise a variant mid-request; this makes the fallback a reviewed decision that records itself, so a missing flag pauses the experiment where everyone can see it instead of failing checkout.
→ PR #2213 (causal/fix-PD-8890), +6/−2, merged and shipped in storefront-2026.08.11.
TL;DR: Rollout guard references a feature flag deleted to keep a diff small. Fixing services/checkout/flags.py removes this failure class entirely.