zames_pro 2.82.78 → 2.82.80

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/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.82.80] - 2026-10-24
11
+
12
+ ### Fixed
13
+
14
+ - **history:** trim the role before comparing it (all three providers)
15
+
16
+ ## [2.82.79] - 2026-10-24
17
+
18
+ ### Fixed
19
+
20
+ - **glm:** keep a duplicated chat id once in the chat list
21
+
10
22
  ## [2.82.78] - 2026-10-24
11
23
 
12
24
  ### Fixed
@@ -42,7 +42,11 @@ export function parseHistoryMessages(messages) {
42
42
  // old `role === 'ASSISTANT'` fallback read every other turn as the
43
43
  // operator's, so a lowercase assistant answer was printed as the operator's
44
44
  // text in the restored dialogue.
45
- const rawRole = String((raw && raw.role) || '').toUpperCase();
45
+ // Trim BEFORE upper-casing: a padded field (`" USER "`, `"assistant\\t"`)
46
+ // used to fail the comparison and the whole turn was dropped.
47
+ const rawRole = String((raw && raw.role) || '')
48
+ .trim()
49
+ .toUpperCase();
46
50
  if (rawRole !== 'ASSISTANT' && rawRole !== 'USER')
47
51
  continue;
48
52
  const role = rawRole === 'ASSISTANT' ? 'assistant' : 'user';
package/dist/glm-chats.js CHANGED
@@ -111,6 +111,9 @@ export function parseGlmChatList(json) {
111
111
  ? arr.map((c) => ['', c])
112
112
  : keyed;
113
113
  const out = [];
114
+ // A payload may list the SAME chat twice (a merged page). /chats would then
115
+ // show it twice and the second row opens the same chat — keep the first.
116
+ const seenIds = new Set();
114
117
  for (const [key, c] of entries) {
115
118
  if (!c || typeof c !== 'object')
116
119
  continue;
@@ -121,8 +124,9 @@ export function parseGlmChatList(json) {
121
124
  : typeof raw === 'number' && Number.isFinite(raw)
122
125
  ? String(raw)
123
126
  : key;
124
- if (!id)
127
+ if (!id || seenIds.has(id))
125
128
  continue;
129
+ seenIds.add(id);
126
130
  const title = (typeof m.title === 'string' && m.title) ||
127
131
  (typeof m.name === 'string' && m.name) ||
128
132
  '';
@@ -195,7 +199,12 @@ export function parseGlmHistory(json) {
195
199
  // values the API actually uses are matched: a numeric flag or a `from`
196
200
  // field was never observed on z.ai and guessing at it would silently
197
201
  // re-attribute turns.
198
- const roleStr = String(m.role ?? '').toLowerCase();
202
+ // Trim BEFORE lower-casing: a padded role (" USER ") used to fall
203
+ // through to the ASSISTANT default, printing the operator's own question
204
+ // as the model's answer.
205
+ const roleStr = String(m.role ?? '')
206
+ .trim()
207
+ .toLowerCase();
199
208
  // A SYSTEM/TOOL turn is neither the operator nor the model's answer: z.ai's
200
209
  // own system prompt and the sandbox output of its agent runtime used to be
201
210
  // restored as model REPLIES (the Qwen parser drops those roles too).
@@ -243,7 +243,12 @@ export function parseQwenHistory(json) {
243
243
  // cares about the distinction, not the exact enum). A numeric flag uses
244
244
  // 1 = user, 2 = assistant (the `String(1) === '1'` form was ignored and
245
245
  // every user turn was attributed to the model).
246
- const roleStr = String(m.role ?? '').toLowerCase();
246
+ // Trim BEFORE lower-casing: a padded role (" USER ") used to fall
247
+ // through to the ASSISTANT default, printing the operator's own question
248
+ // as the model's answer.
249
+ const roleStr = String(m.role ?? '')
250
+ .trim()
251
+ .toLowerCase();
247
252
  // `from` is matched case-insensitively and accepts Qwen's `human`
248
253
  // spelling: the exact `from === 'user'` test read an uppercase/human
249
254
  // turn as the ASSISTANT's answer, so the operator's own question was
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.82.78",
3
+ "version": "2.82.80",
4
4
  "description": "Terminal coding agent that drives a real browser to chat with DeepSeek, Qwen and other web LLMs — no API key required. Reads and edits files, runs commands, commits to git, like Claude Code / Codex CLI.",
5
5
  "type": "module",
6
6
  "bin": {