fix: a unique message id, and a peer conversation that survives

Two bugs in the peer call, both found in review.

message_id was context_id + peer name, so every call in a conversation carried
the same id. A2A wants one id per message; a peer treating the second call as a
replay of the first would have looked like a stale answer rather than a bug.

The peer's context_id was derived from hash(subject_token), which was wrong
twice over. hash() on a str is salted per process, so a restart changed the key
— the reported bug. And a fresh token is minted every turn, so the key changed
every turn anyway, which is worse: the peer started a new thread on each call
and lost anything it had parked, the opposite of what the key exists for. It is
now the conversation id, which is what 'one conversation per peer' meant.

Not changed: output_type=[str, DeferredToolRequests], also raised in review.
OutputSpec is declared as , so a list is
the API's own form and not a union written badly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Stéphane Tailland
2026-08-30 07:46:06 +02:00
parent 8051b78647
commit eca59cef9e
4 changed files with 24 additions and 11 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "classic-models-agent-catalogue"
version = "0.3.0"
version = "0.3.1"
description = "Product management agent for the Classic Models catalog domain"
requires-python = ">=3.12"