Files
6krrt/routing.py
adlee-was-taken 6e6d02fac6 fix: resolve remaining capability-gate review findings
Implements the bugs_to_fix/capability-gate-followups.md plan (#1, #2, #3,
#4, #5, #6).

- #1: local vision fallback honors require_json_mode - an image + json_object
  request now falls through to the 422 naming the missing capability instead
  of returning prose that breaks the json contract
- #2: the pinned-model capability check now honors cfg.routing.require_vision /
  require_json_mode, so a pin and routed traffic face the same gate
- #3: drop 'image' modality from deepseek-v4-flash (supports_vision = 0)
- #4: README hard-filter count Four -> Six
- #5: extract routing.capability_gate_reason() shared by rejection_reason and
  the pinned check, so the flag rule cannot drift between the two
- #6: single iter_image_url_values() generator replaces four image-part
  traversals; _run_local_vision computes count/bytes once

Adds 9 tests (capability_gate_reason unit coverage, json-mode-gated local
fallback, vision gate off for pins). Full suite: 416 passing.
2026-08-23 13:03:39 -04:00

14 KiB