@tiens.nguyen/gonext-local-worker 1.0.67 → 1.0.69

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.
@@ -244,14 +244,9 @@ def run_agent_chat(cfg):
244
244
  # and always terminate with final_answer() rather than looping forever.
245
245
  tool_hint = (
246
246
  "You have ONE built-in function: `http_request(method, url, headers='', body='')`. "
247
- "It returns a plain STRING like 'HTTP 200\\n{\"key\":\"value\"}' "
248
- "it is NOT a dict, do NOT use response['key'] or response.get().\n"
249
- "To read the JSON body: split on the first newline, then use json.loads():\n"
250
- " import json\n"
251
- " lines = response.split('\\n', 1)\n"
252
- " data = json.loads(lines[1]) if len(lines) > 1 else {}\n"
253
- "Write a 1-2 sentence plain-English summary of the result, "
254
- "then call `final_answer(your_summary)` to stop.\n\n"
247
+ "It returns a STRING with the HTTP status and body. "
248
+ "Call it, then immediately call `final_answer(response)` inside the same code block.\n"
249
+ "Do NOT put final_answer outside the code block.\n\n"
255
250
  )
256
251
  task_with_hint = tool_hint + "Task: " + task_text
257
252
 
@@ -271,9 +266,11 @@ def run_agent_chat(cfg):
271
266
  parsed_headers = json.loads(headers)
272
267
  except Exception: # noqa: BLE001
273
268
  pass
269
+ # Retry once on timeout — gorok tunnels can be flaky on the first attempt.
274
270
  result = _http_request_impl(method, url, parsed_headers, body or None)
275
- # Emit immediately so the thinking area shows the result even when the
276
- # generated code doesn't print() — _REAL_STDOUT bypasses redirect_stdout.
271
+ if result.startswith("Error:"):
272
+ _log(f"http_request retry {method.upper()} {url}")
273
+ result = _http_request_impl(method, url, parsed_headers, body or None)
277
274
  status_line = result.split("\n")[0][:150] if result else "no response"
278
275
  _emit({"type": "step", "text": f"HTTP {method.upper()} {url} → {status_line}"})
279
276
  _log(f"http_request {method.upper()} {url} → {result[:80]}")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiens.nguyen/gonext-local-worker",
3
- "version": "1.0.67",
3
+ "version": "1.0.69",
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",