fix(review): 4 issues found in agent review of PR #535
BUG-1 (CRITICAL): messages.js line 522 — mismatched quote in
setComposerStatus('Reconnecting…') caused JS syntax error on the
reconnect path.
BUG-2 (HIGH): messages.js line 491 — broken template literal
'\\n\\n*{d.hint}*' restored to '\n\n*${d.hint}*'. Error hint
text was non-functional (missing $ prefix and escaped newlines).
BUG-3 (HIGH): messages.js — showApprovalCard(pending, pendingCount),
_approvalCurrentId, and approval_id in respondApproval() were removed,
regressing the simultaneous approval queue fix from PR #546. Restored
all three, including the '1 of N pending' counter and poll passthrough.
BUG-4 (LOW): api/streaming.py — MiniMax thinking delimiter regex
missing closing pipe: <|channel> -> <|channel|> in both
_strip_thinking_markup() and _looks_invalid_generated_title().
ALSO: test_issue487b.py docstring changed to raw string to fix
DeprecationWarning for invalid escape sequence '\s'.
This commit is contained in:
@@ -66,7 +66,7 @@ def _strip_thinking_markup(text: str) -> str:
|
||||
return ''
|
||||
s = str(text)
|
||||
s = re.sub(r'<think>.*?</think>', ' ', s, flags=re.IGNORECASE | re.DOTALL)
|
||||
s = re.sub(r'<\|channel\>thought.*?<channel\|>', ' ', s, flags=re.IGNORECASE | re.DOTALL)
|
||||
s = re.sub(r'<\|channel\|>thought.*?<channel\|>', ' ', s, flags=re.IGNORECASE | re.DOTALL)
|
||||
s = re.sub(r'^\s*(the|ther)\s+user\s+is\s+asking.*$', ' ', s, flags=re.IGNORECASE | re.MULTILINE)
|
||||
s = re.sub(r'\s+', ' ', s).strip()
|
||||
return s
|
||||
@@ -89,7 +89,7 @@ def _looks_invalid_generated_title(text: str) -> bool:
|
||||
if not s.strip():
|
||||
return True
|
||||
return bool(
|
||||
re.search(r'<think>|<\|channel\>thought', s, flags=re.IGNORECASE)
|
||||
re.search(r'<think>|<\|channel\|>thought', s, flags=re.IGNORECASE)
|
||||
or re.search(r'^\s*(the|ther)\s+user\s+', s, flags=re.IGNORECASE)
|
||||
or re.search(r'^\s*user\s+\w+\s+', s, flags=re.IGNORECASE)
|
||||
or re.search(r'\b(they|user)\s+want(s)?\s+me\s+to\b', s, flags=re.IGNORECASE)
|
||||
|
||||
Reference in New Issue
Block a user