Repository navigation
Commit a061271
authored
feat: add IO Intelligence provider (#1758)
* feat: add IO Intelligence provider
Restore the IO Intelligence (io.net) provider removed in #11297,
updated to the current architecture: dynamic model catalog fetched
from GET /models, streaming chat completions with reasoning and
tool-call support, usage reporting, settings UI, and translations
for all supported locales.
* fix(api): derive IO Intelligence model metadata from the live catalog
- parse context_window, max_tokens, tool/vision/cache capabilities, and
per-token pricing (normalized per million) from the /models catalog
- prefer context_window over the always-null max_model_len field
- skip catalog entries that explicitly declare no tool support
- add io-intelligence to KEY_SCOPED_PROVIDERS for per-key cache isolation
- un-retire test fixtures, add provider parity tests across types, api,
and webview-ui, and record a changeset
* fix(api): forward IO Intelligence completion options only when set
The OpenAI SDK validates a present-but-undefined timeout key, so
completePrompt threw before issuing a request whenever it was called
without options. Request options are now built conditionally, matching
the SDK's key-presence semantics, and regression tests cover both the
bare and optioned calls. Adds the missing settings-component spec.
* fix(api): harden IO Intelligence schema and temperature guard
Aligns the max_model_len zod field with its sibling numeric fields
(integer, positive, nullish) and gates the streaming temperature
parameter on a configured value and the model's capability flag,
matching the NanoGPT handler.
* fix(api): forward IO Intelligence temperature in completePrompt
Mirror the streaming path's three-condition guard (configured temperature,
catalog supportsTemperature not explicitly false, model supports it) in the
non-streaming completePrompt body, matching the NanoGPT handler. Add a
regression test asserting the temperature reaches the request body.
* test(api): use a catalog-listed model id in the IO Intelligence fixture
* fix(webview): link the IO Intelligence model hint to the product page
- point the ModelPicker serviceUrl at https://io.net/intelligence instead of the raw models API endpoint, matching how the other providers link a human-readable page
- use deepseek-ai/DeepSeek-V3.2 as the handler-spec fixture id; the previously used DeepSeek-V3.1 is no longer listed in the io.net catalog
* fix: align IO Intelligence usage mapping and render order with the precedent
- use ?? instead of || for cacheReadTokens so a legitimate cached_tokens of 0 is preserved, matching the NanoGPT usage mapping
- move the ApiOptions render block after Kenari so io-intelligence sits in the same position as every other registration in this change
* test(api): cover cached_tokens:0 preservation in the IO Intelligence usage mapping
* chore: drop the IO Intelligence changeset
Routine provider PRs do not add changesets in this repo; they are only
added during release preparation.
* fix(api): redact the IO Intelligence key before the provider error is logged
handleProviderError logs the message and stack before it applies the
messageTransformer, so an upstream error that echoed the API key reached
the extension-host log even though the thrown error was redacted. Scrub
the key from the error itself (and from non-Error values) before handing
it over, and keep the transformer redaction for messages derived from
other error fields. The spec now spies on console.error and also covers
the non-Error and no-key paths.
* test: reject a disallowed IO Intelligence model in ProfileValidator
Add ioIntelligenceModelId to the positive-and-negative provider table and
assert that a model absent from the allowlist is rejected.
* fix(webview): debounce IO Intelligence catalog refreshes while the key is typed
The API-key effect posted requestRouterModels on every keystroke, and
because the IO Intelligence cache is keyed by the API key each partial
value triggered a fresh catalog request. Use the same 250ms useDebounce
as ApiOptions so only the settled key is sent, and drop a pending request
on unmount.
* fix(webview): keep an unlisted IO Intelligence model id as the picker selection
A custom id stored through ModelPicker's "Use custom model" path was
replaced by the default id in useSelectedModel when the fetched catalog
did not list it, so the picker displayed a different model from the one
the handler sends requests with (RouterProvider.getModel resolves
modelId || defaultModelId). Preserve the configured id and only fall back
the metadata, mirroring the litellm and kimi-code cases. Covered by a
hook test and a real-ModelPicker selection test.
* fix: redact raw error metadata and keep IO Intelligence ready after a catalog failure
handleProviderError prefers error.error.metadata.raw as the logged message,
so scrub the API key from that field alongside message and stack before the
handler logs it. Treat IO Intelligence like LiteLLM in the readiness check
so a settled catalog error still resolves the configured model id instead of
falling back to the provider default. Regression tests for both.
* fix: serialize object-valued raw error bodies before redacting them
handleProviderError calls string methods on error.error.metadata.raw, so an
object-valued upstream body reached it unredacted and threw a TypeError
before the status was preserved. Serialize it first, then redact. Regression
test with an object body and a 401 status.
* fix(io-intelligence): stop rendering catalog names as model descriptions
The IO Intelligence catalog has no free-text description field, so the
fetcher was copying the remote model name into ModelInfo.description,
which the settings view renders as Markdown. Leave description unset and
keep the name as the plain-text displayName only.
Add focused tests for the requestRouterModels path (stored key, unsaved
key from message values, explicit empty key) and for the IO Intelligence
provider validation.
* fix(io-intelligence): do not forward OpenAI Compatible custom headers
The IO Intelligence endpoint is fixed, so the custom headers configured for
the OpenAI Compatible provider are dropped before the client is built.
Add tests for the header isolation and for omitting temperature on a model
that does not support it (streaming and completePrompt).
* test(io-intelligence): assert the catalog published for each router-models key
* fix(io-intelligence): build the model catalog on a null-prototype object
* test(io-intelligence): pin the request messages and the completePrompt payload
* test(io-intelligence): add a visual snapshot of the provider settings
* test(io-intelligence): keep only the screenshot check in the visual test1 parent ff0a2bd commit a061271
69 files changed
Lines changed: 2036 additions & 9 deletions
File tree
- apps/cli/src/lib/utils
- __tests__
- packages/types/src
- __tests__
- provider-settings
- providers
- src
- api
- __tests__
- providers
- __tests__
- fetchers
- __tests__
- core
- config/__tests__
- webview
- __tests__
- webview-ui
- playwright/gallery
- src
- components
- settings
- __tests__
- providers
- __tests__
- __screenshots__
- utils
- __tests__
- ui/hooks
- __tests__
- i18n/locales
- ca
- de
- en
- es
- fr
- hi
- id
- it
- ja
- ko
- nl
- pl
- pt-BR
- ru
- tr
- vi
- zh-CN
- zh-TW
- utils
- __tests__
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | | - | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | | - | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| 364 | + | |
364 | 365 | | |
365 | 366 | | |
366 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| 317 | + | |
316 | 318 | | |
317 | 319 | | |
318 | 320 | | |
| |||
546 | 548 | | |
547 | 549 | | |
548 | 550 | | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
549 | 556 | | |
550 | 557 | | |
551 | 558 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments