





















@@ -562,11 +562,14 @@ function extractFinishExactlyDirective(text: string) {
562562}
563563564564function extractExactMarkerDirective(text: string) {
565-const backtickedMatch = extractLastCapture(text, /exact marker:\s*`([^`]+)`/i);
565+const backtickedMatch = extractLastCapture(text, /exact marker\b[^:\n]{0,120}:\s*`([^`]+)`/i);
566566if (backtickedMatch) {
567567return backtickedMatch;
568568}
569-return extractLastCapture(text, /exact marker:\s*([^\s`.,;:!?]+(?:-[^\s`.,;:!?]+)*)/i);
569+return extractLastCapture(
570+text,
571+/exact marker\b[^:\n]{0,120}:\s*([^\s`.,;:!?]+(?:-[^\s`.,;:!?]+)*)/i,
572+);
570573}
571574572575function extractLabeledMarkerDirective(text: string, label: string) {
@@ -1294,19 +1297,22 @@ async function buildResponsesPayload(
12941297},
12951298]);
12961299}
1297-if (QA_TOOL_PROGRESS_ERROR_PROMPT_RE.test(allInputText) && exactReplyDirective) {
1300+const toolProgressReplyDirective = exactReplyDirective ?? exactMarkerDirective;
1301+if (QA_TOOL_PROGRESS_ERROR_PROMPT_RE.test(allInputText) && toolProgressReplyDirective) {
12981302if (!toolOutput) {
12991303return buildToolProgressReadEvents(QA_TOOL_PROGRESS_ERROR_PROMPT_RE);
13001304}
13011305return buildAssistantEvents(
1302-hasToolErrorOutput(toolJson, toolOutput) ? exactReplyDirective : "BUG-TOOL-DID-NOT-FAIL",
1306+hasToolErrorOutput(toolJson, toolOutput)
1307+ ? toolProgressReplyDirective
1308+ : "BUG-TOOL-DID-NOT-FAIL",
13031309);
13041310}
1305-if (QA_TOOL_PROGRESS_PROMPT_RE.test(allInputText) && exactReplyDirective) {
1311+if (QA_TOOL_PROGRESS_PROMPT_RE.test(allInputText) && toolProgressReplyDirective) {
13061312if (!toolOutput) {
13071313return buildToolProgressReadEvents(QA_TOOL_PROGRESS_PROMPT_RE);
13081314}
1309-return buildAssistantEvents(exactReplyDirective);
1315+return buildAssistantEvents(toolProgressReplyDirective);
13101316}
13111317if (
13121318QA_BLOCK_STREAMING_PROMPT_RE.test(allInputText) &&
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。