Skip to content

[Image] Stop suggesting image_id for engines that drop it - #20

Merged
ilyazub merged 1 commit into
mainfrom
ilyazub-cli-open-pr-reviews
Oct 14, 2026
Merged

ilyazub merged 1 commit into
mainfrom
ilyazub-cli-open-pr-reviews

Conversation

@ilyazub

@ilyazub ilyazub commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Max fix, tests and checks:

Fixes --image's advice before v0.4.0 ships. The error told agents to upload with serpapi image and pass image_id=<id> to another engine. SerpApi takes image_id only on google_lens, though: other engines drop it and run a normal, counted search without the image. Follow-up of #14.

This is the release PR for #16 (--debug) and #14 (image). Both merged with release:skip, and this one carries release:minor, so merging it releases v0.4.0 with all three.

On main 433aa35 → this PR:

search … --image photo.png main 433aa35 this PR
engine=google q=cat exit 2, "…for another engine, upload with 'serpapi image FILE' and pass image_id=" exit 2, "…other engines drop image_id and search without the image"
engine=Google_Lens (SerpApi lowercases it) exit 2, refused exit 0, upload, then search
engine=google_lens url=… (Lens refuses url next to image_id) exit 0 here; uploads, then searches exit 2 before the upload

The fake-API tests behind the table fail on 433aa35: 4 of the 5 refusal cases plus the Google_Lens test, all passing here.

Docs:

  • The image help, the Cost line and the README say an upload doesn't count against your searches, but it needs searches left this month and this hour, and has its own hourly limit (account_rate_limit_per_hour).
  • The README's Lens example used type=products, which SerpApi rejects as discontinued; it now uses type=exact_matches.

Checks on 5a768a1, no API key and a dead proxy, so nothing reached SerpApi:

gofmt, go vet, staticcheck (go1.25.13)                exit 0
go test -race ./... on go1.27.2 and go1.25.13          exit 0, 8/8 packages each
builds: linux, darwin (amd64, arm64), windows/amd64    exit 0

Not covered: the live e2e tests, which run in CI.

--image's error told agents to upload with `serpapi image` and pass
image_id=<id> to another engine, but SerpApi takes image_id only on
google_lens: other engines drop it and run a normal, counted search without
the image. --image now also takes engine=Google_Lens, which SerpApi
lowercases, and refuses url= before uploading, which Lens rejects next to
image_id. The help, Cost line and README say what an upload costs, and the
README's Lens example uses type=exact_matches instead of the discontinued
type=products.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@ilyazub ilyazub added the release:minor Merging releases the next minor version label Oct 14, 2026
@ilyazub
ilyazub merged commit e0e0c70 into main Oct 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:minor Merging releases the next minor version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant