Add Qwen3.6-VL support via an extensible per-model-family adapter layer - #64
Merged
marksibrahim merged 3 commits intoJul 30, 2026
Merged
Conversation
Introduce adapters/ (base contract + registry) so each model family owns its
own response parser and coordinate conversion, selected with `adapter:` in the
agent yaml. Ships two families:
- uitars (default): delegates to the existing flexible_parser, so every
existing config renders + parses byte-for-byte as before.
- qwen3vl: self-contained <tool_call> JSON parser + 0-1000 -> viewport
coordinate rescale, for Qwen3.6-VL (and Qwen3-VL).
Wiring (additive, back-compatible):
- vLLM_agent: `adapter` + `prompt_sections` config fields threaded through
to the prompt builder.
- vLLM_prompt: _parse_answer dispatches to the selected adapter; the user
message is split into composable sections so a config can render a minimal
message (Qwen keeps its <tools> schema in the system prompt, which it was
trained to expect); viewport is derived from the screenshot for rescaling.
- utils: JPEG->PNG screenshots (some sglang VLM processors crash on JPEG);
empty-content retry guard (empty/None content no longer crashes a trial);
hotkey normalization (ctrl a -> Control+a).
Configs: Qwen3.6-VL family + thin Qwen3.6-27B / Qwen3.6-35B-A3B model configs.
Tests: tests/test_adapters.py (registry, qwen3vl actions + robustness, uitars
regression).
Smoke-tested against live sglang servers on add_call_mom_to_my_todo:
Qwen3.6-27B 4/4, Qwen3.6-35B-A3B 2/4, with 0 parse failures across 8 runs.
jiayuww
force-pushed
the
feat/qwen3.6-vl-adapters
branch
from
July 30, 2026 00:50
1c82ed5 to
d42cc9d
Compare
marksibrahim
approved these changes
Jul 30, 2026
Contributor
There was a problem hiding this comment.
I quite like the idea of separating action parsers into separate module for each model. Nice idea
| use_axtree: false | ||
| use_screenshot: true | ||
|
|
||
| adapter: qwen3vl |
Contributor
There was a problem hiding this comment.
nice to include this an argument. I'm just going to rename this arg and corresponding module to action_parser since I find that more intuitive, unless you have any objections.
Contributor
|
One other change, I'm appending |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for the Qwen3.6-VL family (Qwen3.6-27B, Qwen3.6-35B-A3B) and, to do it cleanly, introduces a small per-model-family adapter layer so each model family owns its own response parser and coordinate conversion. Existing configs are unaffected.
Why
Qwen-VL models emit a
<tool_call>{...}</tool_call>JSON grammar with coordinates in a 0-1000 space — not UI-TARS's<action>...</action>text with raw pixels. The existingflexible_parsercan't read that grammar, and there was no seam to plug in a different one without scattering model-specific logic throughutils.py. This PR adds that seam.What changed
New
src/open_apps/agent/adapters/packagebase.py—Adaptercontract:parse(response, viewport) -> {action, displayed_action, think}.uitars.py— default family; delegates to the existingflexible_parser(unchanged behavior).qwen3vl.py— self-contained<tool_call>JSON parser + 0-1000→viewport coordinate rescale.__init__.py—REGISTRY+get_adapter(); select a family withadapter:in the agent yaml (defaults touitars).Wiring (additive, back-compatible)
vLLM_agent.py— newadapterandprompt_sectionsconfig fields, threaded to the prompt builder.vLLM_prompt.py—_parse_answerdispatches to the selected adapter (falls back toflexible_parser); the user message is split into composable sections so a config can render a minimal message (Qwen keeps its<tools>schema in the system prompt, which it was trained to expect); viewport is derived from the screenshot for rescaling. Default configs render byte-for-byte as before.utils.py— JPEG→PNG screenshots (some sglang VLM processors crash on JPEG); empty-content retry guard (empty/None content no longer crashes a trial); hotkey normalization (ctrl a→Control+a).Configs
config/agent/Qwen3.6-VL.yaml— the family (adapter +<tools>system prompt + minimalprompt_sections+ 5-action set).config/agent/Qwen3.6-27B.yaml,config/agent/Qwen3.6-35B-A3B.yaml— thin per-model configs inheriting the family (likeUI-TARS-1.5-7B.yaml).Tests
tests/test_adapters.py— registry, every Qwen action + robustness cases, UI-TARS regression.Extensibility
Adding a new model family = one adapter module + one
REGISTRYline + one config yaml. No changes to the agent/prompt/parse plumbing. If a family needs a new user-message section, add a_render_*method + a_SECTION_RENDERERSentry.Testing
tests/test_adapters.py: 22 passing; full suite green except one pre-existing browser e2e flake unrelated to this change.add_call_mom_to_my_todo: Qwen3.6-27B 4/4, Qwen3.6-35B-A3B 2/4 (the 2 misses are model grounding, not parsing), with 0 parse failures across 8 runs and correct 0-1000→pixel rescaling verified on real output.