@tiens.nguyen/gonext-local-worker 1.0.150 → 1.0.152

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.
@@ -436,6 +436,19 @@ def _detect_model_id(base_url, api_key=""):
436
436
  return ids[0]
437
437
 
438
438
 
439
+ def _clip(text: str, limit: int = 280) -> str:
440
+ """Trim a one-line preview to ~limit chars WITHOUT cutting mid-word, adding an
441
+ ellipsis so it reads as intentionally shortened instead of broken. Collapses
442
+ internal whitespace/newlines so the panel shows a clean single line."""
443
+ text = " ".join(str(text).split())
444
+ if len(text) <= limit:
445
+ return text
446
+ cut = text[:limit].rsplit(" ", 1)[0].rstrip()
447
+ if not cut: # single very long token — hard cut as a fallback
448
+ cut = text[:limit].rstrip()
449
+ return f"{cut}…"
450
+
451
+
439
452
  def _summarise_step(step_log):
440
453
  """Return a short human-readable description of an agent step."""
441
454
  tool_calls = getattr(step_log, "tool_calls", None) or []
@@ -460,7 +473,7 @@ def _summarise_step(step_log):
460
473
  if l.strip() and not l.strip().startswith("#")),
461
474
  code[:80],
462
475
  )
463
- parts.append(first[:120])
476
+ parts.append(_clip(first, 120))
464
477
  else:
465
478
  if isinstance(args, dict):
466
479
  method = args.get("method", "")
@@ -478,7 +491,7 @@ def _summarise_step(step_log):
478
491
  # and show the first line of actual content.
479
492
  lines = [l for l in obs.splitlines() if l.strip() and l.strip() != "Execution logs:"]
480
493
  if lines:
481
- parts.append(f"→ {lines[0][:200]}")
494
+ parts.append(f"→ {_clip(lines[0])}")
482
495
 
483
496
  if error:
484
497
  err = str(error)
@@ -491,7 +504,7 @@ def _summarise_step(step_log):
491
504
  # "Error: Reached max steps." made a successful run look failed (task #10).
492
505
  parts.append("→ Wrapping up (reached step budget)…")
493
506
  else:
494
- parts.append(f"→ Error: {err[:120]}")
507
+ parts.append(f"→ Error: {_clip(err, 160)}")
495
508
 
496
509
  # No numeric "Step N:" prefix — show only the semantic action.
497
510
  return (" | ".join(parts) if parts else "thinking…")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiens.nguyen/gonext-local-worker",
3
- "version": "1.0.150",
3
+ "version": "1.0.152",
4
4
  "description": "Polls GoNext cloud API for async local LLM jobs and runs them against Ollama/OpenAI-compatible servers on this Mac",
5
5
  "type": "module",
6
6
  "license": "MIT",