mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-17 06:41:36 +00:00
fix: preserve Google Gemini 3 cron thinking
This commit is contained in:
@@ -143,11 +143,10 @@ export async function isMaintainerTeamMember({
|
||||
return body?.state === "active";
|
||||
}
|
||||
|
||||
export function extractRealBehaviorProofSection(body = "") {
|
||||
function extractMarkdownSection(headingRegex, body = "") {
|
||||
// Normalize CRLF → LF so regexes and section slicing see GitHub web-editor PR
|
||||
// bodies the same way as locally-authored Markdown.
|
||||
const normalizedBody = normalizeLineEndings(body);
|
||||
const headingRegex = /^#{2,6}\s+real behavior proof\b[^\n]*$/gim;
|
||||
const match = headingRegex.exec(normalizedBody);
|
||||
if (!match) {
|
||||
return "";
|
||||
@@ -158,6 +157,14 @@ export function extractRealBehaviorProofSection(body = "") {
|
||||
return (nextHeading ? rest.slice(0, nextHeading.index) : rest).trim();
|
||||
}
|
||||
|
||||
export function extractRealBehaviorProofSection(body = "") {
|
||||
return extractMarkdownSection(/^#{2,6}\s+real behavior proof\b[^\n]*$/im, body);
|
||||
}
|
||||
|
||||
function extractOutOfScopeFollowUpsSection(body = "") {
|
||||
return extractMarkdownSection(/^#{2,6}\s+out-of-scope follow-ups\b[^\n]*$/im, body);
|
||||
}
|
||||
|
||||
function fieldLineRegex(name) {
|
||||
return new RegExp(
|
||||
`^\\s*(?:[-*]\\s*)?(?:\\*\\*)?${escapeRegex(name)}(?:\\s*\\([^)]*\\))?(?:\\*\\*)?\\s*:\\s*(.*)$`,
|
||||
@@ -300,7 +307,8 @@ export function evaluateRealBehaviorProof({ pullRequest, labels } = {}) {
|
||||
return result("skipped", "Maintainer, collaborator, or bot PRs do not require this gate.");
|
||||
}
|
||||
|
||||
const section = extractRealBehaviorProofSection(pullRequest?.body ?? "");
|
||||
const body = pullRequest?.body ?? "";
|
||||
const section = extractRealBehaviorProofSection(body);
|
||||
if (!section) {
|
||||
return result(
|
||||
"missing",
|
||||
@@ -311,6 +319,9 @@ export function evaluateRealBehaviorProof({ pullRequest, labels } = {}) {
|
||||
const fields = Object.fromEntries(
|
||||
requiredProofFields.map((field) => [field.key, extractFieldValue(section, field)]),
|
||||
);
|
||||
if (!fields.notTested) {
|
||||
fields.notTested = extractOutOfScopeFollowUpsSection(body);
|
||||
}
|
||||
const missingFields = requiredProofFields
|
||||
.filter((field) => isMissingValue(fields[field.key] ?? "", field))
|
||||
.map((field) => field.key);
|
||||
|
||||
Reference in New Issue
Block a user