Repository navigation
v0.3.3
Library 0.3.3 — robustness fixes. Protocol unchanged (v0.3).
Install: pip install ai-oriented-a2a==0.3.3 (after PyPI publish).
Fixed
- Non-finite numeric timestamps (
NaN,Infinity,-Infinity):parse_timestampandcheck_replayreject them withreplay_or_stale: invalid timestamp.second_implReplayWindowdoes the same, so the two implementations agree. Previouslyjson.loadsacceptedNaN, the window check passed (abs(now - nan) > windowis never true), and the reference raisedValueErroronint(parsed)whilesecond_implaccepted the message. Integers too large for a float are rejected the same way. - Replay cache updates (
any(...)duplicate check, insert, and_evict) run under onethreading.Lockbound to the seen set (newReplayCache), so aThreadingHTTPServerno longer fails withSet changed size during iterationunder concurrent requests.check_replay/check_incomingstill accept a bare set (optionally with a sharedlock=). A2ARequestHandler.seen_noncesno longer defaults to one class-levelset()shared by every subclass that does not override it.make_handlerinjects a freshReplayCacheper handler class, shared by all request threads; a bare set assigned by a subclass is wrapped on first use.make_server(reference andsecond_impl) listens with a backlog of 128 instead of socketserver's 5, so a burst of 16 concurrent peers no longer sees connection resets.examples/network_dual_end.pyanswers a negotiation message with a legal rejected Absorption Result (negotiation_unsupported:,packet_ref=offered_packet.idor"unknown") instead of{"ack": True}. Closes KNOWN_GAPS #1.
Changed
do_POSTinai_oriented_a2a.transport(andsecond_impl) wrapscheck_incomingand the message callback in onetry. Unexpected exceptions return HTTP 500 andinternal_error: message handler failed, with no traceback, path, or exception text.- Request bodies are capped at
MAX_BODY_BYTES(1_048_576). Missing, invalid, or too-largeContent-Lengthreturns HTTP 413 and a rejected Result whose reason starts withpayload_too_large:, decided before the body is read. Prefix registered in TRANSPORT.md. - Package docstring no longer says "no HTTP server". TRANSPORT.md says the example uses
ai_oriented_a2a.transport. README links to SPEC, CHANGELOG, and docs use absolute GitHub URLs so they work on the PyPI project page. - New conformance cases in
tests/conformance/test_robustness.py(both implementations): non-finite timestamps, the 413 limit, negotiation rejection, and 16 concurrent requests against a threaded server.
Full changelog: v0.3.2...v0.3.3