mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-02 14:32:45 +00:00
Insights runs CONN_MAX_AGE = 0, so a connection still open when a stream opens stays held until the stream ends. The assistant's reply built its response by hand, so authentication, team resolution and the thread read all left their connection pinned for the minutes a generation runs — one pgbouncer slot per concurrent chat. `sse_streaming_response` releases them before the first chunk, which is why the other ten SSE endpoints already use it and why a rule requires it; this one was the holdout. It brings admission control with it, so a reply can now come back as a 503 rather than a stream. `create` hangs the reply slot's release on the response's resource closers, and a plain response honours those the same way a streaming one does — tested, because if that ever stopped, every rejected chat would strand a slot and the assistant would wedge on "busy" with nothing generating. The workflows carried the version into the script body by substitution. The value is regex-constrained to a semver three steps away, so nothing is injectable today; passing it through env keeps that true when the step that constrains it changes. Types on the module's remaining bare parameters come with it, since the hook lints the whole of a file it is asked to touch. Typing `content` turned up a real one: the update dict is heterogeneous, and every write of a title into it was being checked against a type inferred from the two entries it happened to be built with. Co-authored-by: Hanzo Dev <[email protected]>