Commit Graph

1625 Commits

Author SHA1 Message Date
Mario Zechner 10a575b76b docs: changelogs and phase restructure for the models refactor (phase 8)
Breaking-change entries with migration guides: pi-ai (compat
entrypoint, Provider -> ProviderId, api module moves, new Models/
provider/auth API), agent (required AgentHarnessOptions.models,
compaction signatures, structural StreamFn), coding-agent (extension
author note: runtime unaffected via loader compat alias).

models.md: Phase 7 closed out (import switch landed with phase 5; the
gated bullets move to a new Phase 9 ModelManager-migration outline:
per-session Models, AgentSession streaming, AuthStorage replacement,
login UI on OAuthAuth, cloudflare cleanup, internal compat removal,
compat deletion).
2026-06-10 21:31:56 +02:00
Mario Zechner 8a0903ebf2 feat(ai): compat entrypoint, core-only root barrel (phase 5)
The root barrel is now core-only and side-effect free: types,
createModels/createProvider, auth substrate, lazyStream/lazyApi, faux,
utils. Generated catalogs, api-registry, env-api-keys, images, global
stream functions, and per-API lazy wrappers leave the root.

New @earendil-works/pi-ai/compat preserves the old surface verbatim as
a strict superset of the root: api-dispatch stream/complete with env
key injection, the builtin registration side effect (skip-if-present so
it cannot clobber earlier overrides), deprecated getModel/getModels/
getProviders aliases of the new getBuiltin* reads in providers/all,
lazy api wrappers + setBedrockProviderModule, and image generation.
Compat dies with the coding-agent ModelManager migration.

