Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/ai/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@

### Fixed

- Preserve GLM-5.3 Flash and Highspeed reasoning effort mappings and Z.AI thinking serialization.
- Coalesced adjacent Anthropic user and tool-result turns without changing standalone string user-message content.
- Anthropic prompt caching now retains the previous checkpoint while tool loops append a new result, avoiding repeated prefix reprocessing for API-key and OAuth requests.


### Removed

## [2026.8.29] - 2026-08-29
Expand Down
61 changes: 60 additions & 1 deletion packages/ai/changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
# changes.md — ai

## 2026-08-29 - Narrow GLM-5.3 serializer matching

### What changed

- `src/api/openai-completions.ts`

### Why

- Unsupported GLM-5.3 suffixes must not inherit validated model reasoning controls.

### Why an extension could not handle it

- Z.AI request serialization is implemented inside the AI package provider adapter.

### Expected merge conflict zones

- `src/api/openai-completions.ts`

## 2026-08-29 - Preserve GLM-5.3 variant reasoning controls

### What changed

- `packages/ai/scripts/generate-models.ts`: recognize `glm-5.3` Flash and Highspeed variants as part of the Z.AI GLM-5.3 family so generated metadata retains low/high/max reasoning effort mappings and wire support.
- `packages/ai/src/api/openai-completions.ts`; `src/api/openai-completions.ts`: Z.AI GLM-5.3 thinking serialization.
- src/api/openai-completions.ts
- `src/api/openai-completions.ts`: Z.AI GLM-5.3 thinking serialization.

### Why

- Without family matching, explicit reasoning effort selections were dropped for the Flash and Highspeed models and their model controls exposed incorrect levels.

### Why an extension could not handle it

- Model-family metadata and request serialization are built into the AI package generator and provider adapter before extension code can intervene.

### Expected merge conflict zones

- `packages/ai/scripts/generate-models.ts`: Z.AI model-family detection and generated capability metadata.
- `packages/ai/src/api/openai-completions.ts`; `src/api/openai-completions.ts`: Z.AI GLM-5.3 thinking serialization.
- src/api/openai-completions.ts

## 2026-08-29 - Z.AI GLM-5.3 request and catalog fixes

### What changed

- `src/api/openai-completions.ts`: narrow GLM-5.3 thinking serialization to validated variants.
- GLM-5.3 reasoning-off requests now use the provider's lowest enabled effort instead of sending the rejected disabled-thinking payload; regenerated Z.AI catalogs retain the separate global and China sources and published model metadata.

### Why

- Unsupported GLM-5.3 suffixes must not inherit validated model reasoning controls.

### Why an extension could not handle it

- Z.AI request serialization is implemented inside the AI package provider adapter.

### Expected merge conflict zones

- `src/api/openai-completions.ts`.

## Anthropic cache checkpoints across tool loops (2026-08-29)

### What changed
Expand All @@ -17,7 +77,6 @@
### Expected merge conflict zones

- MEDIUM: `src/api/anthropic-messages.ts` message coalescing and final cache-marker pass.

## Credential pool export wildcard (2026-08-27)

### What changed
Expand Down
2 changes: 1 addition & 1 deletion packages/ai/scripts/generate-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
const supportsImage = m.modalities?.input?.includes("image");

const isGlm52 = modelId === "glm-5.2" || modelId === "glm-5.2-highspeed";
const isGlm5x = isGlm52 || modelId === "glm-5.3";
const isGlm5x = isGlm52 || /^(?:glm-5\.3)(?:-(?:flash|highspeed))?$/.test(modelId);
const referenceCost = modelId === "glm-5.2-highspeed" ? undefined : data.zai?.models[modelId]?.cost ?? m.cost;

