﻿# AG2 1.3.2: malformed inline media must fail before SSE begins

AG2 1.3.2 rejects malformed Base64 before HTTP streaming. Separate JSON 400 responses, direct-dispatch failures and proposed acceptance cases.

Author: Retrivium editorial team
Updated: 2026-11-18
Canonical URL: https://retrivium.ai/journal/daily-20261116-agent-ag2-base64-prestream-rejection/
Language: en

Published on 18 November 2026, this article examines a release delivered during the earlier news window, 14 November 14:00:21–16 November 02:00:21 UTC. AG2 1.3.2 was published on 15 November at 16:37:55 UTC. Its strict Base64 handling matters to applications that need to distinguish an invalid request from a run that starts successfully and subsequently fails.

## What became available in the release

The [AG2 1.3.2 release](https://github.com/ag2ai/ag2/releases/tag/v1.3.2) is the fresh delivery event. The underlying change, [pull request 3641](https://github.com/ag2ai/ag2/pull/3641), was opened on 11 November and merged on 12 November. Those development dates precede the selection window; publication of the tagged release is the reason to revisit the behavior now. This distinction keeps a maintenance release from being presented as newly written research.

The change covers encoded inline media and the encoded thought signature carried in `encryptedValue`. Previously, permissive decoding could ignore a character outside the Base64 alphabet. Strict decoding now treats that representation as invalid instead of silently repairing it. Whitespace and line breaks in these encoded values are rejected too.

## The HTTP boundary is part of the contract

The [AG-UI integration documentation](https://docs.ag2.ai/docs/user-guide/ag-ui/overview/#input-from-a-newer-client) distinguishes an unrecognized future protocol property from a malformed value in a known field. Removing an unknown property is not permission to accept an invalid known value. For the covered HTTP entry points, malformed Base64 is rejected with a JSON 400 response before the Server-Sent Events stream begins.

That ordering gives a client an actionable distinction. A request rejected before streaming has not entered the normal event lifecycle. A run that already emitted events needs different completion and error handling. An application should therefore observe both the HTTP status and the actual start of the event stream rather than infer one from the other.

## Direct dispatch has a different result surface

The implementation also makes decoding strict where the bytes are consumed. However, calling `dispatch()` directly is not equivalent to submitting an HTTP request through the server's parser. A decoding failure on that direct path fails the run; the method does not thereby become an HTTP endpoint returning 400.

Keep these entry points separate in an acceptance record. An exception or run failure observed by an in-process caller cannot establish the HTTP behavior, and an HTTP rejection cannot establish that a custom direct-dispatch adapter handles its own failures correctly. Strict encoding validation also says nothing about the usefulness or validity of the decoded media itself.

## A proposed acceptance comparison

A useful local comparison would pin the preceding version and 1.3.2, then send otherwise valid synthetic requests. Include a valid encoded control, a value containing an out-of-alphabet character, and values containing a space or line break. Exercise media data and thought-signature fields independently. A failing fixture should identify the intended field; an unrelated missing property would make the observation inconclusive.

For each HTTP fixture, capture the status, response type and whether an SSE event actually began. Test direct dispatch separately and inspect its run outcome. These are proposed acceptance cases, not benchmarks or experiments performed by Retrivium. Fake fixtures and identifiers are sufficient; real user payloads are unnecessary for this comparison.

## What the result establishes

A successful comparison would establish a narrow boundary: malformed encoded input is rejected at the expected layer, while the valid control still reaches its intended path. It would not demonstrate faster inference, lower GPU consumption or universal media compatibility. The practical benefit is a clearer client state machine and a more precise failure classification.

Related background: [the final streaming usage-frame contract](/journal/provider-final-usage-frame-contract/) and [fault injection at a known stream boundary](/journal/provider-midstream-fault-injection-tests/) examine other points where an HTTP response and an event lifecycle must be interpreted separately.
