zames_pro 2.82.79 → 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,12 @@ 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
+
10
16
  ## [2.82.79] - 2026-10-24
11
17
 
12
18
  ### 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
@@ -199,7 +199,12 @@ export function parseGlmHistory(json) {
199
199
  // values the API actually uses are matched: a numeric flag or a `from`
200
200
  // field was never observed on z.ai and guessing at it would silently
201
201
  // re-attribute turns.
202
- 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();
203
208
  // A SYSTEM/TOOL turn is neither the operator nor the model's answer: z.ai's
204
209
  // own system prompt and the sandbox output of its agent runtime used to be
205
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.79",
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": {