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
docs(model-hub): drop page content from web search services (#2888)
Call Whiteb5b81adeeac3
diff --git a/docs/plans/web-search-services.md b/docs/plans/web-search-services.mdindex e689d3937..38806ad1d 100644--- a/docs/plans/web-search-services.md+++ b/docs/plans/web-search-services.md@@ -55,9 +55,10 @@ The user has an Anthropic API key and a DeepSeek API key, adds Tavily, and chang- **tool-only** (Tavily, Exa): its Source has `protocol: "search"` and no models;- **model vendor with a search API** (DeepSeek): an ordinary model Source whose catalog row also lists a searchAPI. The Source qualifies only on the vendor's official endpoint; a relay base URL does not serve the search API.-- **Page content is a vendor capability.** A row says whether the vendor can return page text. A summary or extra- snippets are not page text, so a vendor without page text has no content setting.-- **The canonical schema stays `{query}`** (hosted tools §2). Result count and page content are service settings,+- **Search returns snippets, not pages.** Each result carries the vendor's query-relevant excerpt (Tavily's+ `content`, Exa's highlights, DeepSeek's `summary`), never the page's full text. Reading a page is `web_fetch`'s+ job in phase 2, where the model chooses which page to read (owner decision, 2026-10-20).+- **The canonical schema stays `{query}`** (hosted tools §2). Result count is a service setting,never model arguments, as Anthropic's `max_uses` and OpenAI's actions are declaration settings today.## 3. Model Hub@@ -118,7 +119,7 @@ The user has an Anthropic API key and a DeepSeek API key, adds Tavily, and chang"prefer_native": true,"executor_order": ["src_…", "src_…"],"executor_order_kinds": {"src_…": "service", "src_…": "model"},- "services": {"src_…": {"results": 5, "content": false, "enabled": true}},+ "services": {"src_…": {"results": 5, "enabled": true}},"service_order": ["src_…", "src_…"]}```@@ -128,7 +129,7 @@ The user has an Anthropic API key and a DeepSeek API key, adds Tavily, and chang| `prefer_native` | boolean; absent means `true` (decision 3) || `service_order` | the automatic order of tool-only `search` Sources: the server appends a Source's id when it is created and drops it when the Source is removed; the user never edits it directly (a reorder saves `executor_order`). Ids that no longer name a Source are skipped. || `executor_order_kinds` | written by the server with every `executor_order` save: each named Source id mapped to `service` or `model`, its role at that save. Absent (a released order) means every entry was saved as `model`; an id the order does not name is ignored. An id the order names but that names no Source at the save (a stale client's removed Source) gets no entry and is skipped at read, as `executor_order` already skips it; an entry with no kind is read as `model`. The client never writes it. |-| `services` | per search-capable Source: `results` (1 to the vendor's maximum, default `min(5, the vendor's maximum)`), `content` (page text, default `false`, only where the vendor returns page text) and `enabled` (default `true`, except `false` for a model Source whose catalog row is not `auto_enroll` (§4.1); `false` takes the Source out of the search order without removing it, which is how a DeepSeek Source keeps its models but stops searching). Absent means defaults. An entry for a Source that no longer exists is ignored. The catalog limits are enforced on write; on load a saved value the current catalog no longer allows is read as the nearest allowed one (`results` clamped to the maximum, `content: true` read as `false` where the vendor no longer returns page text) and kept as saved until the next write, so a catalog change never fails loading. |+| `services` | per search-capable Source: `results` (1 to the vendor's maximum, default `min(5, the vendor's maximum)`) and `enabled` (default `true`, except `false` for a model Source whose catalog row is not `auto_enroll` (§4.1); `false` takes the Source out of the search order without removing it, which is how a DeepSeek Source keeps its models but stops searching). Absent means defaults. An entry for a Source that no longer exists is ignored. The catalog limits are enforced on write; on load a saved value the current catalog no longer allows is read as the nearest allowed one (`results` clamped to the maximum) and kept as saved until the next write, so a catalog change never fails loading. |- `executor_order` keeps its rule (hosted tools §3.3) and now lists search-capable Sources beside model executors.Each save also writes `executor_order_kinds`, a map from each named Source id to the role it had when the order@@ -139,7 +140,7 @@ The user has an Anthropic API key and a DeepSeek API key, adds Tavily, and chang- Releases before these settings ignore unknown fields with a warning. An older release's config write dropsthose fields, including per-Source opt-outs; see §12. rc12 retains `service_order` but not the three S1b fields.- A settings change applies from the next turn. The turn's first resolution freezes `prefer_native`, the effective- candidate list (Sources with `services.<id>.enabled: false` kept, last, as `disabled` entries) and each candidate's `results` and `content` in the turn+ candidate list (Sources with `services.<id>.enabled: false` kept, last, as `disabled` entries) and each candidate's `results` in the turntrace's `hosted_tools`, beside the tool set and the executor order (hosted tools §6). Later hop resolutions and every call of the turn read the frozen values.### 3.3 Credential custody@@ -159,10 +160,7 @@ The user has an Anthropic API key and a DeepSeek API key, adds Tavily, and changafter a status arrived is settled by that status (§4.3). It reads the key from the state store (`read_api_key`, as credentialretargeting does today) only for the duration of the request.- Transport rules: HTTPS only, host pinned to the catalog endpoint, redirects refused, environment proxies ignored- as the engine's own upstream requests ignore them, response body capped at 8 MiB. With `content` on, the request asks the vendor for bounded text where- the vendor offers it (Exa `contents.text.maxCharacters` at the 4,000-character source bound, the catalog's- `content_max_chars`). Tavily and DeepSeek document no page-text size bound (checked 2026-10-20), so no result- count can guarantee their body fits; a body over the cap is `service_unreadable` under the existing rules (§12, item 5). The credential file read, and the buffered body's JSON decoding, result+ as the engine's own upstream requests ignore them, response body capped at 8 MiB. The credential file read, and the buffered body's JSON decoding, resultmapping and bounds, run off the controller loop (`asyncio.to_thread`, as the hosted-response parsers already do).- The engine is not involved: it only forwards model requests, and rendering a tool-only key into engine configwould advertise a model provider that does not exist.@@ -184,19 +182,17 @@ The user has an Anthropic API key and a DeepSeek API key, adds Tavily, and changretargeted or retired Sources are omitted while incapable, but retain their overrides in config for whencapability returns; removed Sources' overrides are ignored;- `executor_candidates[]` entries gain `kind: "service" | "model"`. A service entry carries `model_id` = the- catalog's service id (for example `tavily/search`), `price` in the existing unit form with unit `search` (its- `extra[]` gains the unit `page` and an optional `when: "content"`, so Exa shows "$7 / 千次,正文另加 $1 / 千页": one- `when: "content"` extra for text; its highlights are included in the search price), its- `settings {results, content, enabled}`, and the Source's health so the row can say "密钥无效 · 已跳过". A+ catalog's service id (for example `tavily/search`), `price` in the existing unit form with unit `search` (Exa+ shows "$7 / 千次"; its highlights are included in the search price), its `settings {results, enabled}`, and the Source's health so the row can say "密钥无效 · 已跳过". Asearch-capable Source with `enabled: false` is listed last, reads "未用于搜索" and opens its detail, where theswitch turns it back on;- `service_vendors[]`: the catalog's search vendors, for the add dialog: id, name, list price, free tier, facts,- the maximum `results`, whether the vendor returns page text and whether that changes the price, and whether a+ the maximum `results`, and whether aSource of the user already provides it.The PUT body gains `prefer_native` and `services` as per-field writes, the existing pattern. `services` is apatch keyed by Source id: a Source absent from it is untouched; a present Source's object merges by field, so-`{results}` alone leaves `content` and `enabled` as saved; `null` for a Source, or for one of its fields, removes+`{results}` alone leaves `enabled` as saved; `null` for a Source, or for one of its fields, removesthe saved value so the default applies again. Two clients editing different Sources, or different fields, do notoverwrite each other.@@ -241,7 +237,7 @@ Hosted tools §6 holds, with these changes:admission after the turn froze its candidates, hosted tools §6) or `disabled` (a search-capable Source with`services.<id>.enabled: false`; the frozen list carries such Sources last, so they are reached only after everyother candidate, and never sent a request). A skip costs nothing, writes no state, and is recorded in `attempts[]` (§4.3).-- **One attempt** sends the catalog's request for the canonical query, the turn's frozen `results` and `content`, and+- **One attempt** sends the catalog's request for the canonical query, the turn's frozen `results`, andwaits at most 30 s, inside the chain's single 180 s deadline.### 4.2 Outcomes@@ -337,14 +333,11 @@ Hosted tools §6 holds, with these changes:field (DeepSeek `summary`).- **Every field a service mapping writes is bounded before the record is written.** The bounds on the releasedfields (`url`, `title`, `snippet`, `page_age`) belong to the mapping, not to the C-1 read shape, so released- `HostedSource` rows from native and model-executor calls still load unchanged. The new `content` is the- exception: its bound is also in C-1's schema and reader (§8), which clips it on every load. `url` is at most 2,048 characters, and a result+ `HostedSource` rows from native and model-executor calls still load unchanged. `url` is at most 2,048 characters, and a resultwith a longer or non-HTTP(S) URL is dropped. `title` is cut to 300, `snippet` to 1,000 and `page_age` to 64. Arecord keeps at most the configured number of results. An empty results array is a valid answer: a `completed`record with no sources (§4.2). `service_unreadable` is a body without a results array, or a non-empty array inwhich no result survives the bounds.-- With `content` on, each source gains `content`, bounded to 4,000 characters per source and 20,000 per record.- Vibey renders it in the model-facing text with the same renderer as today.- `execution` is a `ProxyExecution` naming the Source, `executor_billing: "metered"` and the attempt's `cost`. Whenthe response reports its own cost as a finite non-negative number at the catalog's cost path (Exa:`costDollars.total`), no larger than the catalog's per-request ceiling (100 times the row's list price for the@@ -352,14 +345,8 @@ Hosted tools §6 holds, with these changes:`basis: "reported"`, plus `estimate: true` when the catalog row says the vendor's figure is an estimate (Exadocuments `costDollars` as an estimated cost), which renders with "≈" like a list price while still countingas a reported cost in Usage. Any other value is ignored and the list price applies.- Otherwise it is the catalog's list price for the request plus its per-returned-page parts (Exa: $1 / 1k pages of- `contents.text` when content is on; the always-requested highlights are included in the search price), with- `basis: "list"`. The page count is the number of rows, among the first `results` rows of a readable array, that carry- the charged content field (Exa: a `text` value), counted before the local URL bounds drop entries, since the- vendor billed those pages either way; rows beyond the requested count or without the field are not counted. When a per-page part applies but- the array is missing or unreadable, the ledger row always carries `lower_bound: true` into the Usage aggregate,- since its list valuation lacks the pages even when a reported cost exists; and with no valid reported cost, the- call's cost is the search part marked as a lower bound ("至少 $0.007") through the new `HostedCost.lower_bound`. When the vendor bills only+ Otherwise it is the catalog's list price for the request (Exa's always-requested highlights are included in the+ search price), with `basis: "list"`. When the vendor bills onlynon-empty results (DeepSeek), a 200 whose `results` array is non-empty is billed even if every item fails thebounds, so it is recorded at the list price. Only a 200 whose `results` array is missing or unreadable leaves thecharge unknown: the attempt records no cost (unpriced), and the ledger row adds no list-priced quantity but sets@@ -374,8 +361,7 @@ Hosted tools §6 holds, with these changes:rule declares unbilled (DeepSeek: timeouts, per its Search & Fetch billing rule, 2026-10-20). The adapter'sstructured outcome carries the HTTP status once one arrived, so a body-read failure, timeout or stop after thestatus keeps it: a received non-200 follows its outcome row (health, cooldown, $0), and a received 200 is billed- by its vendor's rule (Tavily and Exa: the request at list price, with the page part a lower bound when it- applies; DeepSeek: billing unknown, since it depends on a non-empty `results` array). The catalog row's declared unbilled+ by its vendor's rule (Tavily and Exa: the request at list price; DeepSeek: billing unknown, since it depends on a non-empty `results` array). The catalog row's declared unbilledoutcomes apply before the fallback below (a DeepSeek timeout before any status arrives is $0; once a 200 status arrived, the received-200 rule aboveapplies instead). Only another failureafter sending and before any status (a read timeout, a lost connection, or a stop, which writes no record and@@ -436,7 +422,7 @@ Hosted tools §6 holds, with these changes:the per-Source list, as the released no-candidate failure shows no executor), and the chain total as the sum of the triedentries' `cost`. With no known figure at all (every tried entry unpriced, such as a lone DeepSeek unreadable200), the total is absent, as an unpriced chain is today; otherwise it is a lower bound when any tried entry has- no cost or a cost with `lower_bound: true`+ no cost(a skipped entry sent nothing and has no cost by design, so it never makes the total incomplete). So a chain whose billable modelattempt was followed by a service that failed before sending keeps both facts, whether or not `execution` ispresent; `execution` and `failed_attempts[]` keep their released meaning for older readers. Without@@ -448,24 +434,19 @@ Hosted tools §6 holds, with these changes:row: the Source, the catalog's `service_id` in place of a model, `requests` (sent), `billable_requests` (thosethe catalog's billing rule charges: DeepSeek only a 200 with results, the others any 200), and the list-pricedquantities: every billable request is valued at the request price (its count is `billable_requests`, so no- separate request counter exists), plus `list_pages` per content type (Exa: `text`) for the pages that were read,- and,- in parallel, `reported_usd` and `reported_requests` for the requests the vendor priced itself. Usage values the+ separate request counter exists), and, in parallel, `reported_usd` and `reported_requests` for the requests the vendor priced itself. Usage values thequantities at the current price table, as it values model tokens, so `api_cost_usd` is one list valuation withone `price_table_date`. Reported costs are the vendor's own figures, exposed beside it as `service_reported_usd`and never added to it. A request whose billing is unknown (DeepSeek's unreadable 200) adds to`requests` and to a separate `uncertain_requests`, never to `billable_requests`, so the counts stay exact andthe uncertainty is visible. Released ledger rows without these fields load as zero. The counters keep theirrelations on write and on read, as the model counters do (a corrupt or hand-edited row is repaired, not- published): `billable_requests + uncertain_requests ≤ requests`, `reported_requests ≤ billable_requests`, `list_pages` per- content type at most `billable_requests` times 100, a fixed ceiling every catalog version honors (the catalog- schema caps a row's maximum `results` at 100, and a page is a returned result), so a row written under an older- catalog is never judged by a newer, lower maximum,+ published): `billable_requests + uncertain_requests ≤ requests`, `reported_requests ≤ billable_requests`,and `reported_usd` a finite, non-negative amount no larger than `reported_requests` times $1 (a fixed ceiling,above every catalog version's per-request ceiling) and zero without a reported request. A row that breaks anyrelation keeps`requests`, has its counts reduced to the bounds, drops the quantities that depended on a reduced count- (`list_pages`, `reported_usd`, `reported_requests`), and is marked `lower_bound`; `lower_bound` is also forced+ (`reported_usd`, `reported_requests`), and is marked `lower_bound`; `lower_bound` is also forcedtrue whenever `uncertain_requests` is non-zero.- Pricing presence is unchanged: `pricing` and every cost field appear exactly when the model price table can beread. Service quantities are then valued at the catalog prices shipped with the release, whose verification date@@ -475,23 +456,21 @@ Hosted tools §6 holds, with these changes:never dressed as a model and model `requests` never count service requests:- `UsageBucketRow` becomes `oneOf`: the released model row (no `kind`), or a service row with `kind: "service"`,`source_id`, `service_id`, `requests`, `billable_requests`, `uncertain_requests`,- `list_pages` (per content type, Exa: `text`), `reported_requests`, and the cost fields `reported_usd`, `api_cost_usd` and+ `reported_requests`, and the cost fields `reported_usd`, `api_cost_usd` and`api_cost_lower_bound`, which, like `service_reported_usd`, are present exactly when `pricing` is (the ledgerkeeps them regardless; only the summary follows the presence rule).- A new top-level `services[]` (`ServiceUsage`) has one entry per (Source, `service_id`) with those counters,`label` (the Source's; null once the Source is removed, folded into the same "Removed providers" identity asmodel usage), `service_label` (the catalog's; null when a later release no longer has that catalog row, and the UI then- shows the stored `service_id`) and `last_metered_at`, busiest first. A stored quantity whose price component- the current catalog no longer has (the whole service row, or one part such as the page-text price) is left out- of `api_cost_usd`, like an unpriced model's tokens: the row is `priced: false` when any non-zero quantity is- unpriced, `api_cost_lower_bound` is set, requests whose request price is gone are counted in the new+ shows the stored `service_id`) and `last_metered_at`, busiest first. A row whose service the current catalog no+ longer prices is left out of `api_cost_usd`, like an unpriced model's tokens: the row is `priced: false`, `api_cost_lower_bound` is set, requests whose request price is gone are counted in the new`excluded_service_requests`, and the reported cost still counts. A tool-only Sourceappears only there, never in `sources[]`, whose `models` stay non-empty; a DeepSeek Source keeps its model usagein `sources[]` and its search usage in `services[]`.- `totals` and each `days[]` entry keep counting model calls. Their `api_cost_usd` adds the services' listvaluation, the new `service_reported_usd` holds the reported costs, and `api_cost_lower_bound` is set when any- service row it includes is a lower bound for either reason: its stored `lower_bound: true` (an unreadable- content call, above) or a quantity the current catalog cannot price.+ service row it includes is a lower bound for either reason: its stored `lower_bound: true` (uncertain requests,+ above) or a quantity the current catalog cannot price.- The Usage tab shows a "搜索服务" table from `services[]` (requests, billable requests, cost) below the Sourcetable; the total cost line is `api_cost_usd`, with the reported figure shown beside it. The label comes fromthe catalog, not from model inventory (§8).@@ -507,15 +486,15 @@ reached), `invalid` (401, or a 403 the row maps to the credential) and`unknown` (anything else: transport failures, 5xx, unreadable bodies).A vendor enters the catalog only when its terms allow what every search does: keeping the returned titles, URLs,-excerpts and page text in the Session transcript and showing them to the user, with no screening duty Avibe does not+excerpts in the Session transcript and showing them to the user, with no screening duty Avibe does notperform. Prices are in USD. A vendor whose price grows with the result count is capped at the count its base priceincludes, so the recorded list price stays exact.-| Vendor | Request | Auth | Results | Content | List price (2026-10) | Free check |+| Vendor | Request | Auth | Results | Excerpt | List price (2026-10) | Free check || --- | --- | --- | --- | --- | --- | --- |-| DeepSeek | `POST https://api.deepseek.com/v1/tools/search` `{query, count, need_content}` | Bearer | 1–50 | `need_content` | $0.75 / 1k successful requests; empty results, failures and timeouts not billed | `GET /user/balance`: 200 with `is_available: true` is `pass`, with `false` is `balance`; 401 is `invalid` |-| Tavily | `POST https://api.tavily.com/search` | Bearer | 1–20 | `include_raw_content` | $8 / 1k basic searches | `GET https://api.tavily.com/usage`: a 200 needs at least one numeric usage/limit pair (`key.usage`/`key.limit`, `account.plan_usage`/`account.plan_limit`, `account.paygo_usage`/`account.paygo_limit`), and each recognized pair must be wholly absent or have both members as valid numbers, otherwise the result is `unknown`; a `key.limit` of null is Tavily's unlimited key ([OpenAPI](https://docs.tavily.com/documentation/api-reference/openapi.json), 2026-10-20) and counts as a key pair with headroom. A present key pair at its limit is `limit`. Otherwise, with no account pair (Tavily's schema makes `account` optional) the answer still authenticates the key and is `pass`, payment being confirmed by the first search as for a vendor without a free check; with one, it is `pass` when the plan pair or the pay-as-you-go pair has headroom (pay-as-you-go continues after the plan allowance) and `limit` when none does; 401 is `invalid` |-| Exa | `POST https://api.exa.ai/search` | `x-api-key` | 1–10 (the base price includes 10) | always `contents.highlights` (the `snippet` source, since a base result has no excerpt), included in the search price since Exa 3.0 ([announcement](https://exa.ai/blog/exa-3), 2026-10-19); `content: true` adds `contents.text`, +$1 / 1k pages ([pricing](https://exa.ai/pricing), 2026-10-20) | $7 / 1k (Exa Auto); the response's `costDollars` is used when present | none known |+| DeepSeek | `POST https://api.deepseek.com/v1/tools/search` `{query, count}` | Bearer | 1–50 | `summary` | $0.75 / 1k successful requests; empty results, failures and timeouts not billed | `GET /user/balance`: 200 with `is_available: true` is `pass`, with `false` is `balance`; 401 is `invalid` |+| Tavily | `POST https://api.tavily.com/search` | Bearer | 1–20 | `content` (a query-relevant snippet; `include_raw_content` is never sent) | $8 / 1k basic searches | `GET https://api.tavily.com/usage`: a 200 needs at least one numeric usage/limit pair (`key.usage`/`key.limit`, `account.plan_usage`/`account.plan_limit`, `account.paygo_usage`/`account.paygo_limit`), and each recognized pair must be wholly absent or have both members as valid numbers, otherwise the result is `unknown`; a `key.limit` of null is Tavily's unlimited key ([OpenAPI](https://docs.tavily.com/documentation/api-reference/openapi.json), 2026-10-20) and counts as a key pair with headroom. A present key pair at its limit is `limit`. Otherwise, with no account pair (Tavily's schema makes `account` optional) the answer still authenticates the key and is `pass`, payment being confirmed by the first search as for a vendor without a free check; with one, it is `pass` when the plan pair or the pay-as-you-go pair has headroom (pay-as-you-go continues after the plan allowance) and `limit` when none does; 401 is `invalid` |+| Exa | `POST https://api.exa.ai/search` | `x-api-key` | 1–10 (the base price includes 10) | always `contents.highlights` (the `snippet` source, since a base result has no excerpt), included in the search price since Exa 3.0 ([announcement](https://exa.ai/blog/exa-3), 2026-10-19); `contents.text` is never requested | $7 / 1k (Exa Auto); the response's `costDollars` is used when present | none known |- DeepSeek facts that shape the UI (DeepSeek's Search & Fetch guide, 2026-10-19): the query is 1–128 characters andsupports operators (`site:`, `lang:`, `after:`, quoted phrases). The catalog records the list price only. Any@@ -571,15 +550,14 @@ only DeepSeek Source is a relay gets the create flow, which adds an official Dee### 6.3 Service detail-The search-specific parts of a Source's detail (the "用于网页搜索" switch, results, content, this month's requests)+The search-specific parts of a Source's detail (the "用于网页搜索" switch, results, this month's requests)appear only once the read lists that Source as a service candidate, the same S2 activation signal as the Toolsrows; before it, a `search` Source's detail shows only its key, health and remove, so nothing presents a serviceas active.Status (latest success, or the Source's current health detail with its existing remedy copy; "重新启用" only for atool-only `search` Source in a balance or limit state, §4.2, and the existing Source repair for DeepSeek), key (masked; "更换密钥",-or for DeepSeek "使用供应商「DeepSeek」的 Key", managed under 供应商与路由), settings (results; page content only where-the vendor returns page text, with its effect on price and on what the model reads), this month's requests and the+or for DeepSeek "使用供应商「DeepSeek」的 Key", managed under 供应商与路由), settings (results), this month's requests and thepersisted cost (list-priced quantities at the current table, labelled "按 API 标价估算", with the service-reportedfigure beside it when there is one) with a link to Usage, and remove. Every search-capable Source's detail has the "用于网页搜索" switch(`services.<id>.enabled`), so a disabled one can always be turned back on. A model Source with a search API@@ -631,7 +609,7 @@ One coordinated Model Hub version event under the freeze protocol (`model-hub-co- `api.md`'s Source create and credential replace sections: the search branch (§3.1), with its outcomes in`api-response.schema.json`.- `hosted-tools-status.schema.json`: `prefer_native`, `services`, `executor_candidates[].kind` and settings,- `service_vendors[]`, `ListPrice.extra[]`'s `page` unit and `when` (§3.5), and a candidate's `cooldown_until`+ `service_vendors[]`, and a candidate's `cooldown_until`and `trial_pending` (§4.2), with their UI types; the PUT body.- `capability-evidence.schema.json`, and `status.latest_ok.mode` and `status.verified[].mode` in`hosted-tools-status.schema.json` with the UI's types: `mode: "service"`.@@ -643,7 +621,7 @@ One coordinated Model Hub version event under the freeze protocol (`model-hub-co- The vendor catalog (`vibe/data/api_key_vendors.json` and its schema): search vendors and DeepSeek's search API row.- Usage (`usage-summary.schema.json`, `api.md`'s Usage section, and the on-disk usage ledger): a service row keyedby Source and `service_id`, counting requests rather than model calls, with the additive `billable_requests`,- `reported_usd`, `reported_requests`, `list_pages`, `uncertain_requests` and `lower_bound` fields; the+ `reported_usd`, `reported_requests`, `uncertain_requests` and `lower_bound` fields; thesummary's `kind: "service"` bucket-row branch, `services[]` (`ServiceUsage`, with `priced`), `service_reported_usd`, `excluded_service_requests` and `pricing.service_price_date` (§4.3); and load fixtures for released rows that lack them (§4.3).- `HOSTED_ERROR_CODES`: `search_query_too_long` and `search_sources_blocked`, with copy on every surface.- The recovery actions run in the controller, which owns the trial gate and the cooldowns. The UI process forwards@@ -656,16 +634,12 @@ One coordinated Model Hub version event under the freeze protocol (`model-hub-core-enable in S1a, retry in S2.- `api.md`: the read and PUT changes, the "立即重试" cooldown clear (§4.2), and the "重新启用" action for a `search` Source in `needs_action` (§4.2), withits `api-response.schema.json` branch.-- The turn trace's `hosted_tools`: the frozen `prefer_native`, candidate list and per-candidate `results` and- `content` (§3.2).+- The turn trace's `hosted_tools`: the frozen `prefer_native`, candidate list and per-candidate `results` (§3.2).- `core/hosted_activity`'s payload: the projected `attempts` with Source names, codes, skips and remedies, and theexecutor kind (§4.3).-- C-1 (`agent-core-contracts/message.schema.json`): the optional `HostedSource.content` with its bounds in the- schema and the reader (at most 4,000 characters per source and 20,000 across a record's sources; a reader clips- a longer value to the bound rather than rejecting the row, and a new optional field rejects no released row; the- released `HostedSource` fields gain no new limits);+- C-1 (`agent-core-contracts/message.schema.json`): `HostedSource` is unchanged (no page content);`HostedRecord.attempts[]` with `source_id`, `label`, `kind`, `outcome`, `error_code`, `skipped`, `retry_at`, `needs_action`, `cost` and- `superseded`; `HostedCost.lower_bound` with its `core/hosted_activity` projection ("至少") and `HostedCost.estimate` ("≈" on a reported figure), and a cost of exactly 0 rendered as+ `superseded`; the `core/hosted_activity` projection's "至少" for a total with an unpriced attempt; `HostedCost.estimate` ("≈" on a reported figure), and a cost of exactly 0 rendered as"$0" without "≈" by that projection, `HostedToolRow` and the IM line, since a zero is never an estimate; andtheir reader and writer types, and the six `service_*` codes in `HOSTED_ERROR_CODES`, with copy on every surface; and aservice executor origin. `Protocol` and the assistant-message `Origin` stay unchanged (four model protocols); a@@ -681,7 +655,7 @@ One coordinated Model Hub version event under the freeze protocol (`model-hub-codoes; a service attempt the catalog doesnot bill records an explicit zero cost, an earlier possibly billed one is listed in `failed_attempts[]` with no `cost` (a terminal one stays the attempt`execution` names, with no cost, and its `attempts[]` entry has none either), and- `HostedCost.lower_bound` marks a partial total (§4.3); a service response is `completed` when it answered 200+ the projection marks a partial total (§4.3); a service response is `completed` when it answered 200with a `results` array that is empty or keeps at least one row after the §4.3 bounds, and a non-empty array whoseevery row the bounds reject is `service_unreadable` and fails over; and the terminal reasons `search_query_too_long` and `search_sources_blocked`(§4.2). The C-6 text is replaced in the same version event, so there is one gateway specification.@@ -693,25 +667,26 @@ One coordinated Model Hub version event under the freeze protocol (`model-hub-co| --- | --- | --- | --- || **S1a** Catalog and Sources | foundation | search vendors in the catalog; the Source UI guards for a `search` Source (no model refresh, test or add-model controls; its row says "搜索服务"); `protocol: "search"` Sources and their exclusions (the credential store accepts the protocol, the engine config renderer skips it); the protocol vocabulary split; the create and replace branch with free checks; "重新启用" (`reenable_search_source`, its free check and the armed-trial state); `service_order` maintenance on create and remove; the adapter's search call and free-check operation with custody and transport rules; opening the v17 version event | — || **S1b** Settings and Tools read | foundation | no service candidate and no `service_vendors` in the read until S2 activates them; `prefer_native`, `services` (the patch semantics and load-time clamping) and `executor_order_kinds` (loaded, written with each order save, and kept across a restart); the Tools read (`executor_candidates` with `kind`, `service_vendors`, `trial_pending`) and PUT; their v17 entries | S1a |-| **S2** Chain and records | gateway | candidates, automatic order and the saved-order placement rule, limits, per-vendor request and result mapping with field bounds, outcome classes into fenced Source health, positive evidence, record with `attempts[]`, cost and metering, `prefer_native` in hop facts, the no-candidate reason, the `hosted_activity` projection | S1a, S1b, S3, S4, S6's disclosure |-| **S3** Model text | Vibey | C-1's optional `HostedSource.content` and the model-facing text that renders it, with its bounds; the card's executor label (read from `attempts[]` when present) | S1a's open v17 event |-| **S4** Tools, dialog, Sources | UI | §6 with en and zh copy, built against the read shape with fixtures; it shows service rows and the add dialog's services only when the read lists them | S1b's read shape; S5's frames |+| **S2** Chain and records | gateway | candidates, automatic order and the saved-order placement rule, limits, per-vendor request and result mapping with field bounds, outcome classes into fenced Source health, positive evidence, record with `attempts[]`, cost and metering, `prefer_native` in hop facts, the no-candidate reason, the `hosted_activity` projection and the card's executor label ("通过 Tavily", read from `attempts[]`) | S1a, S1b, S1c, S4, S6's disclosure |+| ~~S3~~ | — | cancelled 2026-10-20 with page content; the card's executor label ("通过 Tavily") moves to S2 with the projection | — |+| **S1c** Content removal | foundation | removes what S1a and S1b landed for page content: the catalog's content request mapping, `content_max_chars` and `page` price extras; S1b's `services.<id>.content` (a saved key is ignored on load), the read's `settings.content` and the vendor page-text flags, with `hosted-tools-status.schema.json`, `api.md`, the UI types and the v18 entries (v19 if a release has carried v18) | S1b |+| **S4** Tools, dialog, Sources | UI | §6 with en and zh copy, built against the read shape with fixtures; it shows service rows and the add dialog's services only when the read lists them | S1b's read shape as S1c leaves it; S5's frames || **S5** Frames | design | §6 frames in `design.pen` through Pencil (done: avibe-docs#73) | — || **S6** Public docs | docs | Models → Tools: services, order, defaults, privacy and cost, in English and Chinese. The disclosure part (an official DeepSeek Source joins the search order automatically, which data goes to each service, what it costs, and how to turn it off) publishes no later than the release that ships S2; the UI walkthrough follows S4 | the disclosure lands before or with S2 (S2 depends on it); the walkthrough follows S4 |The version event follows the v15 precedent in `model-hub-contracts/README.md`: S1a opens v17 and publishes the-Source side, and S1b, S2 and S3 edit the same v17 section only while it is unshipped, as the hosted-tools+Source side, and S1b and S2 edit the same v17 section only while it is unshipped, as the hosted-toolsfreeze rule says (`vibey-hosted-tools.md` §12). A lane that lands after a release has carried v17 opens v18 forits additions instead, so a shipped version number never changes meaning. Because releasecandidates are cut from the default branch at any time, every lane is safe on its own until the event closes:before S2, a `search` Source is never requested and never affects model routing, discovery or engine config, and-the shapes S1a and S1b write are final, so later lanes read them without migration. S3 lands before or with S2: the chain-never requests page text (billed for Exa) that the model-facing text cannot yet show, since S3 reads an optional-field that can exist before any producer. No release turns on a new third-party data flow before+the shapes S1a and S1b write are final except for what S1c removes. S1c drops the page-content fields, and its+loader ignores a `services.<id>.content` key that a pre-S1c build saved, so no migration write is needed. S4 and S2+build on the post-S1c shape, so they read it without migration. No release turns on a new third-party data flow beforeit is disclosed: S2's release carries S6's disclosure and a release note naming DeepSeek's automatic enrolment andhow to turn it off (the `services.<id>.enabled` switch, available through S1b's PUT). S2 is the activation lane: on its head the-read starts listing service candidates and `service_vendors` and the chain starts calling services, and S3 and S4-land before it, so the release that turns services on has the renderer, the service rows, the add dialog and the+read starts listing service candidates and `service_vendors` and the chain starts calling services, and S4+lands before it, so the release that turns services on has the service rows, the add dialog and thedisclosure. Before S2, no surface shows a service the gateway cannot run, and a `search` Source can only be createdthrough the API.@@ -732,7 +707,7 @@ through the API.which services failed or were blocked before it, and how to repair a blocked one.7. A `search` Source never appears as a model route candidate, in discovery, in a model probe or in engine config.8. A DeepSeek API-key Source on the official endpoint is a candidate with no extra setup; on a relay it is not.-9. A settings change never alters a running turn: `prefer_native`, `results` and `content` are frozen at the turn's+9. A settings change never alters a running turn: `prefer_native` and `results` are frozen at the turn'sfirst resolution.## 11. Test plan@@ -745,7 +720,7 @@ Hermetic, against stub vendor servers; no live upstream and no real keys.| Config | `protocol: "search"` accepted only in its combination; `prefer_native`, `services` and `executor_order_kinds` round-trip and default, and a mixed service/model order keeps its placement across a restart; a release-before loader ignores the new `hosted_tools` fields || Custody | the adapter call attaches the key, refuses redirects and non-catalog hosts, caps the body, and returns no key material; nothing outside the adapter reads the key || Chain | automatic and saved order, and the read-time placement of unnamed search-capable Sources before the first model executor (including one qualified by a catalog upgrade, with no config write) and a named entry whose role changed (a catalog upgrade, a retarget, a released order naming an official DeepSeek Source) re-placed through `executor_order_kinds`; service cooldown from `Retry-After` (a longer deadline is not shortened) and doubling backoff, scoped to (Source, service), with a DeepSeek model route unaffected, and not written by an attempt that started before a key replacement; the terminal reason for every mix of skips (a disabled Source decides it only when every candidate is disabled), with `record.attempts[]` present when nothing executed and a blocked model executor showing its own remedy; `services.<id>.enabled: false` takes a DeepSeek Source out of the order and keeps its models; query-length skip; each outcome row of §4.2; one deadline; metering, `failed_attempts` and `attempts`; DeepSeek official versus relay; settings changed mid-turn do not apply until the next turn; re-enable with and without a free check, a second press joining the in-flight check, only one request admitted while a re-enable trial is pending, and a restart before the trial leaves the Source blocked; a long cooldown is shown with `cooldown_until` and cleared by "立即重试"; a reported cost above the ceiling falls back to the list price; a Tavily `key.limit: null` is unlimited |-| Usage | service rows add known costs to the totals without the lower-bound flag; only sent requests are metered; DeepSeek's empty results, non-200 responses, timeouts before any status and failures before sending cost nothing; after sending, the pre-header and post-header cases differ: before any status, a lost connection, a stop, or a timeout for a vendor that does not declare it unbilled records no cost, adds to `uncertain_requests` and sets the lower bound, while after a received status a non-200 costs $0, a Tavily or Exa 200 is list-priced (its page part a lower bound) and a DeepSeek 200 (unreadable, timed out or stopped while reading) records no cost, adds to `uncertain_requests` and sets the lower bound; a default Exa call is listed at the search price alone (highlights included); a tool-only Source appears only in `services[]` and validates against the closed schema; an Exa content call without a reported cost keeps its page surcharge across a restart; a non-200 attempt records $0, and so does a received non-200 whose body read then failed; a pre-send failure is a `failed` attempt with $0 and no metering; a superseded failure, from any fence or from a repair after it settled, shows no repair; the skip classification order; a service no longer in the catalog stays in `services[]` unpriced, with the lower-bound flag, and its saved Source still loads and is no candidate; `service_order` survives a reload and decides the automatic order; a reported cost survives a restart through the ledger; a price change revalues list-priced quantities under the new table date; a released ledger row without the new fields loads; an impossible counter set is repaired, orphaned pages or reported dollars included; a pre-send failure on the only service projects as that service with $0, and after a billable model attempt the total keeps that attempt's cost; a removed page-text price leaves old page quantities unpriced with the lower-bound flag; a saved `results` above a lowered maximum loads clamped |+| Usage | service rows add known costs to the totals without the lower-bound flag; only sent requests are metered; DeepSeek's empty results, non-200 responses, timeouts before any status and failures before sending cost nothing; after sending, the pre-header and post-header cases differ: before any status, a lost connection, a stop, or a timeout for a vendor that does not declare it unbilled records no cost, adds to `uncertain_requests` and sets the lower bound, while after a received status a non-200 costs $0, a Tavily or Exa 200 is list-priced and a DeepSeek 200 (unreadable, timed out or stopped while reading) records no cost, adds to `uncertain_requests` and sets the lower bound; a default Exa call is listed at the search price alone (highlights included); a tool-only Source appears only in `services[]` and validates against the closed schema; a non-200 attempt records $0, and so does a received non-200 whose body read then failed; a pre-send failure is a `failed` attempt with $0 and no metering; a superseded failure, from any fence or from a repair after it settled, shows no repair; the skip classification order; a service no longer in the catalog stays in `services[]` unpriced, with the lower-bound flag, and its saved Source still loads and is no candidate; `service_order` survives a reload and decides the automatic order; a reported cost survives a restart through the ledger; a price change revalues list-priced quantities under the new table date; a released ledger row without the new fields loads; an impossible counter set is repaired, orphaned reported dollars included; a pre-send failure on the only service projects as that service with $0, and after a billable model attempt the total keeps that attempt's cost; a saved `results` above a lowered maximum loads clamped || Mapping | one recorded response per vendor maps to the canonical record with bounds; an empty results array is `completed` and ends the chain; unreadable bodies; a released native `HostedSource` row longer than the new bounds still loads || Hop facts | `prefer_native` off declares the function on a native-capable hop, and a native result in history replays in the synthetic form || UI | the card states, add dialog, service detail, Sources rows, copy in both locales |@@ -757,7 +732,7 @@ Hermetic, against stub vendor servers; no live upstream and no real keys.Model Hub's Sources;- any search chain with a search-capable candidate, including one through an auto-enrolled DeepSeek Source,whether or not that candidate was reached, because the persisted result- carries C-1 values (`executor_origin` for a search API, `HostedSource.content`, `record.attempts`) that an+ carries C-1 values (`executor_origin` for a search API, `record.attempts`) that anolder release's strict reader rejects, so that Session no longer loads there;- any sent service request, which writes a service-shaped usage ledger row even when the call was stopped andleft no record. An older reader requires `model_id` and drops that row, so after a downgrade the Usage tab@@ -774,12 +749,12 @@ Hermetic, against stub vendor servers; no live upstream and no real keys.must be reapplied before service execution is enabled. S2/S6's activation and opt-out guidance must state this.2. **No custom endpoints in phase 1.** Search services use the catalog endpoint only, so relays and self-hostedSearXNG wait for a custom-endpoint rule.-3. **Settings are per service, not per call.** The model cannot ask for more results or for page content.- Vendors without page text have no content setting.+3. **Settings are per service, not per call.** The model cannot ask for more results.4. **No paid test search.** A key without a free check is confirmed by its first real search.-5. **An oversized page-text response fails.** Tavily and DeepSeek document no bound on page text, so a content- response over the 8 MiB transport cap is `service_unreadable` (billed by the vendor's rule, then cooldown and- failover). Content is off by default, and a full response is far below the cap in practice.+5. **No page content in phase 1.** Search results carry the vendor's excerpt only; full page text comes from+ `web_fetch` in phase 2, one page at a time and chosen by the model, so a search never sends every result's+ page to the model. The content setting and catalog fields S1a and S1b landed are removed by S1c (§9) before S4 and S2 build on the+ read shape; no release ever activated them.6. **Result quality differs between services.** The order is the user's control; the gateway does not judge results.7. **`web_fetch` is phase 2**, and other backends are not covered.8. **DeepSeek's own server-side tools** (its Anthropic- and Responses-compatible APIs) are native search for DeepSeek