From 156e9fe176e958eee2ecd087425da5a6a955cb4a Mon Sep 17 00:00:00 2001 From: leetcrypt Date: Wed, 10 Jun 2026 00:31:19 -0700 Subject: [PATCH] feat(ai): output-aware nudge loop with DONE: terminator for native harness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the overloaded "text + no tool call = done" terminator that made the weak CPU model stall mid-task or give up after a failing command. Termination is now a structural `DONE:` text sentinel; a text-only turn is resolved by an output-aware verdict (DONE: marker / unresolved non-zero exit / no action / filler language) and re-prompted with an exit-code-aware nudge, bounded by MAX_NUDGES on top of max_turns. On exhaustion the summary is honest rather than echoing the model's false "run successfully" — it reports when no tool ran or a command exited non-zero. Live-validated on qwen2.5:3b: the multi-step stall is fixed (proj3 completes end-to-end, ground-truth confirmed); the nudge fires on a 126; residual give-up is model-bound. 23 offline unit assertions pass. Co-Authored-By: Claude Opus 4.6 --- cmd_chat/agent/bridge.py | 118 +++++++++++++++++++-- docs/findings-native-harness-2026-06-10.md | 36 +++++++ 2 files changed, 147 insertions(+), 7 deletions(-) diff --git a/cmd_chat/agent/bridge.py b/cmd_chat/agent/bridge.py index c68d5c4..7dbd68b 100644 --- a/cmd_chat/agent/bridge.py +++ b/cmd_chat/agent/bridge.py @@ -108,9 +108,11 @@ NATIVE_SYSTEM = ( "4. Do not guess interpreter locations — invoke 'bash