@tiens.nguyen/gonext-local-worker 1.0.86 → 1.0.88

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.
@@ -330,6 +330,10 @@ def run_agent_chat(cfg):
330
330
  _emit({"type": "final", "text": "[No user message found in history]"})
331
331
  return
332
332
  task_text = (messages[last_user_idx].get("content") or "").strip()
333
+ # Routing must look at the CURRENT message alone — not the history-laden blob
334
+ # below. Otherwise the keyword router matches URLs/"api"/"GET" from prior turns
335
+ # and fires the agent on trivial replies like "thanks" or "good".
336
+ latest_user_text = task_text
333
337
 
334
338
  # Walk prior turns newest-first, keeping condensed lines until the budget is
335
339
  # spent, then restore chronological (oldest→newest) order.
@@ -358,12 +362,14 @@ def run_agent_chat(cfg):
358
362
 
359
363
  _log(
360
364
  f"history: {len(history_lines)} prior turn(s), {used} chars "
361
- f"(budget {HISTORY_CHAR_BUDGET})"
365
+ f"(budget {HISTORY_CHAR_BUDGET}) — exact turns sent to the agent below:"
362
366
  )
363
- _log(f"task={task_text[:120]!r}")
367
+ for j, ln in enumerate(history_lines):
368
+ _log(f" history[{j}]: {ln[:240]}")
369
+ _log(f"current task (latest user message): {task_text.rsplit('Current task: ', 1)[-1][:240]!r}")
364
370
 
365
371
  # Route: ask the model if this task needs HTTP tool use.
366
- needs_agent = _route(task_text, agent_base_url, agent_api_key, agent_model_id)
372
+ needs_agent = _route(latest_user_text, agent_base_url, agent_api_key, agent_model_id)
367
373
 
368
374
  if not needs_agent:
369
375
  _log("router: plain chat (no HTTP needed)")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiens.nguyen/gonext-local-worker",
3
- "version": "1.0.86",
3
+ "version": "1.0.88",
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",