Packaging: exports map gains ./compat, ./providers/*, ./api/*;
sideEffects array lists only the effectful modules.

Old-global imports across agent/coding-agent/examples and pi-ai tests
switch to /compat (path-only; compat is a superset). The coding-agent
extension loader resolves the pi-ai ROOT specifier to compat, so
existing user extensions using the old global API keep working at
runtime until compat is removed. vitest configs alias /compat to src;
browser smoke imports old globals from /compat.
2026-06-10 21:17:12 +02:00
Mario Zechner 4d5c015820 feat(ai): adapt OAuth flows to OAuthAuth (phase 4)
anthropic, openai-codex, and github-copilot flow modules gain OAuthAuth
exports (login/refresh/toAuth) wired to the prompt()/notify() login
callbacks, making the lazyOAuth attachments on the provider factories
functional. Copilot's modifyModels baseUrl rewriting becomes toAuth()
returning ModelAuth.baseUrl derived from the token proxy endpoint.

Callback-server flows race a manual_code prompt and abort it through
AuthPrompt.signal once the flow settles; OAuthAuth has no
usesCallbackServer flag. The old OAuthProviderInterface exports stay
unchanged until the coding-agent migration.
2026-06-10 20:41:29 +02:00
Mario Zechner fec0c3d12f feat(ai): provider factories, per-provider catalogs, createProvider (phase 3)
Auth helpers in src/auth/helpers.ts: envApiKeyAuth() (stored key wins,
then env vars in order, with secret-prompt login) and lazyOAuth()
(flow loads on first use through bundler-opaque dynamic imports in
utils/oauth/load.ts; the OAuthAuth flow exports land in phase 4).
There is no OAuth factory toggle: providers that support OAuth always
attach it, advertising costs nothing until login/refresh runs.

createProvider() in models.ts builds providers from parts: single API
implementation or a map dispatched on model.api (mixed-API providers
like opencode and github-copilot); unknown api yields a stream error.

generate-models.ts now emits one providers/<id>.models.ts catalog per
provider (35 files, biome-excluded like models.generated.ts) and
models.generated.ts becomes a generated aggregator, so importing one
provider factory pulls one catalog. Typed getModel globals unchanged.

One factory per built-in provider under src/providers/: envApiKeyAuth
for standard providers, OAuth for anthropic/openai-codex/github-copilot,
ambient ApiKeyAuth for amazon-bedrock (AWS env/profile/IAM) and
google-vertex (explicit key or ADC+project+location).

providers/all.ts: builtinProviders(), builtinModels(), getBuiltin*
re-exports. fauxProvider() factory returns a real Provider for tests;
legacy registerFauxProvider() unchanged.
2026-06-10 20:33:20 +02:00
Mario Zechner 20a9b82cf9 fix(ai): regenerate model catalog
Picks up the Claude Fable 5 thinking-off metadata (off: null in
thinkingLevelMap) that 9ccfcd7c added to the generator without
regenerating, fixing anthropic-thinking-disable and supports-xhigh
tests. Includes upstream catalog drift; OpenRouter delisted
moonshotai/kimi-k2.6:free, so the kimi compat test now pins only the
listed variant.
2026-06-10 20:09:13 +02:00
Mario Zechner ba93da9a93 feat(ai): move API implementations to src/api with lazy wrappers (phase 2)
Stream implementations move from src/providers/ to src/api/, renamed by
API id (anthropic.ts -> anthropic-messages.ts, google.ts ->
google-generative-ai.ts, mistral.ts -> mistral-conversations.ts,
amazon-bedrock.ts -> bedrock-converse-stream.ts). Every module now
exports exactly stream/streamSimple; shared helpers move alongside.

New ProviderStreams dispatch contract in types.ts, lazyApi() wrapper in
api/lazy.ts, and one .lazy.ts wrapper per API. Bedrock's wrapper keeps
the node-only variable-specifier import and setBedrockProviderModule()
(now taking ProviderStreams).

providers/register-builtins.ts deleted; interim until the compat
entrypoint lands, builtin api-registry registration lives in stream.ts
and lazy wrappers are exported from the root barrel. Old per-API lazy
exports (streamAnthropic, ...) are gone; package.json subpaths retarget
to dist/api/.
2026-06-10 20:08:59 +02:00
Mario Zechner ee276e4db5 Merge remote-tracking branch 'origin/main' into model-registry 2026-06-10 18:49:18 +02:00
Mario Zechner f63095cfff feat(ai): add Models runtime with provider-owned auth (phase 1)
New Models/MutableModels/createModels collection: provider map, async
model listing (best-effort aggregation), getAuth decision tree with
double-checked locked OAuth refresh, stream/complete with per-field
auth merge over lazyStream.

Auth substrate: ProviderAuth { apiKey?, oauth? }, one type-tagged
credential per provider, CredentialStore (read/modify/delete; modify
is the only write path, serialized RMW), OAuthAuth login/refresh/toAuth
split, prompt()/notify() login callbacks, browser-safe default
AuthContext.

types.ts: Provider alias renamed to ProviderId; ApiOptionsMap and
ApiStreamOptions<TApi> for typed per-API stream options; hasApi()
runtime narrowing guard.
2026-06-10 18:49:10 +02:00
Burak Varli 0b6c95dda0 feat(ai): link AWS data retention docs in Bedrock validation errors
When Bedrock rejects a request with "data retention mode '<mode>' is not
available for this model", append a pointer to the AWS data retention
documentation so users can configure a supported mode.
2026-06-10 07:45:50 +00:00
Armin Ronacher 9ccfcd7cfc fix(ai): omit disabled thinking for Claude Fable 5 2026-06-10 00:27:11 +02:00
Armin Ronacher dacb367e9e fix(ai): expect Claude Fable 5 in adaptive thinking model test 2026-06-09 23:20:20 +02:00
Armin Ronacher 82f2b1e908 Add [Unreleased] section for next cycle 2026-06-09 23:14:55 +02:00
Armin Ronacher 28df940f0d Release v0.79.1 2026-06-09 23:14:52 +02:00
Armin Ronacher 4d9f9f455d fix(ai): regenerate image models for upstream Riverflow rename 2026-06-09 23:14:38 +02:00
Armin Ronacher 66f432cae4 fix(ai): regenerate models for Claude Fable 5 and Azure metadata overrides
Also add inherited coding-agent changelog entries for Fable 5 and the
Azure gpt-5.4/5.5 context window and gpt-5-pro maxTokens fixes.
2026-06-09 23:08:05 +02:00
Armin Ronacher 6b5923f107 fix(ai): correct Azure gpt-5.4/5.5 context window and gpt-5-pro maxTokens
Azure Foundry deploys gpt-5.4 and gpt-5.5 with a 1,050,000 context
window, but the Azure provider cloned OpenAI-direct's 272k API limit.
Override the context window in the Azure derivation.

Also fix gpt-5-pro maxTokens, which upstream metadata set to 272000 (a
duplicate of the input sub-limit) instead of the actual 128000 max
output; corrected at the source so OpenAI-direct and Azure both match.

closes #5559
2026-06-09 22:57:20 +02:00
Armin Ronacher 5a9d72ea02 feat(ai): add Claude Fable 5 metadata 2026-06-09 22:42:48 +02:00
Armin Ronacher a0c2465d47 docs: audit unreleased changelogs 2026-06-09 22:33:02 +02:00
Mario Zechner 3d02d1da11 fix(ai): map OpenCode max tokens
closes #5331
2026-06-09 13:41:08 +02:00
Mario Zechner 64b51efb6e fix(ai): use z.ai thinking payload
closes #5330
2026-06-09 13:37:58 +02:00
Mario Zechner 84cdd02400 fix(ai): disable Azure OpenAI response storage
closes #5530
2026-06-09 12:53:17 +02:00
Mario Zechner 2326d5cb4a fix(ai): disable Moonshot thinking when requested
closes #5531
2026-06-09 12:23:41 +02:00
Mario Zechner 4c4863654e Merge pull request #5505 from awakenalive/patch-1
Update models for together.ai
2026-06-09 10:52:03 +02:00
ajm_ensighten 8cef3c8d7f fix(amazon-bedrock): extract region from inference profile ARNs
Application inference profile ARNs encode the region
(arn:aws:bedrock:<region>:<account>:...) but the provider ignored it,
falling through to AWS_REGION which may point to a different region.
Extract the region from the ARN when present, taking priority over
environment variables.

Fixes #4860
2026-06-08 17:01:51 -05:00
Armin Ronacher 2edd6b432a Add [Unreleased] section for next cycle 2026-06-08 17:15:54 +02:00
Armin Ronacher c10fb95fd9 Release v0.79.0 2026-06-08 17:15:51 +02:00
Eric Henry 2527441b40 Update generate-models.ts
Removed together.ai MiniMaxAI/MiniMax-M2.5 due to it not being supported for serverless inference.

 Error: 400 Unable to access non-serverless model MiniMaxAI/MiniMax-M2.5. Please visit
 https://api.together.ai/models/MiniMaxAI/MiniMax-M2.5 to create and start a new dedicated endpoint for the model.
2026-06-08 08:32:16 -05:00
Mario Zechner b8f6f660e7 fix(ai): honor OpenAI Responses developer role compat
closes #5456
2026-06-07 11:07:36 +02:00
Mario Zechner b9bfa7ed46 Fix OpenRouter routing compat for custom providers
closes #5347
2026-06-04 23:50:01 +02:00
Mario Zechner ca66adfe60 Add [Unreleased] section for next cycle 2026-06-04 18:31:35 +02:00
Mario Zechner 592c34c056 Release v0.78.1 2026-06-04 18:31:33 +02:00
Mario Zechner e0c2813a2a Audit unreleased changelog entries 2026-06-04 18:22:58 +02:00
Mario Zechner f9ce0bf0e7 Update generated model lists 2026-06-04 18:22:58 +02:00
Mario Zechner 564ad70fb8 Merge pull request #5333 from vastxie/zai-coding-cn-provider
feat(ai): add ZAI Coding Plan China provider
2026-06-03 01:07:01 +02:00
Mattia Cerutti 83afcdc24f fix(ai): remove stale codex models 2026-06-03 00:09:30 +02:00
Armin Ronacher ba6e5298df fix(oauth): harden browser launch handling 2026-06-02 23:15:46 +02:00
弎水 51df39b9b9 feat(ai): add ZAI Coding Plan China provider 2026-06-02 23:39:56 +08:00
Mario Zechner 25a4a8ed1e Add Ant Ling provider 2026-06-02 16:37:44 +02:00
Mario Zechner 7e72ca47c8 Add MiniMax-M3 to direct minimax providers
closes #5313
2026-06-02 16:00:29 +02:00
Mario Zechner 2125221bfc Fix OpenRouter Kimi reasoning compat
closes #5309
2026-06-02 15:36:52 +02:00
Mario Zechner 6e269edfd0 Restore NVIDIA Qwen 3.5 122B model 2026-06-02 15:10:36 +02:00
Mario Zechner 6014801229 Add NVIDIA NIM provider 2026-06-02 15:09:36 +02:00
Mario Zechner 7c08227019 Fix stale model references in AI tests after model regeneration
- Update GitHub Copilot tests to use available models (claude-haiku-4.5, gemini-2.5-pro)
- Update OpenRouter tests to use available models (google/gemini-2.5-flash, deepseek/deepseek-chat)
- Fix over-broad sed that incorrectly renamed OpenAI Responses gpt-4o test
- Remove nvidia.md from repo root
- Update packages/ai/CHANGELOG.md
2026-06-02 11:37:32 +02:00
Mario Zechner 34719d3f4f Fix Bedrock blank text blocks
closes #4975
2026-06-01 18:04:04 +02:00
Mario Zechner f429ddbffd Fix OpenAI GPT-5.5 thinking metadata
closes #5243
2026-06-01 00:39:48 +02:00
Mario Zechner b177333026 Merge pull request #5221 from PriNova/fix/openrouter-system-role
Fix OpenRouter reasoning instruction role
2026-06-01 00:09:58 +02:00
Michael Yu 40832d1957 fix(ai): suppress deprecated temperature param for Claude Opus 4.7+ 2026-05-31 16:20:22 +08:00
PriNova 74d81bd363 Fix OpenAI completions developer role test 2026-05-30 12:24:19 +02:00
PriNova b55fe1bbd4 Fix OpenRouter reasoning instruction role 2026-05-30 11:15:30 +02:00
Mario Zechner dbb9911a54 Add [Unreleased] section for next cycle 2026-05-30 01:47:40 +02:00