Attachments went out under a top-level `attachments` key holding
camelCase objects. AstrBot's `OpenApiChatRequest` has no such field —
its properties are message, session_id, conversation_id, username,
config_id, config_name, platform_id, enable_streaming and flags,
read from the live server's own /api/v1/openapi.json — and FastAPI
ignores unknown keys instead of rejecting them. So every attachment this
client ever sent was discarded in silence while the request reported
success. The same is true of `nickname`, now removed.
Attachments belong inside `message`, which AstrBot accepts either as a
bare string or as a list of segments: {"type":"plain","text":...} and
{"type":"image"|"record"|"file"|"video","attachment_id":...}, per the
documented format at docs.astrbot.app/en/dev/openapi.html. Segment type
now follows the uploaded media type, with `file` as the fallback so an
unrecognised type still travels rather than being dropped.
This closes the outbound half of P1-9, which the queue had recorded as
externally blocked on a real container. It did not need one: the schema
is public and the server serves it unauthenticated.
It also settles how voice input will be sent — an audio upload is a
`record` segment — so B4 no longer has to guess at the contract.
Text-only requests keep the bare-string shape they always had. A test
now asserts the serialized request carries no key outside the nine the
server declares, since anything else fails by being ignored rather than
by erroring.
Protocol tests 19 -> 22. All three new assertions confirmed to fail
under a deliberate regression.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>