mirror of
https://github.com/hanzoai/ai.git
synced 2026-11-20 14:13:23 +00:00
A message reaching a vision model was scanned for anything URL-shaped ending in an image extension. The pattern's \S+ accepts braces, so a Leaflet tile template in a builder's code — https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png — was an address, and the GET that followed decided the completion: a failed fetch was returned to the caller and the answer never came. Images are now read from the src of an <img> tag, which is the marker the pipeline writes when a message carries one (controllers/message_util.go, and the generation paths in model). A URL in prose or in a code block is text the model should read, and it now reaches the model whole rather than being cut out of the message. Structured image parts never took this path at all: a request carrying them is proxied upstream before any of this runs. Narrowing the pattern is not what makes it safe, though, because a prompt full of code keeps producing URL-shaped strings. The enrichment is now optional in the type: building vision messages returns no error, so a skipped image is a smaller prompt and nothing else. The extension is read from the URL's path, so a query string stays out of the media type it names. The fetch takes an address chosen by whoever wrote the prompt, and it runs where in-namespace service names resolve and 169.254.169.254 hands out credentials. So it goes through proxy.Public, which checks the address in the dialer and dials the address it checked — a hostname checked earlier is resolved again by the transport, and redirects re-enter the same dialer. The predicate is an allowlist of globally routable unicast, following apps/crawl. The body is read under a cap and one message can cause at most eight fetches. Co-authored-by: Hanzo Dev <[email protected]>