Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
feat(model-hub): Gemini API keys run proxied web searches with Google Search (#3066)
Call White74a5c8b37eea
diff --git a/core/handlers/model_hub/hosted_executor.py b/core/handlers/model_hub/hosted_executor.pyindex f182a31cf..df72baad9 100644--- a/core/handlers/model_hub/hosted_executor.py+++ b/core/handlers/model_hub/hosted_executor.py@@ -24,7 +24,7 @@ from core.agent_core.ai.sse import SSEParserfrom .events import bounded_diagnostic_detailfrom .hosted_items import responses_item_tool-from .request import ModelHubRequest+from .request import GOOGLE_NATIVE_TOOL_TYPES, ModelHubRequestEXECUTOR_TOOLS: Final = ("web_search", "x_search", "web_fetch")# One deadline for a search call's whole executor chain, not one per candidate.@@ -32,6 +32,10 @@ SEARCH_TIMEOUT_SECONDS: Final = 180.0# Responses counts reasoning against this cap, so it leaves room beyond the list itself._RESPONSES_OUTPUT_TOKENS: Final = 4096_ANTHROPIC_OUTPUT_TOKENS: Final = 2048+# Gemini counts its thoughts against this cap too.+_GOOGLE_OUTPUT_TOKENS: Final = 4096+# The generateContent tool object for each overlay declaration type (``{"type": "google_search"}`` → ``googleSearch``).+_GOOGLE_TOOL_KEYS: Final = {kind: key for key, kind in GOOGLE_NATIVE_TOOL_TYPES.items()}# A search answer is a short cited list; this bounds a misbehaving response.EXECUTOR_RESPONSE_MAX_BYTES: Final = 16 * 1024 * 1024_SNIPPET_CHARS: Final = 500@@ -110,7 +114,7 @@ def parse_call(tool: str, payload: object) -> ExecutorCall:def executor_streams(source: ModelHubSourceConfig) -> bool:- """A Responses executor streams, so the idle bound stays fed; Anthropic is buffered."""+ """A Responses executor streams, so the idle bound stays fed; Anthropic and Gemini are buffered."""return source.protocol == "openai_responses"@@ -139,6 +143,20 @@ def executor_request(if chosen:query = f"{query}\n\n(Search with {chosen}.)"instructions = _SEARCH_INSTRUCTIONS[call.tool]+ if source.protocol == "google":+ # Gemini runs Google Search for a built-in tool it is asked to use; nothing forces it, so the instruction+ # names it. The model is in the path (the engine client's), not the body.+ key = _GOOGLE_TOOL_KEYS.get(declaration.get("type"))+ if key is None:+ # The overlay declares only types generateContent knows (``test_provider_overlay``).+ raise ValueError(f"unsupported Gemini hosted declaration: {declaration.get('type')!r}")+ payload = {+ "systemInstruction": {"parts": [{"text": instructions.replace("the web_search tool", "Google Search")}]},+ "contents": [{"role": "user", "parts": [{"text": query}]}],+ "tools": [{key: {}}],+ "generationConfig": {"maxOutputTokens": _GOOGLE_OUTPUT_TOKENS},+ }+ return ModelHubRequest(payload, protocol=source.protocol)if source.protocol == "anthropic":payload = {"model": model_id,@@ -293,8 +311,9 @@ class ResponsesStreamReader:class ExecutorResult:"""The record for the call.- ``usage`` is the response's own ``usage`` section, as the provider sent it,- which the call's cost is read from.+ ``usage`` is what the provider reported charging for, as it sent it, which+ the call's cost is read from: the response's ``usage`` section, or on Gemini+ its ``groundingMetadata``, whose queries Google bills."""record: dict[str, Any]@@ -306,6 +325,13 @@ def provider_charges(protocol: str, usage: Mapping[str, Any] | None) -> tuple[diif usage is None:return {}, None+ if protocol == "google":+ # Google bills each distinct, non-empty query the model ran.+ queries = usage.get("webSearchQueries")+ distinct = {query.strip() for query in queries if isinstance(query, str) and query.strip()} if isinstance(+ queries, list+ ) else set()+ return reported_counts({"web_search_requests": len(distinct)}), Nonecounters = usage.get("server_tool_use") if protocol == "anthropic" else usage.get("server_side_tool_usage_details")cost = reported_cost(usage)return reported_counts(counters), cost.usd if cost is not None else None@@ -579,3 +605,80 @@ def _anthropic_record(message: Any, say: Say) -> ExecutorResult:return ExecutorResult({"status": "completed", "sources": sources})ended = failure(say, "modelHub.hostedTools.responseEnded", status=str(stop or "unknown"))return ExecutorResult(failed_record(ended, sources, status="incomplete" if stop in {"max_tokens", "pause_turn"} else "failed"))+++def google_result(body: bytes | bytearray, say: Say) -> ExecutorResult:+ """The canonical record of one buffered Gemini Google Search executor call; parse it off the loop."""++ try:+ response = json.loads(body)+ except (ValueError, RecursionError):+ return ExecutorResult(failed_record(failure(say, "modelHub.hostedTools.unreadable")))+ return _google_record(response if isinstance(response, dict) else {}, say)+++def _google_record(response: Mapping[str, Any], say: Say) -> ExecutorResult:+ """Gemini answers in one response: its text, and the search's queries, sources and supports in its+ ``groundingMetadata``. Sources keep Google's order, each once; a supported one gains its line of the answer."""++ candidates = response.get("candidates")+ candidate = candidates[0] if isinstance(candidates, list) and candidates and isinstance(candidates[0], dict) else {}+ grounding = candidate.get("groundingMetadata")+ grounding = grounding if isinstance(grounding, dict) else {}+ queries = grounding.get("webSearchQueries")+ if not any(isinstance(query, str) and query.strip() for query in (queries if isinstance(queries, list) else ())):+ feedback = response.get("promptFeedback")+ blocked = feedback.get("blockReason") if isinstance(feedback, dict) else None+ if isinstance(blocked, str) and blocked:+ return ExecutorResult(failed_record(failure(say, "modelHub.hostedTools.responseEnded", status=blocked)))+ return ExecutorResult(failed_record(failure(say, "modelHub.hostedTools.didNotRun", tool="web_search")))+ content = candidate.get("content")+ parts = content.get("parts") if isinstance(content, dict) else None+ text = "".join(+ part["text"] for part in (parts if isinstance(parts, list) else ())+ if isinstance(part, dict) and isinstance(part.get("text"), str) and part.get("thought") is not True+ )+ chunks = grounding.get("groundingChunks")+ chunks = chunks if isinstance(chunks, list) else []+ sources: list[dict[str, Any]] = []+ by_chunk: dict[int, dict[str, Any]] = {}+ for index, chunk in enumerate(chunks):+ web = chunk.get("web") if isinstance(chunk, dict) else None+ url = _text_field(web, "uri") if isinstance(web, dict) else None+ if not url:+ continue+ known = next((source for source in sources if source["url"] == url), None)+ if known is None:+ known = {"url": url}+ title = _text_field(web, "title")+ if title and title.strip():+ known["title"] = title.strip()+ sources.append(known)+ by_chunk[index] = known+ cursor = 0+ supports = grounding.get("groundingSupports")+ for support in (supports if isinstance(supports, list) else ())[:_MAX_CITATIONS]:+ segment = support.get("segment") if isinstance(support, dict) else None+ cited = _text_field(segment, "text") if isinstance(segment, dict) else None+ indices = support.get("groundingChunkIndices") if isinstance(support, dict) else None+ if not cited or not isinstance(indices, list):+ continue+ # Located in the text, in order: Google's offsets count bytes, and a sentence may recur.+ start = text.find(cited, cursor)+ start = text.find(cited) if start < 0 else start+ if start < 0:+ continue+ cursor = start + len(cited)+ for number in indices:+ source = by_chunk.get(number) if isinstance(number, int) and not isinstance(number, bool) else None+ if source is not None and "snippet" not in source:+ snippet = excerpt(text, start, start + len(cited), source["url"], [])+ if snippet:+ source["snippet"] = snippet+ # Success is an allow-list here too: an early stop is incomplete, anything else fails.+ finish = _text_field(candidate, "finishReason")+ if finish == "STOP":+ return ExecutorResult({"status": "completed", "sources": sources}, usage=grounding)+ ended = failure(say, "modelHub.hostedTools.responseEnded", status=str(finish or "unknown"))+ record = failed_record(ended, sources, status="incomplete" if finish == "MAX_TOKENS" else "failed")+ return ExecutorResult(record, usage=grounding)diff --git a/core/handlers/model_hub/hosted_tools.py b/core/handlers/model_hub/hosted_tools.pyindex ac93d2af8..a179ace9d 100644--- a/core/handlers/model_hub/hosted_tools.py+++ b/core/handlers/model_hub/hosted_tools.py@@ -331,10 +331,12 @@ def listed_executor_model(source: ModelHubSourceConfig, tool: str, *, spec_for:of them run a given tool, so one that does not is passed over."""- listed = {model.id for model in source.models if not model.retired}+ # Google names a model inside its ``models/`` collection, the name a Gemini Source keeps; an entry is its id.+ listed = {model.id.removeprefix("models/"): model.id for model in source.models if not model.retired}for entry in source_executor_models(source.vendor, source.protocol):snapshots = sorted(model for model in listed if _DATED_SNAPSHOT.fullmatch(model.removeprefix(entry)) and model != entry)- model_id = entry if entry in listed else snapshots[-1] if snapshots else None+ bare = entry if entry in listed else snapshots[-1] if snapshots else None+ model_id = listed[bare] if bare is not None else Noneif model_id is not None and runs_on(source, model_id, tool, spec_for=spec_for) is not None:return model_idreturn Nonediff --git a/core/handlers/model_hub/service.py b/core/handlers/model_hub/service.pyindex 253f60ea3..7c26a9492 100644--- a/core/handlers/model_hub/service.py+++ b/core/handlers/model_hub/service.py@@ -147,6 +147,7 @@ from .hosted_executor import (ExecutorResponseRefused,ResponsesStreamReader,anthropic_result,+ google_result,call_timeout,executor_request,executor_streams,@@ -7620,7 +7621,8 @@ class ModelHubService:result = Noneelse:# The bytearray itself goes to the worker: no copy of up to the response budget on the loop.- result = await asyncio.to_thread(anthropic_result, body, say)+ parse = google_result if source.protocol == "google" else anthropic_result+ result = await asyncio.to_thread(parse, body, say)# The call's cost is the pricing module's, from what the meter saw and what the provider reported.counts, reported_usd = provider_charges(source.protocol, result.usage if result is not None else None)cost = self.hosted_call_cost(diff --git a/docs/plans/vibey-gemini-native.md b/docs/plans/vibey-gemini-native.mdindex 8904059c0..faf64eb7a 100644--- a/docs/plans/vibey-gemini-native.md+++ b/docs/plans/vibey-gemini-native.md@@ -137,6 +137,25 @@ included (owner, 2026-10-27: "统一都走原生").- Not in this step: a positive evidence rule (the Tools tab shows no "最近一次 … 正常" for Google Search).- Public docs (`avibe-docs`, en and zh): Gemini searches with Google, queries go to Google, and the price.+## 4.1 Gemini as a search executor (follow-up, 2026-10-29)++A Gemini API key Source also runs proxied `web_search` calls for other hops (`vibey-hosted-tools.md` §6), so a+model without native search (Gemini 2.5, DeepSeek, a Chat relay) can search with Google.++- `executor_models`: `gemini-flash-lite-latest`, `gemini-3.5-flash-lite`, `gemini-3.1-flash-lite`, preferred+ first; each runs Google Search (measured 2026-10-29). A Source lists them in Google's `models/` collection, so+ `listed_executor_model` matches an entry by the id without that prefix and calls the listed name.+- The request is one buffered `generateContent`: the executor instruction (naming Google Search, since nothing+ forces a built-in tool) as `systemInstruction`, the query as the user content, `tools: [{"googleSearch": {}}]`,+ `maxOutputTokens: 4096`, no thinking config. No functions are declared, so no `toolConfig` is needed.+- The answer and its grounding come in that one response (measured). The record's sources are the `groundingChunks`+ in Google's order, each URL once, titled with the domain; a source a `groundingSupports` entry names gains the+ answer line its segment is found in as its snippet. The Search Suggestions are never read. `STOP` completes the+ call, `MAX_TOKENS` leaves it incomplete with its sources, any other finish or a blocked prompt fails it, and an+ answer with no `webSearchQueries` did not run the tool.+- Cost: the distinct non-empty `webSearchQueries` × the overlay price, plus the executor model's tokens.+- No positive evidence yet, as for native Google Search (§6).+## 5. Delivery| PR | Scope | Visible result |@@ -154,8 +173,5 @@ of each other once PR 1 is merged.- Source links in Google's grounding are redirect URLs; the card shows the domain as title.- Google Search has no positive evidence yet (§4).- A search whose answer comes in a later response lists no sources on its own card; the answer cites them (§4).-- Gemini is not a search executor for other hops: the executor speaks Anthropic and Responses only, so Gemini runs- Google Search on its own hop and names no `executor_models` (a follow-up would add a `google` executor request- and result).- The OpenAI-compatible Chat path keeps no dummy for another origin's current-turn call: after PR 2 no officialGemini Source uses it, and a Chat relay that serves Gemini is the relay's to translate.diff --git a/docs/plans/vibey-hosted-tools.md b/docs/plans/vibey-hosted-tools.mdindex fc843f342..95d46b191 100644--- a/docs/plans/vibey-hosted-tools.md+++ b/docs/plans/vibey-hosted-tools.md@@ -94,7 +94,8 @@ The user has an Anthropic API key, an xAI API key and an OpenAI API key, and hasdeclarations. For each vendor and model family, per protocol, it holds:- the native declaration of each search tool the vendor offers, with its `include` values and list price;- new, at vendor scope: `executor_models`, the vendor's lightweight models that run proxied search calls, preferred first (§6), e.g.- Anthropic's Haiku tier, OpenAI's mini tier, xAI's fast tier; the executor call uses the declaration of the family+ Anthropic's Haiku tier, OpenAI's mini tier, xAI's fast tier, Gemini's Flash-Lite tier (amended 2026-10-29,+ `vibey-gemini-native.md` §4.1); the executor call uses the declaration of the familyrow that model matches. The implementation PR picks the shipped ids;- new: `image_models`, the vendor's image models with a one-line description, the endpoint kind (§7.4), theparameters each supports, and a list price where one exists.@@ -581,7 +582,7 @@ These rules are C-1 rows in `cross-provider.md` and per-protocol rows in `converremoved Source cannot be served at all. It calls the first admitted candidate: one short native request onthat Source's executor model, with theoverlay's declaration, the tool forced where the protocol allows it (`tool_choice: "required"` on Responses;- Anthropic is asked in the message alone), a fixed instruction to search and list numbered results with one or+ Anthropic and Gemini are asked in the message alone), a fixed instruction to search and list numbered results with one ortwo cited sentences each, a small output cap, and no reasoning effort.4. On a failure that normal routing fails over from (a transient one such as an overload or a server errorincluded), or a narrow-rule refusal (which also writes negative evidence), it tries the next candidate. A model@@ -596,7 +597,7 @@ These rules are C-1 rows in `cross-provider.md` and per-protocol rows in `converdoes. A manual row is the user's, and stays. A failure mid-stream moves on too: nothingreaches Vibey until the gateway returns the record, so "before output" here means before the result isreturned, and the partial call is still metered on its Source. A completed response that never ran the tool- (the model chose not to; Anthropic is asked in the message alone) ends the chain with a `failed` record: it is+ (the model chose not to; Anthropic and Gemini are asked in the message alone) ends the chain with a `failed` record: it isa model choice, not a Source failure, and moving on would double the cost. Any other outcome ends the chain.5. With no admitted candidate, the call returns a `failed` record naming the providers whose Sources can run thetool ("add a Source from one of these providers: xAI"). When Sources that would run it exist but each has adiff --git a/tests/test_model_hub_hosted_executor.py b/tests/test_model_hub_hosted_executor.pyindex 4dea02b7c..42613dcd9 100644--- a/tests/test_model_hub_hosted_executor.py+++ b/tests/test_model_hub_hosted_executor.py@@ -30,7 +30,13 @@ from core.handlers.model_hub import search_chain as search_chain_modulefrom core.handlers.model_hub import service as service_modulefrom core.handlers.model_hub.adapter import DiscoveredModel, InvokeCancelledError, RawOutcomeKind, UpstreamRejectionfrom core.handlers.model_hub.capability_evidence import EvidenceFeature-from core.handlers.model_hub.hosted_executor import ResponsesReadout, anthropic_result, excerpt, responses_result+from core.handlers.model_hub.hosted_executor import (+ ResponsesReadout,+ anthropic_result,+ excerpt,+ google_result,+ responses_result,+)from core.handlers.model_hub import hosted_tools as hosted_tools_modulefrom core.handlers.model_hub.pricing import PriceTablefrom core.handlers.model_hub.stream_wire import ProtocolSSEState, ProtocolUsageReport@@ -53,6 +59,8 @@ from tests.test_model_hub_vibey_consumer import _vibey_serviceXAI = "src_xaikey0001"OPENAI = "src_openai0001"ANTHROPIC = "src_anthkey0001"+GEMINI = "src_gemkey0001"+GEMINI_LITE = "models/gemini-flash-lite-latest"POST_1 = "https://x.com/OpenAI/status/2107909792945832070"POST_2 = "https://x.com/OpenAI/status/2107895006350791071"PAGE_A = "https://github.com/router-for-me/CLIProxyAPI/releases"@@ -320,6 +328,98 @@ async def test_an_anthropic_executor_is_buffered_and_keeps_the_providers_results}+# A Gemini generateContent answer with Google Search, as gemini-flash-lite-latest gave it on 2026-10-29: the answer and+# the search's grounding in one response. Grounding links are Google redirects titled with the domain.+REDIRECT_A = "https://vertexaisearch.cloud.google.com/grounding-api-redirect/AAA"+REDIRECT_B = "https://vertexaisearch.cloud.google.com/grounding-api-redirect/BBB"+GEMINI_ANSWER = "1. The latest release of **CLIProxyAPI** is **v8.0.47**.\n2. It adds raw request body byte-range patching."+GEMINI_SEARCH = {+ "candidates": [{+ "content": {"role": "model", "parts": [+ {"text": "planning the search", "thought": True},+ {"text": GEMINI_ANSWER, "thoughtSignature": "c2ln"},+ ]},+ "finishReason": "STOP",+ "groundingMetadata": {+ "webSearchQueries": ["CLIProxyAPI latest release", "CLIProxyAPI v8.0.47", " "],+ "groundingChunks": [+ {"web": {"uri": REDIRECT_A, "title": "github.com"}},+ {"web": {"uri": REDIRECT_B, "title": "newreleases.io"}},+ {"web": {"uri": REDIRECT_A, "title": "github.com"}},+ ],+ "groundingSupports": [+ {"segment": {"startIndex": 52, "endIndex": 58, "text": "0.47**"}, "groundingChunkIndices": [0, 2]},+ {"segment": {"text": "It adds raw request body byte-range patching"}, "groundingChunkIndices": [1, 9]},+ ],+ "searchEntryPoint": {"renderedContent": "<div>chips</div>"},+ },+ }],+ "usageMetadata": {"promptTokenCount": 2000, "candidatesTokenCount": 100, "totalTokenCount": 2100},+ "modelVersion": "gemini-3.5-flash-lite",+}+++def _with_gemini(*sources):+ gemini = replace(+ _source(GEMINI, "Gemini key", vendor="gemini", protocol="google", model_id=GEMINI_LITE),+ base_url="https://generativelanguage.googleapis.com",+ )+ return [*sources, gemini]+++async def test_a_gemini_executor_is_buffered_and_reads_googles_grounding(tmp_path):+ """MH-HOSTED-GATEWAY-004: Gemini searches with Google Search, asked in the instruction (nothing forces a built-in+ tool), and answers in one response; the record keeps Google's sources in order, each once, a supported one with+ its line of the answer, and never the Search Suggestions."""++ service = _vibey_service(tmp_path, _with_gemini(*_sources()), handles=[+ LiveInvokeHandle(_outcome(RawOutcomeKind.SUCCESS, source_id=GEMINI), (json.dumps(GEMINI_SEARCH).encode(),)),+ ])+ # The vendor names the model by its id; the Source lists it in Google's models/ collection.+ _bind(service, "web_search", (GEMINI, "gemini-flash-lite-latest"))+ status, answer = await _call(service, "web_search", {"arguments": {"query": "CLIProxyAPI latest release"}})++ assert status == 200, answer+ assert service.adapter.invocations == [(GEMINI, GEMINI_LITE, "vibey")]+ sent = service.adapter.requests[0]+ assert sent.protocol == "google"+ assert set(sent) == {"systemInstruction", "contents", "tools", "generationConfig"}+ assert sent["tools"] == [{"googleSearch": {}}]+ assert "with Google Search" in sent["systemInstruction"]["parts"][0]["text"]+ assert sent["contents"] == [{"role": "user", "parts": [{"text": "CLIProxyAPI latest release"}]}]+ assert sent["generationConfig"] == {"maxOutputTokens": 4096}+ assert answer["record"] == {"status": "completed", "sources": [+ {"url": REDIRECT_A, "title": "github.com", "snippet": "The latest release of CLIProxyAPI is v8.0.47."},+ {"url": REDIRECT_B, "title": "newreleases.io", "snippet": "It adds raw request body byte-range patching."},+ ]}+ assert "chips" not in json.dumps(answer)+ assert answer["execution"]["executor_origin"] == {"provider": "gemini", "api": "google", "model": GEMINI_LITE}++[email protected](("response", "status", "error"), [+ # The model answered without searching: a model choice, not a Source failure.+ ({"candidates": [{"content": {"parts": [{"text": "From memory."}]}, "finishReason": "STOP"}]},+ "failed", "didNotRun web_search"),+ ({"promptFeedback": {"blockReason": "SAFETY"}}, "failed", "SAFETY"),+ ({**GEMINI_SEARCH, "candidates": [{**GEMINI_SEARCH["candidates"][0], "finishReason": "MAX_TOKENS"}]},+ "incomplete", "MAX_TOKENS"),+ ({**GEMINI_SEARCH, "candidates": [{**GEMINI_SEARCH["candidates"][0], "finishReason": "SAFETY"}]},+ "failed", "SAFETY"),+ (b"not json", "failed", None),+])+def test_a_gemini_executor_completes_only_a_search_that_finished(response, status, error):+ body = response if isinstance(response, bytes) else json.dumps(response).encode()+ result = google_result(body, lambda key, **params: f"{key} {' '.join(params.values())}")++ assert result.record["status"] == status+ if error is not None:+ assert error in result.record["error"]+ # A search that ran keeps what it found, even when its answer stopped early.+ if status == "incomplete":+ assert [source["url"] for source in result.record["sources"]] == [REDIRECT_A, REDIRECT_B]++ANTHROPIC_SEARCH = {"type": "message", "role": "assistant", "stop_reason": "end_turn","content": [@@ -345,6 +445,9 @@ ANTHROPIC_SEARCH = {# plus the two searches Anthropic counted at $10 per thousand.("web_search", (ANTHROPIC, "claude-haiku-4-5"), "metered", ANTHROPIC_SEARCH, {"basis": "list", "usd": 0.0225}),("web_search", (ANTHROPIC, "claude-haiku-4-5"), "monthly", ANTHROPIC_SEARCH, {"basis": "included"}),+ # The list price: 2,000 input and 100 output tokens at $0.1 and $0.4 per million, plus the two distinct non-empty+ # queries Google ran at $14 per thousand.+ ("web_search", (GEMINI, "gemini-flash-lite-latest"), "metered", GEMINI_SEARCH, {"basis": "list", "usd": 0.02824}),# OpenAI reports no search counter, so its per-call fee, and so the call, cannot be valued.("web_search", (OPENAI, "gpt-6-astra"), "metered",@@ -369,7 +472,7 @@ ANTHROPIC_SEARCH = {async def test_a_proxied_call_carries_the_pricing_modules_cost(tmp_path, tool, executor, billing, response, cost):"""MH-HOSTED-GATEWAY-004: the cost is included, the provider's own figure, or the list price; absent when unknown."""- sources = [replace(source, billing=billing) if source.id == executor[0] else source for source in _sources()]+ sources = [replace(source, billing=billing) if source.id == executor[0] else source for source in _with_gemini(*_sources())]frames = response if isinstance(response, tuple) else (json.dumps(response).encode(),)tokens = ProtocolUsageReport.of(input_tokens=2000, cached_input_tokens=0, output_tokens=100)service = _vibey_service(tmp_path, sources, handles=[@@ -377,8 +480,10 @@ async def test_a_proxied_call_carries_the_pricing_modules_cost(tmp_path, tool, e])prices = PriceTable(catalog={"anthropic": {"models": {"claude-haiku-4-5": {"cost": {"input": 1, "output": 5}}}},- "openai": {"models": {"gpt-6-astra": {"cost": {"input": 1, "output": 5}}}}},- vendor_map={"families": [{"prefix": "claude-", "vendor_id": "anthropic"}, {"prefix": "gpt-", "vendor_id": "openai"}]},+ "openai": {"models": {"gpt-6-astra": {"cost": {"input": 1, "output": 5}}}},+ "google": {"models": {"gemini-flash-lite-latest": {"cost": {"input": 0.1, "output": 0.4}}}}},+ vendor_map={"families": [{"prefix": "claude-", "vendor_id": "anthropic"}, {"prefix": "gpt-", "vendor_id": "openai"},+ {"prefix": "gemini-", "vendor_id": "google"}]},overrides={}, price_table_date="2026-10-13",)service.usage_writer = UsageWriter(service.usage, price_table=lambda: prices)diff --git a/tests/test_provider_overlay.py b/tests/test_provider_overlay.pyindex 9b15dfd4f..2b0f6d21e 100644--- a/tests/test_provider_overlay.py+++ b/tests/test_provider_overlay.py@@ -301,22 +301,14 @@ def test_an_image_model_entry_is_read_in_a_stable_form(monkeypatch, tmp_path):assert catalog.provider_image_models("anthropic") == ()-EXECUTOR_PROTOCOLS = {"anthropic", "openai_responses"}--@pytest.mark.parametrize("vendor", sorted(BUNDLED["providers"]))def test_each_vendors_executor_models_run_every_search_tool_the_vendor_offers(vendor):"""MH-HOSTED-005: an executor model the overlay does not declare a tool on would silently drop the vendor from- that tool's executor chain on every Source that lists it first.-- The executor speaks Anthropic and Responses (``hosted_executor.executor_request``); Gemini runs Google Search- natively on its own hop only (``vibey-gemini-native.md`` §6), so a tool offered on another protocol needs none.- """+ that tool's executor chain on every Source that lists it first."""offered = {(protocol, tool)for family in catalog.bundled_provider_overlay()[vendor]for protocol, tools in family.hosted_tools.items()- if protocol in EXECUTOR_PROTOCOLSfor tool in tools}executors = catalog.provider_executor_models(vendor)@@ -338,3 +330,18 @@ def test_a_providers_value_that_is_not_an_object_disables_only_the_overlay(assert dict(overlay) == {}assert len(_overlay_warnings(caplog)) == 1assert catalog.load_bundled_catalog()["backends"] == BUNDLED_ROWS+++def test_every_gemini_declaration_is_a_tool_generate_content_knows():+ """A ``google`` hop and the Gemini executor send each declaration as its generateContent tool object; an unknown+ type would have none to send."""++ from core.handlers.model_hub.request import GOOGLE_NATIVE_TOOL_TYPES++ declared = {+ json.loads(spec.declaration_json)["type"]+ for families in catalog.bundled_provider_overlay().values()+ for family in families+ for spec in family.hosted_tools.get("google", {}).values()+ }+ assert declared and declared <= set(GOOGLE_NATIVE_TOOL_TYPES.values())diff --git a/vibe/data/backend_models.json b/vibe/data/backend_models.jsonindex f2a3f6241..952ea6a05 100644--- a/vibe/data/backend_models.json+++ b/vibe/data/backend_models.json@@ -94,6 +94,7 @@]},"gemini": {+ "executor_models": ["gemini-flash-lite-latest", "gemini-3.5-flash-lite", "gemini-3.1-flash-lite"],"models": [{"match": { "prefix": "gemini-3" },