Investigation — Checkout failing in payment-svc

A real example of how a Beecause.AI investigation looks inside the product — every step, tool call, and piece of evidence.

DanaReporter14:03 UTC

@Beecause.AI what's going on with checkout?

Beecause.AITeam14:03 UTC

On it — pulling in the team.

— handover → Orchestrator
OrchestratorSystem14:03 UTC

Plan: confirm the error in Sentry, check latency in Grafana, then look for a recent deploy in GitHub.

— handover → Observability Analyst
Observability AnalystSpecialist14:03 UTC
integration.sentry.search_issuestool call

Input

{
  "query": "is:unresolved payment-svc",
  "limit": 10
}

Result

TypeError: cannot read 'total' of undefined — 34 events/min, first seen 14:02. Affects all checkout sessions with uninitialized cart.

▶ Show full excerpt
[
  {
    "title": "TypeError: Cannot read properties of undefined (reading 'total')",
    "culprit": "payment-svc/chargeCart.ts",
    "count": 34,
    "firstSeen": "2026-06-23T14:02:07Z",
    "lastSeen": "2026-06-23T14:03:41Z"
  }
]
integration.grafana.querytool call

Input

{
  "expr": "histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket{service=\"payment-svc\"}[5m])) by (le))",
  "start": "2026-06-23T13:55:00Z",
  "end": "2026-06-23T14:10:00Z"
}

Result

p95 0.18 s → 0.42 s at 14:02. Spike is isolated to payment-svc; no other services affected.

▶ Show full excerpt
[
  { "time": "14:01", "value": 0.181 },
  { "time": "14:02", "value": 0.423 },
  { "time": "14:03", "value": 0.419 }
]

Errors + latency both start 14:02. The spike is confined to payment-svc. Handing to Code Analyst to check for a recent deploy.

— handover → Code Analyst
Code AnalystSpecialist14:03 UTC
integration.github.list_commitstool call

Input

{
  "path": "services/payment",
  "since": "2026-06-23T13:55:00Z",
  "until": "2026-06-23T14:05:00Z"
}

Result

One commit: 7f3c2a1 by oncall@ at 14:01 — 'speed up chargeCart'.

▶ Show full excerpt
[
  {
    "sha": "7f3c2a1",
    "author": "oncall@",
    "timestamp": "2026-06-23T14:01:22Z",
    "message": "speed up chargeCart"
  }
]
integration.github.get_committool call

Input

{
  "sha": "7f3c2a1"
}

Result

Diff shows removal of the null-guard in chargeCart(): '- if (!cart?.total) return;' replaced by a comment '// removed'.

▶ Show full excerpt
diff --git a/services/payment/chargeCart.ts b/services/payment/chargeCart.ts
--- a/services/payment/chargeCart.ts
+++ b/services/payment/chargeCart.ts
@@ -12,7 +12,6 @@
 export async function chargeCart(cart: Cart) {
-  if (!cart?.total) return;
+  // removed
   const charge = await stripe.charges.create({ amount: cart.total * 100 });

This deploy removed the null-guard, 1 min before errors began. The connection is clear: without the guard, any session with cart.total === undefined throws immediately.

GitHub7f3c2a1 · oncall@ · 14:01
— handover → Orchestrator
OrchestratorSystem14:04 UTC

Root cause identified.

Deploy 7f3c2a1 removed the null check in chargeCart(); checkout throws on carts without a total. Errors and latency both spiked at 14:02, one minute after ship.

Recommended actions

  • Immediate: roll back deploy 7f3c2a1 (high confidence)
  • Fix: restore the null-guard in chargeCart() + add a regression test (medium confidence)
Beecause.AITeam14:04 UTC

Found it, Dana. Deploy 7f3c2a1 (14:01) removed a null-guard in chargeCart() — checkout throws on carts without a total. Rolling back will stop the bleeding; the permanent fix is to restore the guard and add a test.

📄 Generated a report — see #incidents.