models.push({
Expand Down
2 changes: 1 addition & 1 deletion packages/ai/src/api/openai-completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ function buildParams(
const thinkingBudget = resolveClampedThinkingBudget(model, options, params);

if (compat.thinkingFormat === "zai" && model.reasoning) {
const isGlm53 = /(?:^|[/:-])glm-5\.3(?:$|[/.:_-])/.test(model.id.toLowerCase());
const isGlm53 = /(?:^|[/:-])glm-5\.3(?:-(?:flash|highspeed))?(?:$|[/.:_])/.test(model.id.toLowerCase());
const zaiParams = params as Omit<typeof params, "reasoning_effort"> & {
thinking?: { type: "enabled" | "disabled"; clear_thinking?: boolean };
reasoning_effort?: string;
Expand Down
20 changes: 20 additions & 0 deletions packages/ai/src/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,26 @@ The divergence lives in core wiring, package identity, or build plumbing that ex

## Unreleased

## 2026-08-29 - Cover GLM-5.3 generator negative variants

### What changed

- `packages/ai/src/api/openai-completions.ts`: narrowed the Z.AI always-enabled matcher to the exact `glm-5.3`, `glm-5.3-flash`, and `glm-5.3-highspeed` variants so unsupported variants are not forced into thinking.
- `scripts/generate-models.ts`: generated Z.AI records for unsupported GLM-5.3 variants omit `thinkingLevelMap` and `compat.supportsReasoningEffort`.
- `test/generate-models-strict.test.ts`: added an offline generator fixture covering `glm-5.3-turbo`, `glm-5.3-xl`, and `glm-5.3-anything-else`.

### Why

- Unsupported GLM-5.3 variants must not receive reasoning metadata or be forced into enabled thinking; only the validated base, Flash, and Highspeed variants should use the always-enabled Z.AI thinking path.

### Why an extension could not handle it

- Generated model capability metadata and OpenAI Completions request serialization are implemented inside the AI package.

### Expected merge conflict zones

- LOW: `api/openai-completions.ts` and the GLM-5.3 generator regression coverage.

## 2026-08-26 - Coalesce adjacent Anthropic user turns

### What changed
Expand Down
2 changes: 1 addition & 1 deletion packages/ai/src/providers/data/.manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"schemaVersion":3,"generatedAt":"2026-08-29T04:42:44.820Z","structureHash":"3c455a74fcf9a66fed76da0baeafab7eec982373b540beefb9d588b18318c185","files":{"alibaba-token-plan.json":"9f9e8f88b1faa2e4134a0d8bcda600531d4d044d64b7ec3d2373f1db46dcf452","amazon-bedrock.json":"eb1770cb9edee5efb9646da27043a83cc80fa5e186dce60fcafa681222b794c2","ant-ling.json":"4979fe79d99ed97382d7ce40170c6132e932e77906de1eb54464c042e7d63633","anthropic.json":"8c1136a83a3b1ff0e61ab461ee221b1de7680784e774a60e1520af14a44bb0f1","azure-openai-responses.json":"37d12c5cbfc29bfd9a802a0516f5d3209320bd4aa8ef9cd7c219af208244afa3","baseten.json":"e4d1ec84e8180a53e21c1511b8d78e497784515c33ba8397382ac3450c8b126e","cerebras.json":"38272a7525d6680c71bb4bb3c4085e871768b400832e2013b0e7fd92f8fd4f05","cloudflare-ai-gateway.json":"38d37fefcc6437904f42437881e782d31a79982942c25a48cb8fe9a255afbaa2","cloudflare-workers-ai.json":"0ed67191adec10707a8ce1ed2c99a949dd06ec537de15d6b57e830575d248b86","deepseek.json":"e3106724723fd82d48a3ff685da9908a3a7b7b4fd84cc3cfe97a6a23067b6029","fireworks.json":"21dbcb60719ae099beda44a8fe03dc725b00bf3767c32bd1027d288061d30ffe","github-copilot.json":"61dec9e46df61a9b0bf6c7618651f97bfa9ae609d4c216b5725f014942ca3001","google-vertex.json":"fb7586fc955da7b7d7d11d641954f496fbbb42cf3e4cbba66d7116ea3b37d5ed","google.json":"b5572904165d37ab594eafc3ab7f29774e35747b5dd211144ec01532db9217c1","groq.json":"f1eb899453e70b5e4479fe6eb78869ee99121fa6d4a019a5a05ab42d2ada8992","huggingface.json":"7616a851e53d254e375b760abe2b6148e8961a102bd5c7af31829a0f2dc8e5c5","kimi-coding.json":"88150f8970f83e17968b02f3b33fac803b96ebf1474e76437689b7d0f1b69363","minimax-cn.json":"65d37e55a6d9585855f94b3fb7739308d107fe248ebd9e1001d1c5d4606ad2c4","minimax.json":"c7dc5765995ae77242916430929c7cc9a782589f7e483e13f7e01663190d028e","mistral.json":"e3a109306644bf2f2fa38fece50b2d3ce1dbe3b87b1f1b9e2d70cce7eb5c0ea1","moonshotai-cn.json":"dbf1b71ee36812fe64b014177ff455809a8dd852bbbd584422645beb85635127","moonshotai.json":"2d7518b4769e97ac900366175c8b60ff86a02675bb6f6cc2fffcc6761fda6faa","nvidia.json":"62fa810bece1c90454b481db5a3ff78bc66dc28dab9c65a655397eb1dfe2de73","openai-codex.json":"4e4afe2929b2b20a751f2453b219deae4e5b9fd85e147bd0403601f183cfc15f","openai.json":"b014fb0676fec97264eb13b367b0ed73b99915f45410a3dd9a7397a0360c2a4b","opencode-go.json":"1b707b5fdaf0bbe9b436a2fa662b9ade1f1c7db0ffc0631916428547483acaac","opencode.json":"ab2bf29b6c0b097c9dca13faab7515365787da523e6e942b49002a2612b99d26","opengateway.json":"1702a5df9877110c4d71a6ff3760cd10b378bfbd32d6322c05ce59dc1cc0f8e4","openrouter.json":"569ee081f6d5e995a23f5bb5b900f872ba8479b61a95faf02c38a8410b71a21b","qwen-token-plan-cn.json":"e62dde34edb603376a1dc60b2a74a9c2605b9e81d81df55cc259796c45aa4793","qwen-token-plan-individual.json":"5649fd4075ada766ec65a7a162cd65f096a7ecc29960ace04b2e6a6a4a995a41","qwen-token-plan.json":"fe914313157ff41ab2f71977f0fdcfedb3a8a205d1092e3180f6799e5d7942fd","together.json":"c2b03c476d6b4d4059ed18a80f34d274c754dc84fe2591ae79fe2986512f2a51","vercel-ai-gateway.json":"df4810da53726a9465ec6ddb6c5ec6d66955552f6ca7aa5d01f18f3ffe02cbe7","xai.json":"9973aae022723732b8a7ea12107e6fb8b3f1d0e087ec6bbc2ee18f0820595e19","xiaomi-token-plan-ams.json":"568b9992cf320536a65826e26a414afa5c0d17f083a01af4bd96658d9dd3e705","xiaomi-token-plan-cn.json":"c423857d0bbb0b126394eaf1ebb2a91bf2d1193cc5a4fe77843ff0f4536a0a80","xiaomi-token-plan-sgp.json":"008f1eb41037e93c5ae478f12815cd67bac1978f131ffefa602775bb60b63fea","xiaomi.json":"37acf451bb4364bdca2ecea6b7d962590d9974a87e80cfe34bb800be6a95c13b","zai-coding-cn.json":"b3fe0a69833cb573ee73fa4ed3f620732b3193fc32f5433d2fa9971c2f5ce299","zai.json":"6634870e983bdae76dddbf2e721e972fbc4b5974467b4b99edaab5bd9c1c1e3f"}}
{"schemaVersion":3,"generatedAt":"2026-08-29T12:46:36.807Z","structureHash":"3c455a74fcf9a66fed76da0baeafab7eec982373b540beefb9d588b18318c185","files":{"alibaba-token-plan.json":"9f9e8f88b1faa2e4134a0d8bcda600531d4d044d64b7ec3d2373f1db46dcf452","amazon-bedrock.json":"eb1770cb9edee5efb9646da27043a83cc80fa5e186dce60fcafa681222b794c2","ant-ling.json":"4979fe79d99ed97382d7ce40170c6132e932e77906de1eb54464c042e7d63633","anthropic.json":"8c1136a83a3b1ff0e61ab461ee221b1de7680784e774a60e1520af14a44bb0f1","azure-openai-responses.json":"37d12c5cbfc29bfd9a802a0516f5d3209320bd4aa8ef9cd7c219af208244afa3","baseten.json":"e4d1ec84e8180a53e21c1511b8d78e497784515c33ba8397382ac3450c8b126e","cerebras.json":"38272a7525d6680c71bb4bb3c4085e871768b400832e2013b0e7fd92f8fd4f05","cloudflare-ai-gateway.json":"38d37fefcc6437904f42437881e782d31a79982942c25a48cb8fe9a255afbaa2","cloudflare-workers-ai.json":"0ed67191adec10707a8ce1ed2c99a949dd06ec537de15d6b57e830575d248b86","deepseek.json":"e3106724723fd82d48a3ff685da9908a3a7b7b4fd84cc3cfe97a6a23067b6029","fireworks.json":"21dbcb60719ae099beda44a8fe03dc725b00bf3767c32bd1027d288061d30ffe","github-copilot.json":"61dec9e46df61a9b0bf6c7618651f97bfa9ae609d4c216b5725f014942ca3001","google-vertex.json":"fb7586fc955da7b7d7d11d641954f496fbbb42cf3e4cbba66d7116ea3b37d5ed","google.json":"b5572904165d37ab594eafc3ab7f29774e35747b5dd211144ec01532db9217c1","groq.json":"f1eb899453e70b5e4479fe6eb78869ee99121fa6d4a019a5a05ab42d2ada8992","huggingface.json":"7616a851e53d254e375b760abe2b6148e8961a102bd5c7af31829a0f2dc8e5c5","kimi-coding.json":"88150f8970f83e17968b02f3b33fac803b96ebf1474e76437689b7d0f1b69363","minimax-cn.json":"65d37e55a6d9585855f94b3fb7739308d107fe248ebd9e1001d1c5d4606ad2c4","minimax.json":"c7dc5765995ae77242916430929c7cc9a782589f7e483e13f7e01663190d028e","mistral.json":"e3a109306644bf2f2fa38fece50b2d3ce1dbe3b87b1f1b9e2d70cce7eb5c0ea1","moonshotai-cn.json":"dbf1b71ee36812fe64b014177ff455809a8dd852bbbd584422645beb85635127","moonshotai.json":"2d7518b4769e97ac900366175c8b60ff86a02675bb6f6cc2fffcc6761fda6faa","nvidia.json":"62fa810bece1c90454b481db5a3ff78bc66dc28dab9c65a655397eb1dfe2de73","openai-codex.json":"4e4afe2929b2b20a751f2453b219deae4e5b9fd85e147bd0403601f183cfc15f","openai.json":"b014fb0676fec97264eb13b367b0ed73b99915f45410a3dd9a7397a0360c2a4b","opencode-go.json":"1b707b5fdaf0bbe9b436a2fa662b9ade1f1c7db0ffc0631916428547483acaac","opencode.json":"ab2bf29b6c0b097c9dca13faab7515365787da523e6e942b49002a2612b99d26","opengateway.json":"1702a5df9877110c4d71a6ff3760cd10b378bfbd32d6322c05ce59dc1cc0f8e4","openrouter.json":"065d4eb3817363dc217cc9bea7130a0cf30c0ad934819b63a5a4c29ef9919943","qwen-token-plan-cn.json":"e62dde34edb603376a1dc60b2a74a9c2605b9e81d81df55cc259796c45aa4793","qwen-token-plan-individual.json":"5649fd4075ada766ec65a7a162cd65f096a7ecc29960ace04b2e6a6a4a995a41","qwen-token-plan.json":"fe914313157ff41ab2f71977f0fdcfedb3a8a205d1092e3180f6799e5d7942fd","together.json":"c2b03c476d6b4d4059ed18a80f34d274c754dc84fe2591ae79fe2986512f2a51","vercel-ai-gateway.json":"df4810da53726a9465ec6ddb6c5ec6d66955552f6ca7aa5d01f18f3ffe02cbe7","xai.json":"9973aae022723732b8a7ea12107e6fb8b3f1d0e087ec6bbc2ee18f0820595e19","xiaomi-token-plan-ams.json":"568b9992cf320536a65826e26a414afa5c0d17f083a01af4bd96658d9dd3e705","xiaomi-token-plan-cn.json":"c423857d0bbb0b126394eaf1ebb2a91bf2d1193cc5a4fe77843ff0f4536a0a80","xiaomi-token-plan-sgp.json":"008f1eb41037e93c5ae478f12815cd67bac1978f131ffefa602775bb60b63fea","xiaomi.json":"37acf451bb4364bdca2ecea6b7d962590d9974a87e80cfe34bb800be6a95c13b","zai-coding-cn.json":"d3c969020a7ab978497837a3301c7bca364d704082832221cfe61e6596333e56","zai.json":"f42790c77fb4681a656897a9d860b939916c0ddf979a5f16856bce9573cdf64e"}}
2 changes: 1 addition & 1 deletion packages/ai/src/providers/data/openrouter.json

Large diffs are not rendered by default.

Loading
Loading