@tiens.nguyen/gonext-local-worker 1.0.56 → 1.0.58
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-local-worker.mjs +2 -2
- package/gonext_agent_chat.py +9 -0
- package/package.json +1 -1
package/gonext-local-worker.mjs
CHANGED
|
@@ -1221,7 +1221,7 @@ async function runAgentChatJob(job) {
|
|
|
1221
1221
|
);
|
|
1222
1222
|
// Send an immediate heartbeat so the web 60-180s no-progress timer doesn't
|
|
1223
1223
|
// fire while the local model is loading/generating its first reasoning step.
|
|
1224
|
-
enqueueText("<think>Agent starting…\n");
|
|
1224
|
+
enqueueText("<think>Agent starting…\n\n");
|
|
1225
1225
|
flushTail = flushTail.then(() => flushChunks()).catch((err) => {
|
|
1226
1226
|
console.error("[gonext-worker] agent_chat heartbeat flush error:", err);
|
|
1227
1227
|
});
|
|
@@ -1252,7 +1252,7 @@ async function runAgentChatJob(job) {
|
|
|
1252
1252
|
inThink = true;
|
|
1253
1253
|
enqueueText("<think>");
|
|
1254
1254
|
}
|
|
1255
|
-
enqueueText(event.text + "\n");
|
|
1255
|
+
enqueueText(event.text + "\n\n");
|
|
1256
1256
|
} else if (event.type === "final" && typeof event.text === "string") {
|
|
1257
1257
|
if (inThink) {
|
|
1258
1258
|
inThink = false;
|
package/gonext_agent_chat.py
CHANGED
|
@@ -178,6 +178,10 @@ def run_agent_chat(cfg):
|
|
|
178
178
|
except Exception: # noqa: BLE001
|
|
179
179
|
pass
|
|
180
180
|
result = _http_request_impl(method, url, parsed_headers, body or None)
|
|
181
|
+
# Emit immediately so the thinking area shows the result even when the
|
|
182
|
+
# generated code doesn't print() — _REAL_STDOUT bypasses redirect_stdout.
|
|
183
|
+
status_line = result.split("\n")[0][:150] if result else "no response"
|
|
184
|
+
_emit({"type": "step", "text": f"HTTP {method.upper()} {url} → {status_line}"})
|
|
181
185
|
_log(f"http_request {method.upper()} {url} → {result[:80]}")
|
|
182
186
|
return result
|
|
183
187
|
|
|
@@ -186,6 +190,11 @@ def run_agent_chat(cfg):
|
|
|
186
190
|
text = _summarise_step(step_log)
|
|
187
191
|
except Exception as e: # noqa: BLE001
|
|
188
192
|
text = f"Step: {e}"
|
|
193
|
+
# Skip emitting if there's nothing beyond the tool name — the tool already
|
|
194
|
+
# emitted its own step event with the actual response above.
|
|
195
|
+
if not text or text.rstrip().endswith("| →"):
|
|
196
|
+
_log(f"step (empty obs, skipped): {text[:80]}")
|
|
197
|
+
return
|
|
189
198
|
_log(f"step: {text[:200]}")
|
|
190
199
|
_emit({"type": "step", "text": text})
|
|
191
200
|
|
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.58",
|
|
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",
|