@tiens.nguyen/gonext-local-worker 1.0.78 → 1.0.79
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/gonext_agent_chat.py +15 -3
- package/package.json +1 -1
package/gonext_agent_chat.py
CHANGED
|
@@ -239,16 +239,28 @@ def run_agent_chat(cfg):
|
|
|
239
239
|
|
|
240
240
|
_log(f"start model={agent_model_id!r} base={agent_base_url!r} maxSteps={max_steps}")
|
|
241
241
|
|
|
242
|
-
#
|
|
242
|
+
# Build task from the conversation history.
|
|
243
|
+
# Include prior USER messages as context so the agent has conversational memory,
|
|
244
|
+
# but exclude prior ASSISTANT messages (they contain raw HTTP/thinking content
|
|
245
|
+
# that confuses small models).
|
|
243
246
|
task_text = ""
|
|
247
|
+
prior_user_msgs = []
|
|
244
248
|
for m in messages:
|
|
245
|
-
|
|
246
|
-
|
|
249
|
+
role = m.get("role", "")
|
|
250
|
+
content = m.get("content", "")
|
|
251
|
+
if role == "user":
|
|
252
|
+
if task_text:
|
|
253
|
+
prior_user_msgs.append(task_text)
|
|
254
|
+
task_text = content
|
|
247
255
|
|
|
248
256
|
if not task_text:
|
|
249
257
|
_emit({"type": "final", "text": "[No user message found in history]"})
|
|
250
258
|
return
|
|
251
259
|
|
|
260
|
+
if prior_user_msgs:
|
|
261
|
+
context = "\n".join(f"- {t[:300]}" for t in prior_user_msgs[-4:])
|
|
262
|
+
task_text = f"Conversation context (previous user messages):\n{context}\n\nCurrent task: {task_text}"
|
|
263
|
+
|
|
252
264
|
_log(f"task={task_text[:120]!r}")
|
|
253
265
|
|
|
254
266
|
# Route: ask the model if this task needs HTTP tool use.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiens.nguyen/gonext-local-worker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.79",
|
|
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",
|