You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test-assistants.sh: treat a NONE sentinel run into prose as no blocker (#37)
An assistant that writes the BLOCKER line as the NONE sentinel glued straight into an explanatory sentence with no separator (Cursor was observed writing 'NONEThe background action_search.py run was stopped after it hung') meant NONE and merely broke the one-line contract. classify() checked the whole value against is_none, so the run-on read as a real blocker and the run false-FAILed even though STATUS was WORKING and its scripts ran.
Normalize a blocker that leads with the NONE sentinel glued to a capital letter (the '^NONE[A-Za-z]' signature) to NONE, but only when the model did not self-report BLOCKED. A genuine 'None of the actions could be discovered' keeps its space and is left intact, so real blockers still fail. Two parser tests cover both directions.
# Claude and Cursor stream stream-json, so the report arrives inside an escaped
550
+
# JSON string. The first sed expands \n to restore line structure. The second, run
551
+
# as a separate process so it sees the already-split lines individually, drops the
552
+
# JSON structure that trails the closing quote: `"}]}` from a content array or `","`
553
+
# from a result-level string (Cursor's final `result` event closes the report with
554
+
# `","session_id":...`). A single sed with two -e expressions would apply the trim to
555
+
# the original long line before the split, matching the pervasive `","` in JSON prose
556
+
# and killing the whole report. No-ops on plain-text logs.
557
+
body=$(sed 's/\\n/\
558
+
/g'"$log"2>/dev/null | sed 's/"[]}),].*$//'| grep -v '^[[:space:]]*>')
551
559
552
560
# An account-level block — quota or subscription exhausted — is not a skills or
553
561
# harness fault and cannot be fixed by re-running, so treat it as an environment SKIP
554
562
# (like a missing CLI), not a failure. Anchored on assistant billing phrasing so it
555
563
# cannot match a skill doc's own "rate limit" guidance.
556
564
grep -qiE "quota reached|quota exceeded|upgrade your subscription|subscription (required|expired|to increase)|insufficient (credits|quota)|out of (credits|quota)"<<<"$body"&& { echo"SKIP|account|account quota/subscription limit reached||";return; }
557
565
566
+
# A transient backend error — the assistant's own model service is momentarily
567
+
# busy ("Our servers are experiencing high traffic right now, please try again in
568
+
# a minute"). Not a skills or harness fault and it clears on a retry, so treat it
569
+
# as an environment SKIP like a quota block, not a failure. Anchored on
570
+
# backend-busy phrasing so it cannot match a skill doc's own throttling guidance.
571
+
grep -qiE "experiencing high traffic|our servers are (experiencing|busy|overloaded)|temporarily (unavailable|overloaded)|(server|service) is (busy|overloaded)|please try again in a (minute|moment|few)|overloaded_error"<<<"$body"&& { echo"SKIP|transient|assistant backend busy — retryable||";return; }
572
+
558
573
# A Python traceback for a missing dependency is decisive: the venv was never built
559
574
# (the SessionStart hook is Claude-only) or the script was run outside python.sh.
560
575
grep -qiE "ModuleNotFoundError|No module named '(falconpy|yaml|tomli)'"<<<"$body"&& { echo"FAIL|deps|missing Python dependency (venv not built?)||";return; }
@@ -598,6 +613,15 @@ classify() {
598
613
grep -qi 'BLOCK'<<<"$status"&& status=WORKING
599
614
fi
600
615
616
+
# A model sometimes writes the NONE sentinel straight into an explanatory
617
+
# sentence with no separator ("NONEThe background job was stopped") — it meant
618
+
# NONE and merely broke the one-line contract. The glued capital letter is the
619
+
# signature; a genuine "None of the actions could be discovered" keeps its space
620
+
# and is left intact. Only when the model did not self-report BLOCKED.
621
+
if [[ "$raw_blocker"=~ ^[Nn][Oo][Nn][Ee][A-Za-z] ]] &&! grep -qi 'BLOCK'<<<"$status";then
622
+
raw_blocker=NONE
623
+
fi
624
+
601
625
# A real blocker is the result, whatever else the assistant managed to do.
602
626
if grep -qi 'BLOCK'<<<"$status"||! is_none "$raw_blocker";then
603
627
cat=$(blocker_category "$raw_blocker")
@@ -766,6 +790,11 @@ report_one() { # name bin source rc elapsed
766
790
local ebody; ebody=$(grep -v '^[[:space:]]*>'"$log"2>/dev/null)
0 commit comments