@tiens.nguyen/gonext-local-worker 1.0.87 → 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.
@@ -365,7 +369,7 @@ def run_agent_chat(cfg):
365
369
  _log(f"current task (latest user message): {task_text.rsplit('Current task: ', 1)[-1][:240]!r}")
366
370
 
367
371
  # Route: ask the model if this task needs HTTP tool use.
368
- 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)
369
373
 
370
374
  if not needs_agent:
371
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.87",
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",