Skip to content

Configure Gemini retrieval thinking and per-URL deadlines - #1216

Merged
ebhills merged 1 commit into
mainfrom
codex/gemini-retrieval-fix
Sep 30, 2026
Merged

ebhills merged 1 commit into
mainfrom
codex/gemini-retrieval-fix

Conversation

@ebhills

@ebhills ebhills commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Linked issue

Closes #1215. Follow-up to merged #1212. Related test-only fix: #1214.

What changes

URL retrieval defaults to gemini-3.5-flash with minimal thinking and a 10-second provider-request deadline per URL. A timeout returns a failed row while other rows complete in their original order. Default retries change from one to zero.

  • Expose thinking_level and request_timeout_seconds in Python and the recipe schema. Python callers can explicitly choose a larger window.
  • Accept additional Gemini GenerateContentConfig options through keyword arguments, including SDK aliases. URL tools, formatting, system instructions and HTTP settings remain managed by the wrapper; use the corresponding explicit parameters.
  • Apply the deadline to the async SDK request, including retry/backoff time, and close clients after completion or cancellation. Filter thought-summary parts from extracted content.
  • Raise the SDK minimum to google-genai>=1.64.0; document model-specific thinking defaults, overrides and deadline behavior.
  • Add the existing offline tests/test_lookup_variants.py to pytest-local.ini, correcting an omission on main that otherwise fails the local-suite inventory check. No lookup runtime behavior changes.

Flash-Lite is not the default: the live JSON checks did not pass. This PR does not change deployment configuration.

How it was verified

Offline validation

  • Credential-free local suite: 2,709 passed, 6 skipped, 139 deselected.
  • Existing lookup tests newly included in the local selection: 56 passed separately; the local-suite inventory check passed after the configuration correction.
  • Focused caller/configuration/template coverage on SDK 1.64.0: 218 passed.
  • Final caller/template coverage on the actual SDK 2.25.0: 148 passed. The installed version and import path were asserted before this run.
  • Coverage includes timeout isolation and ordering, retry deadlines, explicit overrides, schema options, keyword aliases, custom-client compatibility, client cleanup and SDK-parsed responses.
  • git diff --check passed. One commit, 11 files, zero commits behind main at publication.

Live Google checks, direct local Python with SDK 2.25.0

  • GPPro product-title retrieval on 3.5 Flash/minimal succeeded in 4.38 seconds with 3,708 tool-input tokens.
  • The same GPPro page on 3.6 Flash returned a per-row timeout at approximately 11 seconds with the 10-second request deadline.
  • Dodge title retrieval on 3.5 Flash/minimal succeeded in 7.91 seconds, but returned only the generic title “Dodge”.
  • A Dodge product-detail request completed in 9.00 seconds with 79,663 tool-input tokens and no product specifications. Minimal thinking therefore does not solve oversized or inaccessible page content.
  • Flash-Lite JSON retrieval returned a 400 for GPPro and timed out for Dodge; a separate GPPro Markdown request succeeded. These checks do not establish the cause of the JSON failure.

No WranglesXL/Lambda execution or deployment of this commit was performed. GitHub checks for this PR must complete before review.

Compatibility and risk

Existing arguments and result shapes are retained. Custom retrieval clients receive new controls only when explicitly supplied. The model, thinking, retry and timeout defaults change; slow pages can now fail sooner. minimal does not guarantee zero reasoning tokens.

Each URL's request deadline begins when its worker starts; queued batches can take longer, and client initialization/cancellation/cleanup add overhead. A larger Python timeout does not extend an external runner's limit; the verified development Lambda limit is 30 seconds.

The default remains configurable. Revert this commit and promote the corresponding package to roll back all behavior changes. After merge, the updated Python package must be promoted to the development Lambda before XL uses it.

#1214 is not a runtime or branch dependency. Merging that test-only fix first is recommended to remove the unrelated live-search exact-count failure risk before final CI validation.

Ready-for-review checklist

  • One human delivery owner is assigned (ebhills)
  • The linked issue and intended milestone are correct (no milestone assigned)
  • The branch is current with main and has no merge conflicts
  • Focused tests pass
  • New or changed behavior has direct test coverage
  • Documentation/schema/configuration is updated where applicable
  • The PR contains no unrelated changes
  • The PR description reflects the branch's current scope and latest validation
  • One primary reviewer is requested only when this PR is ready

See the pull request workflow.

@ebhills ebhills self-assigned this Sep 30, 2026
@ebhills
ebhills marked this pull request as ready for review September 30, 2026 19:53
@ebhills
ebhills merged commit 77b98b2 into main Sep 30, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Gemini URL retrieval thinking and per-URL deadlines configurable

1 participant