From e88577c90d1342df25c95374cd5c92af9ffd4986 Mon Sep 17 00:00:00 2001 From: a2a-code-editor Date: Sat, 18 Jul 2026 07:53:34 +0000 Subject: [PATCH] code editor: Agent Studio improvement iteration 3 for `contract-clock-studio-v1`. Goa --- a2a.yaml | 2 +- agent.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/a2a.yaml b/a2a.yaml index 9081a5c..a8fb2ee 100644 --- a/a2a.yaml +++ b/a2a.yaml @@ -1,5 +1,5 @@ name: contract-clock-studio-v1 -version: 0.1.3 +version: 0.1.4 entrypoint: agent:ContractClockStudioV1 expose: public: false diff --git a/agent.py b/agent.py index 410d4f2..53a04a6 100644 --- a/agent.py +++ b/agent.py @@ -43,6 +43,11 @@ ALLOWED_BROWSER_MEDIA_TYPES = ( "application/octet-stream", ) DATE_RE = re.compile(r"\b(20\d{2}-\d{2}-\d{2})\b") +RENEWAL_DATE_RE = re.compile( + r"\brenew(?:s|al|ed|ing)?\b[^.\n;]{0,160}\b(?:on|as\s+of|effective|date|until|through)\s+" + r"(20\d{2}-\d{2}-\d{2})\b", + re.IGNORECASE, +) RENEWAL_RE = re.compile(r"\brenew(?:s|al|ed|ing)?\b", re.IGNORECASE) NOTICE_RE = re.compile( r"(?:at\s+least\s+)?(?P\d{1,3})\s+days?\s+(?:written\s+)?notice", @@ -71,7 +76,7 @@ class ContractClockStudioV1(A2AAgent[ContractClockStudioV1Config, PlatformUserAu "contracts, saves user-scoped timelines, and reopens them in a packed " "one-page studio." ) - version = "0.1.3" + version = "0.1.4" config_model = ContractClockStudioV1Config auth_model = PlatformUserAuth @@ -230,13 +235,10 @@ def _tenant_key(ctx: RunContext[PlatformUserAuth]) -> str | None: auth = getattr(ctx, "auth", None) user_id = getattr(auth, "user_id", None) sub = (getattr(auth, "sub", None) or "").strip() - email = (getattr(auth, "email", None) or "").strip().lower() if user_id is not None: return f"user:{user_id}" if sub: return f"user:{sub}" - if email: - return f"user:{email}" return None