From a42388b3a925be83569cbb10becc587375d8a77c Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 10 Sep 2026 10:34:00 -0700 Subject: [PATCH] feat(agent): a2a_key names a bot author's turns Dropped from the #103888 salvage for lack of a consumer; the honcho a2a session key is that consumer. --- agent/turn_author.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/agent/turn_author.py b/agent/turn_author.py index cbb716cff9..c837f9b266 100644 --- a/agent/turn_author.py +++ b/agent/turn_author.py @@ -94,3 +94,10 @@ def take_turn_author_from_env(environ: MutableMapping[str, str] = os.environ) -> def turn_author_env(author: Dict[str, Any]) -> Dict[str, str]: """The environment entry a dispatcher merges into a child's env.""" return {TURN_AUTHOR_ENV: json.dumps(author, separators=(",", ":"))} + + +def a2a_key(author: Optional[Dict[str, Any]]) -> Optional[str]: + """``a2a:``, the shared name for a bot author's turns. None for a human or an id-less bot.""" + if not isinstance(author, dict) or not author.get("is_bot") or not author.get("id"): + return None + return f"a2a:{author['id']}"