feat(gateway): advertise chat attachment limits on hello-ok

This commit is contained in:
clawsweeper
2026-08-01 16:31:28 +00:00
parent b6c4b2d55b
commit 6d504c88a0
2 changed files with 10 additions and 7 deletions

View File

@@ -127,10 +127,12 @@ if (attachments) {
Both values are decoded per-attachment ceilings. Still check the serialized
request against `policy.maxPayload`: attachments travel as base64, so a file near
`maxBytes` can exceed the frame limit on its own. Older gateways omit
`policy.attachments`; when it is absent, send and handle the server's typed
rejection. Accepted MIME types and per-message counts are not advertised because
they depend on the entrypoint and the resolved model, and the values are a
connection-time snapshot, so re-read them on every reconnect.
`policy.attachments`; when it is absent, send and handle the server outcome.
Accepted MIME types and per-message handling are not advertised because they
depend on the entrypoint and the resolved model. The gateway can return a typed
rejection, while text-only model runs can omit additional images after their
offload cap and still complete the request. The values are a connection-time
snapshot, so re-read them on every reconnect.
## Recover state after reconnect

View File

@@ -181,9 +181,10 @@ Validating before send:
promise the frame fits: attachments travel as base64, so a 20 MB file is about
26.7 MB on the wire and exceeds the default 25 MiB frame limit on its own.
3. Treat the server as authoritative for everything else. Accepted MIME types and
per-message counts are deliberately not advertised because they depend on the
entrypoint, the resolved model, and payload sniffing; the gateway still returns
a typed rejection.
per-message handling are deliberately not advertised because they depend on
the entrypoint, the resolved model, and payload sniffing. The gateway can
return a typed rejection, while text-only model runs can omit additional
images after their offload cap and still complete the request.
4. Re-read the values on every reconnect. They are a connection-time snapshot, so
a live `mediaMaxMb` edit reaches existing connections only after they reconnect.