fix(vision-sidecar): address #206 review findings - #213
Conversation
- Esc now cancels the Gemma sidecar call: it runs on a cancellable context wired into the turn's cancel hook, and a cancelled sidecar skips the CLI turn instead of starting it after the timeout. - Escape every '<' in the Gemma description so case/whitespace variants of </image-descriptions> in screenshot text can't close the block. - Build the sidecar header from the same usable-image filter as the Gemma request, so [n] numbering matches the named files. - /screenshot and /paste images fall back to the embedded multimodal backend when the sidecar fails (or fail with a clear error if none is configured) instead of being silently dropped. - Check Decode/Encode errors in the sidecar test server (errcheck). Adds regression tests for tag breakout, cancellation and the header mismatch.
QualityMax ReviewVerdict: COMMENT · Confidence: evidence-backed scan Re-review: Open the QualityMax check and select Re-review after it completes. Files eligible: 3 · Files reviewed: 3 · Files with findings: 0 · Findings: 0 · Inline cards: 0 Priority findings
Review gates
Important files
Change diagram — Flowflowchart TD
A[User Input] --> B{Use Vision Sidecar?}
B -- Yes --> C[Start Sidecar Context]
C --> D[Describe Images with Gemma]
D -- Success --> E[Build Augmented Prompt]
D -- Failure --> F{Embedded Backend Available?}
F -- Yes --> G[Fallback to Embedded Backend]
F -- No --> H[Report Error/Run Text-Only]
E --> I[Execute CLI Turn]
G --> I
H --> I
B -- No --> I
I --> J[Cleanup Sidecar Context]
Review lifecycleUse the inline cards to inspect evidence and suggested remediation. Re-run the QualityMax review after pushing a fix; unchanged cards are identified by their stable finding marker. Dismiss with a reason through the existing QualityMax/GitHub review feedback flow. 0 prior card(s) are stale/resolved on this head. Proof legend: VERIFIED independently judged patch · REPRODUCED verified finding · GROUNDED deterministic evidence · MODEL-ONLY model judgment. QualityMax project results are available in the configured project. Receipt · commit |
|
| Gate | Result |
|---|---|
| 🔍 AI diff review | ✅ Clean · gemini-3.1-flash-lite · completed · 3 eligible / 3 reviewed · gemini-3.1-flash-lite |
| 🔍 SAST | completed · 3 eligible / 3 reviewed · qwen3.7-plus |
| 🔍 Canonical PR review delivery | completed · 0 eligible / 0 reviewed · exact-head review #5329398201 and overview #5853950192 confirmed |
| 🧪 Repo Tests | ✅ 853/853 passed (go) |
Powered by QualityMax — AI-Powered Test Automation
Follow-up to #206. Merge this into
feat/vision-sidecar, and #206 picks up the fixes.Fixes
HIGH
internal/repl/repl.go).DescribeImagesWithGemmaran oncontext.Background(), so pressing Esc did nothing for up to 2 minutes, and then the CLI turn started anyway. It now runs on a context that Esc cancels, and cancelling skips the turn.internal/agent/cerebras_vision.go). The guard only matched the exact lowercase</image-descriptions>, so text like</IMAGE-DESCRIPTIONS>or</image-descriptions >copied from a screenshot could close the block and pass instructions to the CLI agent. Every<in the description is now escaped.MEDIUM
usableSidecarImages), so Gemma's[n]numbers match the file names./screenshotand/pasteimages were dropped when the image read failed. They now fall back to the built-in multimodal backend, as before the sidecar existed. If no such backend is set up, the turn fails with a clear error. Images dragged in as file paths behave as before: the turn runs without the image and a notice says so.CI
errchecklint errors incerebras_vision_test.go(the uncheckedDecodeandEncodecalls).Tests
go build ./...,go vet,gofmt,go test ./...andgolangci-lintv1.64.8 (the version CI uses) all pass locally. The sidecar tests also pass under-race.repl.Run, which the existing tests can't drive. To check it by hand, set an invalid Cerebras key and run/screenshotwith a text-only CLI backend.#206 still needs a rebase on
main.