glm-acp-agent 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Stefan de Vogelaere
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # glm-acp-agent
2
2
 
3
- An [Agent Client Protocol (ACP)](https://agentclientprotocol.com) agent written in TypeScript that uses the **Z.AI / Zhipu AI GLM** model family (GLM-5.2, GLM-5.1, GLM-4.7, …) as its reasoning core.
3
+ An [Agent Client Protocol (ACP)](https://agentclientprotocol.com) agent written in TypeScript that uses the **Z.AI / Zhipu AI GLM** model family (GLM-5.3, GLM-5 Turbo, GLM-4.7) as its reasoning core.
4
4
 
5
5
  The agent connects to any ACP-compatible IDE or client over **stdio**, streams responses back in real time, and can call a rich set of tools to interact with the user's file system, terminal, and the web.
6
6
 
@@ -30,7 +30,7 @@ Built-in web tools use Coding Plan-compatible MCP endpoints, not the general `/a
30
30
  - **Thinking mode** – GLM's `reasoning_content` tokens are surfaced as `agent_thought_chunk` blocks so the client can show the model's chain of thought
31
31
  - **Session permission modes** – supports `default`, `accept_edits`, and `bypass_permissions` via `session/set_mode`. Clients like DevFlow can use this to toggle between prompting for every edit, auto-approving edits while prompting for commands, or bypassing permissions entirely.
32
32
  - **Per-session model switching** – `session/set_model` lets clients change the active GLM model mid-conversation; `session/new` returns the curated `availableModels` list
33
- - **Image input via Coding Plan-native vision or Vision MCP** – `promptCapabilities.image` is advertised; `glm-5v-turbo` sessions send supported image parts directly to the model, while non-native coding models route pasted ACP image blocks through Z.AI Vision MCP (`@z_ai/mcp-server`). Direct chat-image-only models (e.g. `glm-4v-plus`) are intentionally not used.
33
+ - **Image input via Coding Plan-native vision or Vision MCP** – `promptCapabilities.image` is advertised; the advertised coding models route pasted ACP image blocks through Z.AI Vision MCP (`@z_ai/mcp-server`), while `glm-5v-turbo` sessions — opt-in via `ACP_GLM_AVAILABLE_MODELS`, since it is no longer on the Coding Plan allowlist — send supported image parts directly to the model. Direct chat-image-only models (e.g. `glm-4v-plus`) are intentionally not used.
34
34
  - **Session persistence** – conversations are written to `~/.local/state/glm-acp-agent/sessions/` and can be reloaded via `session/load`, branched via `session/fork`, or resumed without replay via `session/resume`
35
35
  - **Six built-in tools** (see below)
36
36
  - **Self-sufficient local tools** – file reads/writes, directory listings, and shell commands run in the agent process, so they do not depend on ACP client `fs` or `terminal` capabilities
@@ -139,7 +139,7 @@ The agent reads its configuration from environment variables, plus an optional c
139
139
  | Variable | Required | Default | Description |
140
140
  |----------|----------|---------|-------------|
141
141
  | `Z_AI_API_KEY` | One of env / `--setup` | — | API key for the Z.AI / Zhipu AI service. If unset, the credentials file is consulted. |
142
- | `ACP_GLM_MODEL` | No | `glm-5.2` | Default GLM model for new sessions |
142
+ | `ACP_GLM_MODEL` | No | `glm-5.3` | Default GLM model for new sessions |
143
143
  | `ACP_GLM_AVAILABLE_MODELS` | No | built-in list | Comma-separated list of model ids advertised in `session/set_model` |
144
144
  | `ACP_GLM_BASE_URL` | No | `https://api.z.ai/api/coding/paas/v4` | Override the API base URL |
145
145
  | `ACP_GLM_MAX_TOKENS` | No | `8192` | Cap on `max_tokens` for each completion |
@@ -170,18 +170,17 @@ The agent advertises only the models on the current Z.AI Coding Plan allowlist:
170
170
 
171
171
  | Model | Notes |
172
172
  |-------|-------|
173
- | `glm-5.2` | **Default.** Newest 1M-context coding model; thinking mode auto-enabled |
174
- | `glm-5.1` | Long-horizon coding model; thinking mode auto-enabled |
175
- | `glm-5-turbo` | Faster Coding Plan reasoning model |
176
- | `glm-5v-turbo` | Multimodal Coding Plan model; native image understanding for jpg / jpeg / png inputs |
173
+ | `glm-5.3` | **Default.** Newest 1M-context coding model; thinking mode always on |
174
+ | `glm-5-turbo` | Faster Coding Plan reasoning model; 128K context |
177
175
  | `glm-4.7` | 200K-context reasoning model |
178
- | `glm-4.5-air` | Lightweight, lower-latency model |
179
176
 
180
- `ACP_GLM_AVAILABLE_MODELS` still lets you advertise custom IDs, but custom IDs sit outside the supported Coding Plan list — the Coding Plan endpoint will reject any model code Z.AI hasn't whitelisted (business code `1211`). If you override the model list, include `glm-5v-turbo` yourself to keep it visible in the picker.
177
+ Only models the Coding Plan endpoint serves **under their own name** are advertised. Several ids that used to be listed are now aliases: a request for `glm-5.2` or `glm-5.1` comes back with `"model": "glm-5.3"`, and `glm-4.5-air` comes back as `glm-4.7`. They still work, but advertising them would report a model you are not actually talking to. `glm-5v-turbo` is no longer on the Coding Plan allowlist — selecting it fails with business code `1311` ("subscription plan does not yet include access").
181
178
 
182
- Vision-only chat models (`glm-4v-plus` etc.) are **not** advertised. The multimodal coding model `glm-5v-turbo` is advertised because it is on the Coding Plan and receives supported ACP image blocks directly as native `image_url` content parts. Other advertised models keep using the [Vision MCP](#vision-mcp) path for image analysis.
179
+ `ACP_GLM_AVAILABLE_MODELS` lets you advertise any id you like, including the ones above. Custom ids sit outside the supported Coding Plan list — the endpoint rejects any model code Z.AI hasn't whitelisted (business code `1211`). The native-vision path is unchanged, so if your plan does include `glm-5v-turbo`, add it back with `ACP_GLM_AVAILABLE_MODELS` and image blocks still reach it as native `image_url` content parts.
183
180
 
184
- When the model name matches `glm-4.5`, `glm-4.6`, `glm-4.7`, or the `glm-5` family, the agent enables Z.AI's `thinking: { type: "enabled" }` extension and forwards reasoning tokens to the client as `agent_thought_chunk` blocks. This includes `glm-5v-turbo`. Override with `ACP_GLM_THINKING=false` if you want plain completions only.
181
+ Vision-only chat models (`glm-4v-plus` etc.) are **not** advertised. Every built-in advertised model uses the [Vision MCP](#vision-mcp) path for image analysis; `glm-5v-turbo`, when re-added via the override above, is the one exception and keeps native `image_url` handling.
182
+
183
+ When the model name matches `glm-4.5`, `glm-4.6`, `glm-4.7`, or the `glm-5` family, the agent enables Z.AI's `thinking: { type: "enabled" }` extension and forwards reasoning tokens to the client as `agent_thought_chunk` blocks. This includes `glm-5v-turbo`. `ACP_GLM_THINKING=false` asks for plain completions instead — but note it has no effect on GLM-5.3, which ignores every attempt to turn thinking off (see [Thought level](#thought-level-reasoning-effort) below).
185
184
 
186
185
  #### Thought level (reasoning effort)
187
186
 
@@ -189,12 +188,16 @@ The agent advertises a `thought_level` [SessionConfigOption](https://agentclient
189
188
 
190
189
  | Model | Levels | Mapping to the Z.AI request |
191
190
  |-------|--------|-----------------------------|
192
- | `glm-5.2` | `Off` / `High` / `Max` | `Off` → `thinking: { type: "disabled" }`; `High`/`Max` → `thinking: { type: "enabled" }` + `reasoning_effort: "high"` / `"max"` |
191
+ | `glm-5.3` (and `glm-5.2` / `glm-5.1`, which route to it) | `High` / `Max` | `thinking: { type: "enabled" }` + `reasoning_effort: "high"` / `"max"` |
193
192
  | other thinking-capable models | `Off` / `On` | `Off` → `thinking: { type: "disabled" }`; `On` → `thinking: { type: "enabled" }` |
194
193
 
195
- `reasoning_effort` is a GLM-5.2 extra — other models never receive it. New sessions default to the model's own default effort (`Max` on GLM-5.2, which is also Z.AI's default when the field is omitted), so out-of-the-box behaviour is unchanged. Switching models re-clamps the level (e.g. a `High` selection reverts to `On` when you move off GLM-5.2) and pushes a `config_option_update`. The `ACP_GLM_THINKING` env override still wins: `false` forces thinking off regardless of the selected level. Clients that don't support config options simply ignore the advertised option and get the default behaviour.
194
+ **GLM-5.3 has no `Off` level, because thinking cannot be turned off on it.** The endpoint accepts both `thinking: { type: "disabled" }` and `reasoning_effort: "none"` without error, but keeps emitting reasoning either way — so `ACP_GLM_THINKING=false` is a no-op on GLM-5.3. Use `glm-4.7` if you need non-reasoning completions.
195
+
196
+ `reasoning_effort` only takes effect on the GLM-5.3 family; `glm-5-turbo` and `glm-4.7` accept the field without validating it and answer identically either way, so the agent omits it for them. New sessions default to `Max`, which is also Z.AI's default when the field is omitted, so out-of-the-box behaviour is unchanged. Switching models re-clamps the level (a `High` selection reverts to `On` when you move to GLM-4.7, and an `Off` selection becomes `Max` when you move to GLM-5.3) and pushes a `config_option_update`. Clients that don't support config options simply ignore the advertised option and get the default behaviour.
197
+
198
+ The endpoint validates `reasoning_effort` against `none | minimal | low | medium | high | xhigh | max`; the agent currently exposes only `high` and `max` as thought levels.
196
199
 
197
- `ACP_GLM_PROMPT_IMAGES=false` still hides the image-attachment capability at session startup. With that flag set, users can pick `glm-5v-turbo` for text work but clients should not offer image attachments.
200
+ `ACP_GLM_PROMPT_IMAGES=false` still hides the image-attachment capability at session startup. With that flag set, clients should not offer image attachments at all.
198
201
 
199
202
  ### Vision MCP
200
203
 
@@ -326,7 +329,7 @@ If `Z_AI_API_KEY` is set in the environment **and** a credentials file exists, t
326
329
  2. Open the **agent panel** (use the command palette: `agent panel: toggle focus`).
327
330
  3. In the agent picker, select **glm** — Zed labels external agents by their `agent_servers` key.
328
331
  4. Start a new thread and send a small prompt that exercises a tool, e.g. `Read package.json and tell me the project name.`
329
- 5. You should see streaming text, a `read_file` tool call awaiting permission, and (with a thinking-capable model like `glm-5.2`) reasoning surfaced as a separate thought block.
332
+ 5. You should see streaming text, a `read_file` tool call awaiting permission, and (with a thinking-capable model like `glm-5.3`) reasoning surfaced as a separate thought block.
330
333
 
331
334
  #### 5. Iterating on the agent
332
335
 
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * Environment variables:
10
10
  * Z_AI_API_KEY - API key for the Z.AI / Zhipu AI service. If unset,
11
11
  * falls back to the credentials file written by --setup.
12
- * ACP_GLM_MODEL - (optional) Override the default model (default: glm-5.2)
12
+ * ACP_GLM_MODEL - (optional) Override the default model (default: glm-5.3)
13
13
  */
14
14
  import { startConnection } from "./protocol/connection.js";
15
15
  import { runSetup } from "./setup.js";
@@ -34,7 +34,7 @@ else if (args.includes("--help") || args.includes("-h")) {
34
34
  "",
35
35
  "Environment variables:",
36
36
  " Z_AI_API_KEY API key (overrides the stored credentials)",
37
- " ACP_GLM_MODEL Default model id (e.g. glm-5.2)",
37
+ " ACP_GLM_MODEL Default model id (e.g. glm-5.3)",
38
38
  " ACP_GLM_AVAILABLE_MODELS Comma-separated list of advertised models",
39
39
  " ACP_GLM_BASE_URL Override the Z.AI API base URL",
40
40
  " ACP_GLM_MAX_TOKENS Per-call max output tokens (default 8192)",
@@ -6,9 +6,9 @@ import { type ToolDefinition } from "../tools/definitions.js";
6
6
  * SessionConfigOption. These map onto Z.AI's `thinking` / `reasoning_effort`
7
7
  * request parameters (see {@link buildThinkingParams}).
8
8
  *
9
- * GLM-5.2 supports three levels: `none`, `high`, `max`. Other thinking-capable
10
- * models (GLM-5.1, 5-turbo, 4.7, …) only distinguish thinking on vs. off, so
11
- * they use `none` and `on`.
9
+ * GLM-5.3 (and GLM-5.2, which the Coding Plan endpoint serves with 5.3)
10
+ * supports `high` and `max`. Other thinking-capable models (5-turbo, 4.7, …)
11
+ * only distinguish thinking on vs. off, so they use `none` and `on`.
12
12
  */
13
13
  export type ThoughtLevel = "none" | "on" | "high" | "max";
14
14
  /** Type guard: whether an arbitrary string is a known ThoughtLevel. */
@@ -16,15 +16,16 @@ export declare function isThoughtLevel(value: string): value is ThoughtLevel;
16
16
  /**
17
17
  * Resolve which thought-level options a model supports.
18
18
  *
19
- * `reasoning_effort` is a GLM-5.2 exclusive per the Z.AI docs — other models
20
- * accept the field but it has no effect, so we only expose high/max for 5.2.
19
+ * Only the GLM-5.3 family honours `reasoning_effort`; on `glm-5-turbo` and
20
+ * `glm-4.7` the endpoint accepts the field without validating it and the
21
+ * response depth does not change, so those models only get on/off.
21
22
  */
22
23
  export declare function getThoughtLevels(model: string): ThoughtLevel[];
23
24
  /**
24
25
  * Resolve a stored ThoughtLevel to one that's valid for the given model.
25
26
  * Used when switching models or restoring a persisted session: if the old
26
27
  * level isn't in the new model's option list, fall back to the model's
27
- * default (max for 5.2, on for everything else — the last entry in the list).
28
+ * default (max on 5.3, on for everything else — the last entry in the list).
28
29
  */
29
30
  export declare function resolveThoughtLevel(model: string, level: ThoughtLevel): ThoughtLevel;
30
31
  /**
@@ -62,7 +63,7 @@ export interface StreamChatOptions {
62
63
  reasoningEffort?: ThoughtLevel;
63
64
  }
64
65
  /** Default GLM model when neither client nor user has chosen one. */
65
- export declare const DEFAULT_MODEL = "glm-5.2";
66
+ export declare const DEFAULT_MODEL = "glm-5.3";
66
67
  /**
67
68
  * Z.AI / Zhipu AI error code returned when the total prompt length (messages +
68
69
  * tools) exceeds the model's context window.
@@ -107,14 +108,21 @@ export declare class GlmClient {
107
108
  *
108
109
  * Z.AI exposes two parameters:
109
110
  * - `thinking` — an on/off gate: `{"type":"enabled"}` or `{"type":"disabled"}`
110
- * - `reasoning_effort` — GLM-5.2 only; controls thinking depth (`high`/`max`,
111
- * defaulting to `max` when omitted).
111
+ * - `reasoning_effort` — controls thinking depth. The endpoint validates it
112
+ * against `none | minimal | low | medium | high | xhigh | max` (an invalid
113
+ * value returns business code 1210) but only the GLM-5.3 family acts on it.
112
114
  *
113
115
  * {@link ThoughtLevel} values map as follows:
114
116
  * - `none` → thinking disabled
115
117
  * - `on` → thinking enabled (no reasoning_effort)
116
- * - `high` → thinking enabled + reasoning_effort=high (5.2 only)
117
- * - `max` → thinking enabled + reasoning_effort=max (5.2 only)
118
+ * - `high` → thinking enabled + reasoning_effort=high (5.3 family only)
119
+ * - `max` → thinking enabled + reasoning_effort=max (5.3 family only)
120
+ *
121
+ * Caveat: GLM-5.3 ignores every attempt to turn thinking off — it keeps
122
+ * emitting `reasoning_content` for `thinking: { type: "disabled" }` and for
123
+ * `reasoning_effort: "none"` alike. `none` is therefore not offered as a level
124
+ * for those models (see {@link getThoughtLevels}), and the `ACP_GLM_THINKING=false`
125
+ * override below is a no-op there even though the request is still sent.
118
126
  *
119
127
  * The `ACP_GLM_THINKING` env override still wins: `false` forces thinking off,
120
128
  * `true` forces it on (ignoring a `none` level). When `effort` is unset the
@@ -1 +1 @@
1
- {"version":3,"file":"glm-client.d.ts","sourceRoot":"","sources":["../../src/llm/glm-client.ts"],"names":[],"mappings":"AACA,OAAO,KA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gB,eAAe,IAAI,MAAM,CAExC;AAED;;;;;;;GAOG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAS;;IAgB1B;;;;;;OAMG;IACI,UAAU,CACf,QAAQ,EAAE,UAAU,EAAE,EACtB,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,cAAc,CAAC,cAAc,CAAC;CA0IlC;AA+BD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,YAAY,GACpB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiCzB"}
@@ -2,13 +2,30 @@ import OpenAI from "openai";
2
2
  import { TOOL_DEFINITIONS } from "../tools/definitions.js";
3
3
  import { resolveApiKey } from "./credentials.js";
4
4
  import { debug, error } from "./logger.js";
5
- /** Levels shown when the selected model is GLM-5.2. */
6
- const LEVELS_52 = ["none", "high", "max"];
5
+ /**
6
+ * Levels shown for the models that honour `reasoning_effort`.
7
+ *
8
+ * Deliberately has no `none`: probing the Coding Plan endpoint on 2026-08-15
9
+ * showed GLM-5.3 keeps emitting `reasoning_content` whether you send
10
+ * `thinking: { type: "disabled" }` or `reasoning_effort: "none"`, so an "Off"
11
+ * option would advertise something the model does not do.
12
+ */
13
+ const LEVELS_REASONING_EFFORT = ["high", "max"];
7
14
  /** Levels shown for every other thinking-capable model. */
8
15
  const LEVELS_DEFAULT = ["none", "on"];
9
- /** Whether a model id is in the GLM-5.2 family (case-insensitive). */
10
- function isGlm52(model) {
11
- return model.toLowerCase().startsWith("glm-5.2");
16
+ /**
17
+ * Whether a model id is one the Coding Plan endpoint serves with GLM-5.3 —
18
+ * the models that validate and honour `reasoning_effort` (case-insensitive).
19
+ *
20
+ * `glm-5.2` and `glm-5.1` are included because the endpoint routes both to 5.3
21
+ * (confirmed by probe: either request comes back with `"model": "glm-5.3"`).
22
+ * They are no longer advertised, but a user can still reach them through
23
+ * `ACP_GLM_AVAILABLE_MODELS` or a persisted session — and when they do, the
24
+ * levels must describe the model that actually answers.
25
+ */
26
+ function isReasoningEffortModel(model) {
27
+ const id = model.toLowerCase();
28
+ return id.startsWith("glm-5.3") || id.startsWith("glm-5.2") || id.startsWith("glm-5.1");
12
29
  }
13
30
  /** The complete set of thought levels the agent understands. */
14
31
  const ALL_THOUGHT_LEVELS = ["none", "on", "high", "max"];
@@ -19,17 +36,18 @@ export function isThoughtLevel(value) {
19
36
  /**
20
37
  * Resolve which thought-level options a model supports.
21
38
  *
22
- * `reasoning_effort` is a GLM-5.2 exclusive per the Z.AI docs — other models
23
- * accept the field but it has no effect, so we only expose high/max for 5.2.
39
+ * Only the GLM-5.3 family honours `reasoning_effort`; on `glm-5-turbo` and
40
+ * `glm-4.7` the endpoint accepts the field without validating it and the
41
+ * response depth does not change, so those models only get on/off.
24
42
  */
25
43
  export function getThoughtLevels(model) {
26
- return isGlm52(model) ? LEVELS_52 : LEVELS_DEFAULT;
44
+ return isReasoningEffortModel(model) ? LEVELS_REASONING_EFFORT : LEVELS_DEFAULT;
27
45
  }
28
46
  /**
29
47
  * Resolve a stored ThoughtLevel to one that's valid for the given model.
30
48
  * Used when switching models or restoring a persisted session: if the old
31
49
  * level isn't in the new model's option list, fall back to the model's
32
- * default (max for 5.2, on for everything else — the last entry in the list).
50
+ * default (max on 5.3, on for everything else — the last entry in the list).
33
51
  */
34
52
  export function resolveThoughtLevel(model, level) {
35
53
  const valid = getThoughtLevels(model);
@@ -38,7 +56,7 @@ export function resolveThoughtLevel(model, level) {
38
56
  /** Default base URL for the Z.AI / Zhipu OpenAI-compatible API (Coding endpoint). */
39
57
  const DEFAULT_BASE_URL = "https://api.z.ai/api/coding/paas/v4";
40
58
  /** Default GLM model when neither client nor user has chosen one. */
41
- export const DEFAULT_MODEL = "glm-5.2";
59
+ export const DEFAULT_MODEL = "glm-5.3";
42
60
  /**
43
61
  * Curated list of GLM models the agent advertises to ACP clients via
44
62
  * `SessionModelState.availableModels`. Users can override this list via the
@@ -46,38 +64,30 @@ export const DEFAULT_MODEL = "glm-5.2";
46
64
  *
47
65
  * The descriptions are intentionally short — clients render them in compact
48
66
  * model pickers.
67
+ *
68
+ * Only models the Coding Plan endpoint actually serves under their own name
69
+ * are listed. Probing on 2026-08-15 showed `glm-5.2` and `glm-5.1` come back
70
+ * as `glm-5.3`, `glm-4.5-air` comes back as `glm-4.7`, and `glm-5v-turbo` is
71
+ * rejected with business code 1311 ("subscription plan does not yet include
72
+ * access"). Advertising those would report a model the user is not talking to.
73
+ * All of them remain selectable via `ACP_GLM_AVAILABLE_MODELS`.
49
74
  */
50
75
  const BUILTIN_AVAILABLE_MODELS = [
51
76
  {
52
- modelId: "glm-5.2",
53
- name: "GLM-5.2",
77
+ modelId: "glm-5.3",
78
+ name: "GLM-5.3",
54
79
  description: "Newest 1M-context coding model with thinking mode",
55
80
  },
56
- {
57
- modelId: "glm-5.1",
58
- name: "GLM-5.1",
59
- description: "Long-horizon coding model with thinking mode",
60
- },
61
81
  {
62
82
  modelId: "glm-5-turbo",
63
83
  name: "GLM-5 Turbo",
64
84
  description: "Faster Coding Plan reasoning model",
65
85
  },
66
- {
67
- modelId: "glm-5v-turbo",
68
- name: "GLM-5V Turbo",
69
- description: "Multimodal Coding Plan model with native vision",
70
- },
71
86
  {
72
87
  modelId: "glm-4.7",
73
88
  name: "GLM-4.7",
74
89
  description: "200K-context reasoning model",
75
90
  },
76
- {
77
- modelId: "glm-4.5-air",
78
- name: "GLM-4.5 Air",
79
- description: "Lightweight, lower-latency model",
80
- },
81
91
  ];
82
92
  /**
83
93
  * Z.AI / Zhipu AI error code returned when the total prompt length (messages +
@@ -86,14 +96,22 @@ const BUILTIN_AVAILABLE_MODELS = [
86
96
  export const ERR_CONTEXT_OVERFLOW = 1261;
87
97
  /**
88
98
  * Context window sizes (in tokens) for GLM series models.
99
+ *
100
+ * De-listed ids are kept here so `ACP_GLM_AVAILABLE_MODELS` users still get an
101
+ * accurate window, and they report the window of the model that actually
102
+ * answers them rather than their own historical spec.
89
103
  */
90
104
  const MODEL_METADATA = {
91
- "glm-5.2": { contextWindow: 1_000_000 },
92
- "glm-5.1": { contextWindow: 128_000 },
105
+ "glm-5.3": { contextWindow: 1_000_000 },
93
106
  "glm-5-turbo": { contextWindow: 128_000 },
94
- "glm-5v-turbo": { contextWindow: 200_000 },
95
107
  "glm-4.7": { contextWindow: 200_000 },
96
- "glm-4.5-air": { contextWindow: 128_000 },
108
+ // Routed to glm-5.3 by the Coding Plan endpoint.
109
+ "glm-5.2": { contextWindow: 1_000_000 },
110
+ "glm-5.1": { contextWindow: 1_000_000 },
111
+ // Routed to glm-4.7 by the Coding Plan endpoint.
112
+ "glm-4.5-air": { contextWindow: 200_000 },
113
+ // Not Coding Plan accessible, but the native-vision path still supports it.
114
+ "glm-5v-turbo": { contextWindow: 200_000 },
97
115
  };
98
116
  /** Models that accept image content parts directly through chat completions. */
99
117
  const VISION_NATIVE_MODELS = new Set(["glm-5v-turbo"]);
@@ -292,14 +310,21 @@ function thinkingOverride() {
292
310
  *
293
311
  * Z.AI exposes two parameters:
294
312
  * - `thinking` — an on/off gate: `{"type":"enabled"}` or `{"type":"disabled"}`
295
- * - `reasoning_effort` — GLM-5.2 only; controls thinking depth (`high`/`max`,
296
- * defaulting to `max` when omitted).
313
+ * - `reasoning_effort` — controls thinking depth. The endpoint validates it
314
+ * against `none | minimal | low | medium | high | xhigh | max` (an invalid
315
+ * value returns business code 1210) but only the GLM-5.3 family acts on it.
297
316
  *
298
317
  * {@link ThoughtLevel} values map as follows:
299
318
  * - `none` → thinking disabled
300
319
  * - `on` → thinking enabled (no reasoning_effort)
301
- * - `high` → thinking enabled + reasoning_effort=high (5.2 only)
302
- * - `max` → thinking enabled + reasoning_effort=max (5.2 only)
320
+ * - `high` → thinking enabled + reasoning_effort=high (5.3 family only)
321
+ * - `max` → thinking enabled + reasoning_effort=max (5.3 family only)
322
+ *
323
+ * Caveat: GLM-5.3 ignores every attempt to turn thinking off — it keeps
324
+ * emitting `reasoning_content` for `thinking: { type: "disabled" }` and for
325
+ * `reasoning_effort: "none"` alike. `none` is therefore not offered as a level
326
+ * for those models (see {@link getThoughtLevels}), and the `ACP_GLM_THINKING=false`
327
+ * override below is a no-op there even though the request is still sent.
303
328
  *
304
329
  * The `ACP_GLM_THINKING` env override still wins: `false` forces thinking off,
305
330
  * `true` forces it on (ignoring a `none` level). When `effort` is unset the
@@ -325,11 +350,11 @@ export function buildThinkingParams(model, effort) {
325
350
  if (!canThink)
326
351
  return params;
327
352
  params["thinking"] = { type: "enabled" };
328
- // reasoning_effort is only meaningful for GLM-5.2 per the Z.AI docs, and Z.AI
329
- // only accepts the "high"/"max" values there. Other levels ("on", and "none"
330
- // when thinking is force-enabled via the env override) carry no valid
331
- // reasoning_effort, so we omit the field entirely.
332
- if ((effort === "high" || effort === "max") && isGlm52(model)) {
353
+ // reasoning_effort is only meaningful for the GLM-5.3 family — glm-5-turbo
354
+ // and glm-4.7 accept it without validating it and answer identically either
355
+ // way. The remaining levels ("on", and "none" when thinking is force-enabled
356
+ // via the env override) carry no valid effort, so we omit the field.
357
+ if ((effort === "high" || effort === "max") && isReasoningEffortModel(model)) {
333
358
  params["reasoning_effort"] = effort;
334
359
  }
335
360
  return params;
@@ -1 +1 @@
1
- {"version":3,"file":"glm-client.js","sourceRoot":"","sources":["../../src/llm/glm-client.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,gBAAgB,EAAuB,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAa3C,uDAAuD;AACvD,MAAM,SAAS,GAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAE1D,2DAA2D;A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