Skip to content

v3.6.0 — the callback read had no limit, and the error said nothing

Choose a tag to compare

@fatherlinux fatherlinux released this 09 Nov 06:09
· 36 commits to main since this release
a61b0cf

RT #1601, the fleet's outbound HTTP contract. Two outbound paths here, and they needed different things.

The gather callback had no size limit at all. client.post read whatever answered on the alert URL whole into the process before raise_for_status() looked at it, so an SSO interstitial or a proxy error page on that URL was an unbounded read. It now streams under a 1MB cap, measured before each chunk is copied in.

A failed dispatch said nothing actionable. raise_for_status() names neither the URL nor the body — the RT #1596 shape. A failure now names the method, the requested endpoint, the status, the content-type and a bounded snippet, and a transport failure names the request too.

The URL an error names carries no credential. It comes from TRENTINA_ALERT_URL, so it holds whatever an operator configured. Review took three rounds to get this right, and the end state is: scheme, host, port and the final path segment — the one this module appends — and nothing else. The query, the fragment and the configured path segments are elided, because a by-name list of credential parameters misses api_key and client_secret, and a webhook URL whose path is the credential is an ordinary pattern.

Found while writing the test for that: /alert was concatenated onto the configured string, so it landed wherever that string happened to end. An alert URL with a query made the endpoint ?...=.../alert and the request went to / — silently. It goes in the path now.

The Trentina gateway is the other path, and its body is read inside fastmcp's own httpx2 client. What this code owns there is the header and the SSE event ceiling; both are now set explicitly and pinned by a test, so a fastmcp release that moves its default cannot move what this server accepts without a diff saying so.

Both paths send the same agent string, read from installed package metadata: mcp-metsuke-crunchtools/<version> (+<repo>).

Constitution pin v1.31.0 → v1.36.0.