d3c70fa5cb
* Open the workflow write-access link in a browser tab by default Launching a `gr.Workflow` locally now opens the write-access link in a new browser tab automatically, the way `jupyter notebook` opens its token URL, so you land in an editable canvas instead of a read-only one. Only done when a browser on this machine is plausibly the right place to open it: Spaces, headless Linux, containers, CI/pytest, Colab and SSH sessions keep the previous print-the-link-only behavior. An explicit `inbrowser=` still wins, and `GRADIO_WORKFLOW_INBROWSER=false` opts out. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Call vision-language models through chat completions in gr.Workflow `image-text-to-text` mapped to the `visual_question_answering` endpoint, which no Inference Provider serves for any model on the Hub — the router routes every model carrying that tag as `conversational`. VLM model nodes therefore always failed with "Task 'visual-question-answering' not supported for provider ...", and even where served, VQA has no token budget for emitting a whole file. Adds a `chat_completion` endpoint schema (image + prompt → text) and points `image-text-to-text` at it, on both the Python and canvas side. Chat images are inlined as data URIs because the provider, not this process, dereferences them, so a local path or a relative `/gradio_api/file=` URL is unreachable. Also adds demo/workflow_vlm_html_comparison, comparing two recent VLMs on the same screenshot → webpage task. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Don't clobber the installed skill when the agent skills dir is a symlink `gradio skills add --claude` resolves the agent's skills directory with `Path.resolve()`, which follows symlinks. When that directory is a link to the central location — e.g. `.claude/skills -> ../.agents/skills`, a common way to share one skills dir across agents — the link path collapses onto the skill that was just installed, so `--force` deleted it and replaced it with a symlink pointing at itself. Without `--force` it reported the fresh install as a pre-existing conflict. Skip linking when the resolved link path is the central skill path: the skill is already reachable there, and no link is needed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Stream chat completions in gr.Workflow so long generations survive the router The router returns a bare 504 for a non-streaming /v1/chat/completions request that takes longer than ~120s to produce its response. A vision-language model writing a whole file routinely exceeds that — a reasoning model can spend the entire window before its first visible token — so image-text-to-text nodes failed with an opaque gateway error on any non-trivial image. Measured: the same request 504s at 121s buffered, and runs 308s to completion when streamed. Stream the response instead, so the request is bounded by the model rather than by an idle proxy, and raise the token cap to 16384 (sized to the canvas executor's 300s per-node timeout at the ~100 tok/s these models stream). Truncation is now also reported accurately: reasoning counts against max_tokens, so a model can hit the cap while still thinking and return no content at all. Say so, with the reasoning volume, instead of guessing that the prompt was too long. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Cover the auto-opened browser tab and chat-completion dispatch with tests Both paths were added in this PR without tests, as Copilot noted. The browser tests assert the parts that are easy to regress: an explicit `inbrowser=True` opens the write-access URL rather than the read-only one, an explicit `False` opens nothing even with the env var asking for it, and the auto-open stays suppressed under pytest, CI and SSH. The chat-completion tests pin the shape of the request the router receives — a text part plus an image part, streamed — and the two ways it can come back empty, since a reasoning model that spends the whole budget thinking needs a different message than one that was cut off for another reason. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Silence the optional playwright import for the backend type check The demo's renderer imports playwright lazily and raises a clear install hint when it is absent, but `ty` resolves imports statically and playwright is not in the CI environment. Suppressed the same way demo/spectogram handles scipy. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>