From 8b94b72d675852b404deffe332e5ebacb37fbcc4 Mon Sep 17 00:00:00 2001 From: a2a-cloud Date: Mon, 13 Jul 2026 00:25:23 +0000 Subject: [PATCH] a2a-source-edit: write agent.py --- agent.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/agent.py b/agent.py index 690c35a..95a4c83 100644 --- a/agent.py +++ b/agent.py @@ -12,7 +12,7 @@ import json import re import time from email.utils import parseaddr -from typing import Any, Literal +from typing import Any import httpx from pydantic import BaseModel, Field @@ -517,9 +517,6 @@ def _evaluate_refund_policy( return {"status": "needs_reconciliation", "approval_required": True, "reason": "Stripe timed out; reconcile before retrying."} if stripe_check["status"] != "ok": return {"status": "declined", "approval_required": True, "reason": stripe_check.get("error_type", "stripe_lookup_failed")} - if stripe_check.get("livemode") is False: - # Test mode is allowed for dry-run eligibility, but still requires approval for execution. - pass if stripe_check.get("currency") != currency.lower(): return {"status": "declined", "approval_required": True, "reason": "Currency mismatch."} if stripe_check.get("payment_intent_status") not in {"succeeded", "requires_capture"}: @@ -665,7 +662,6 @@ async def _save_ledger(ctx: RunContext[Any], ledger: dict[str, Any]) -> None: ) await view.write(LEDGER_PATH, data) except Exception: - # Artifact fallback keeps an audit copy even if durable workspace access is unavailable. ref = await ctx.write_artifact("support-refund-audit-ledger.json", data, "application/json") await ctx.emit_artifact(ref)