@miller-tech/uap 1.96.4 → 1.96.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miller-tech/uap",
3
- "version": "1.96.4",
3
+ "version": "1.96.6",
4
4
  "description": "Autonomous AI agent memory system with CLAUDE.md protocol enforcement",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -305,6 +305,13 @@ _WRITE_TOOL_CLASS = frozenset({
305
305
  "write", "edit", "multiedit", "notebookedit",
306
306
  "str_replace", "str_replace_editor", "str_replace_based_edit_tool",
307
307
  "create_file", "applypatch", "apply_patch",
308
+ # OpenAI-style tool-loop names (uap deliver's agentic executor and other
309
+ # OpenAI-compat agents). Without these, every agentic round that WRITES
310
+ # files still counted as a no-write turn, the recon-convergence streak
311
+ # grew unbounded, and the proxy injected "stop exploring, synthesize"
312
+ # directives into a loop that was mid-build — observed live at
313
+ # no_write_streak=62 with the model then emitting files as plain text.
314
+ "write_file", "edit_file", "save_file",
308
315
  })
309
316
 
310
317
  PROXY_GUARDRAIL_RETRY = os.environ.get("PROXY_GUARDRAIL_RETRY", "on").lower() not in {
@@ -4269,6 +4276,13 @@ def build_openai_request(
4269
4276
  # retries (observed Shannon: max_tokens=512 + tools=7 -> ~5 retries
4270
4277
  # per turn). Bump up to THINKING_MIN_FOR_TOOLS for these requests.
4271
4278
  THINKING_MIN_FOR_TOOLS = 2048
4279
+ # No-tool turns need thinking headroom too: evaluator calls (acceptance
4280
+ # judge, critic, ideation) request ~4096 max_tokens, Qwen spends all of
4281
+ # it inside <think>, the EMPTY-OUTPUT GUARD promotes truncated
4282
+ # reasoning as the body, and the caller gets an unparseable verdict —
4283
+ # observed live as every acceptance judgment failing. Bump small
4284
+ # no-tool budgets so the model can finish thinking AND answer.
4285
+ THINKING_MIN_NO_TOOLS = int(os.environ.get("PROXY_THINKING_MIN_NO_TOOLS", "8192"))
4272
4286
  if skip_floor:
4273
4287
  requested_max = requested_raw
4274
4288
  # Even when skipping the big floor, bump small tool-turn
@@ -4285,6 +4299,18 @@ def build_openai_request(
4285
4299
  requested_raw,
4286
4300
  requested_max,
4287
4301
  )
4302
+ elif (
4303
+ not has_tools
4304
+ and THINKING_MIN_NO_TOOLS > 0
4305
+ and requested_raw < THINKING_MIN_NO_TOOLS
4306
+ and requested_raw > 16 # leave true preflight alone
4307
+ ):
4308
+ requested_max = THINKING_MIN_NO_TOOLS
4309
+ logger.info(
4310
+ "MAX_TOKENS thinking-floor (no-tool): %d -> %d (Qwen mandatory thinking; evaluator verdicts need room after <think>)",
4311
+ requested_raw,
4312
+ requested_max,
4313
+ )
4288
4314
  elif requested_raw < PROXY_MAX_TOKENS_FLOOR and PROXY_MAX_TOKENS_FLOOR > 0:
4289
4315
  logger.info(
4290
4316
  "MAX_TOKENS floor skipped: has_tools=%s thinking_active=%s requested=%d floor=%d",